Skip to content

Attribute converter nodes - #3161

Open
Alxiice wants to merge 14 commits into
developfrom
feat/attribute_converter_nodes
Open

Attribute converter nodes#3161
Alxiice wants to merge 14 commits into
developfrom
feat/attribute_converter_nodes

Conversation

@Alxiice

@Alxiice Alxiice commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Register nodes for attribute conversion.
image

How does it work

  • AttributeConverter nodes are declaring what type conversion they are doing, and they implement a convert method to handle the conversion. A notion of priority is used to know what is the default conversion from a type to another.
  • These nodes are registered through the plugin system.
  • We allow connection from type A and type B if A=B or if a converter exist for A->B.
  • When an edge is created with a converter, the converter is saved on the Edge object.
  • When the graph is saved, we serialize the converters, and when the graph is loaded we unserialize them.
  • We can change the converter through the interface with a right click on the converter badge:
image

@Alxiice Alxiice self-assigned this Jul 7, 2026
Comment thread bin/meshroom_info Fixed
Comment thread meshroom/core/__init__.py Fixed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an AttributeConverter framework to support automatic conversion of attribute values between different types, along with several default converter implementations and integration into the meshroom_info CLI. The review feedback highlights several critical improvements: resolving potential TypeError and AttributeError exceptions in the converter registry and base class, correcting a class name mismatch in the boolean-to-integer converter, ensuring Liskov Substitution Principle compliance for isValid signatures, preventing a variable overwrite in the CLI parser, and maintaining return type consistency in converter loading functions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread meshroom/core/plugins.py Outdated
Comment thread meshroom/nodes/converters/BoolToInt.py Outdated
Comment thread meshroom/nodes/converters/StringToChoice.py Outdated
Comment thread bin/meshroom_info Outdated
Comment thread meshroom/core/plugins.py Outdated
Comment thread meshroom/core/desc/attributeConverter.py Outdated
Comment thread meshroom/core/__init__.py
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.65775% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.85%. Comparing base (1d89d80) to head (c78b245).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
meshroom/core/graph.py 58.53% 34 Missing ⚠️
meshroom/core/attributeConverter.py 74.07% 14 Missing ⚠️
meshroom/core/attribute.py 86.36% 3 Missing ⚠️
meshroom/core/__init__.py 90.90% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3161      +/-   ##
===========================================
- Coverage    86.07%   85.85%   -0.23%     
===========================================
  Files           78       79       +1     
  Lines        12111    12274     +163     
===========================================
+ Hits         10425    10538     +113     
- Misses        1686     1736      +50     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Alxiice
Alxiice force-pushed the feat/attribute_converter_nodes branch from 9889ce7 to f66bf0d Compare July 13, 2026 07:53
Comment thread meshroom/core/attribute.py Fixed
Comment thread meshroom/core/graph.py Dismissed
@Alxiice
Alxiice force-pushed the feat/attribute_converter_nodes branch from 97fb1bf to 9b87344 Compare July 13, 2026 17:05
Comment thread meshroom/core/graph.py Fixed
@Alxiice
Alxiice force-pushed the feat/attribute_converter_nodes branch from 9b87344 to ea03bb6 Compare July 13, 2026 17:17
@Alxiice
Alxiice marked this pull request as ready for review July 13, 2026 17:18
Comment thread meshroom/core/attributeConverter.py Fixed
@Alxiice
Alxiice force-pushed the feat/attribute_converter_nodes branch 2 times, most recently from 87dab39 to 514a7b4 Compare July 13, 2026 17:54
@Alxiice
Alxiice force-pushed the feat/attribute_converter_nodes branch from 514a7b4 to adb4e98 Compare July 15, 2026 10:38

@fabiencastan fabiencastan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be better to have lightweight nodes (without computation like InitNode) for edge expressions.

@cbentejac cbentejac added this to the Meshroom 2026.1.0 milestone Jul 31, 2026
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