Skip to content

Meshroom nodes: replace documentation attribute with class docstrings and improve all node docs#2084

Open
Copilot wants to merge 4 commits intodevelopfrom
copilot/correct-meshroom-nodes-documentation
Open

Meshroom nodes: replace documentation attribute with class docstrings and improve all node docs#2084
Copilot wants to merge 4 commits intodevelopfrom
copilot/correct-meshroom-nodes-documentation

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

Recent Meshroom versions read node documentation from the class docstring (__doc__) rather than a documentation member variable. This PR migrates all nodes and takes the opportunity to substantially improve coverage and quality.

Description

Two changes are bundled:

  1. Convert documentation attribute → class docstring across all 106 node files in meshroom/aliceVision/. Empty/whitespace-only documentation is dropped entirely.
  2. Improve every node's docstring so each provides a meaningful multi-sentence description of purpose, behaviour, and typical usage context.

Before / After example (ConvertMesh.py):

# Before
class ConvertMesh(desc.AVCommandLineNode):
    commandLine = "aliceVision_convertMesh {allParams}"
    category = "Utils"
    documentation = """Convert a mesh to another mesh format."""

# After
class ConvertMesh(desc.AVCommandLineNode):
    """
Convert a 3D mesh from one file format to another.

Supported formats include OBJ, FBX, glTF, GLB, STL and PLY. The node can optionally flip
face normals (which may be required depending on the winding-order convention used by the
target application) and copy associated texture image files to the output folder.
"""
    commandLine = "aliceVision_convertMesh {allParams}"
    category = "Utils"

Features list

  • Remove documentation class attribute from all 106 node files; replace with PEP-257 class docstring placed as the first statement in the class body.
  • Add docstrings to 7 nodes that previously had none: ExportColoredPointCloud, ExportMatches, ImageMasking, LightingEstimation, SfMDistances, SfmBootstrapping, SfmExpanding.
  • Expand 53 nodes whose docstrings were a single short line into multi-line descriptions covering purpose, algorithm, inputs/outputs context, and usage guidance.
  • Fix prose issues in existing docs: typo formfrom (SfMTransfer), of fromof (ConvertSfMFormat), de-indent internal-note style text (SfMPoseFlattening, SfMRigApplying, SfmLandmarksRemapping, MaskEroding).

Implementation remarks

The attribute-to-docstring migration was performed with a small Python script that:

  • Detected documentation = """...""" / '''...''' patterns inside class bodies.
  • Removed those lines (plus any trailing blank line).
  • Inserted the content as a class docstring immediately after the class definition line.
  • Skipped empty/whitespace-only values rather than emitting an empty docstring.

All 106 files pass python -m py_compile with zero errors.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…hroom nodes

Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Meshroom nodes to use class docstring for documentation Convert Meshroom node documentation member variables to class docstrings Mar 17, 2026
Copilot AI requested a review from fabiencastan March 17, 2026 21:57
Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
@fabiencastan fabiencastan added this to the 3.4.0 milestone Mar 17, 2026
…57, MeshMasking

Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot AI changed the title Convert Meshroom node documentation member variables to class docstrings Meshroom nodes: replace documentation attribute with class docstrings and improve all node docs Mar 17, 2026
@fabiencastan fabiencastan marked this pull request as ready for review March 17, 2026 22:28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect documentation (No morpho)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"suitable for panorama stitching" is theorically correct but misleading

This node analyses feature matches across image pairs and estimates the rotation
between each pair of cameras. It assumes that all cameras rotate around a common
nodal point (no translation), which is the typical capture model for panoramic photography.
The result is an SfMData containing the estimated rotation for each view, which serves
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not requires a panoramaRefining

"""
Refine panorama camera rotations using bundle adjustment.
Starting from the initial rotation estimates produced by PanoramaEstimation, this node
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, PanoramaEstimation is not related to this node

Comment on lines +11 to +15
This node scans the provided image files and directories, reads available metadata
(e.g., EXIF focal length, sensor dimensions, serial number), and produces a minimal
SfMData file listing all discovered views with their associated intrinsic parameters.
The resulting SfMData is suitable as an input for the CameraInit node or other nodes
that accept an SfMData file without requiring reconstructed poses.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This node scans the provided image files and directories, reads available metadata
(e.g., EXIF focal length, sensor dimensions, serial number), and produces a minimal
SfMData file listing all discovered views with their associated intrinsic parameters.
The resulting SfMData is suitable as an input for the CameraInit node or other nodes
that accept an SfMData file without requiring reconstructed poses.
This node scans the specified files and directories to identify image files by their extension,
then generates a minimal SfMData file listing. The output contains no metadata, intrinsics,
or posesmaking it ideal for pipelines such as the ImageProcessing node, where
no knowledge of camera intrinsics or extrinsics is required.```

Comment on lines +32 to +36
Given multiple directories of binary masks (where corresponding masks share the same filename),
this node can combine them using logical operations (AND, OR, XOR) and apply morphological
operations such as dilation and erosion. This is useful for refining or combining masks
produced by different segmentation methods before using them in depth map estimation
or texturing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Given multiple directories of binary masks (where corresponding masks share the same filename),
this node can combine them using logical operations (AND, OR, XOR) and apply morphological
operations such as dilation and erosion. This is useful for refining or combining masks
produced by different segmentation methods before using them in depth map estimation
or texturing.
Given multiple directories of binary masks (where corresponding masks share the same filename),
this node can combine them using logical operations (AND, OR, XOR). This is useful for combining
masks produced by different segmentations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants