Add DynamicAttribute feature#3090
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
…L, commands, serialization Agent-Logs-Url: https://github.com/alicevision/Meshroom/sessions/77256082-c0d2-4ca8-b477-4d17b3e4cf98 Co-authored-by: nicolas-lambert-tc <210010084+nicolas-lambert-tc@users.noreply.github.com>
Agent-Logs-Url: https://github.com/alicevision/Meshroom/sessions/77256082-c0d2-4ca8-b477-4d17b3e4cf98 Co-authored-by: nicolas-lambert-tc <210010084+nicolas-lambert-tc@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
nicolas-lambert-tc
May 5, 2026 10:18
View session
| node = self.graph.node(self.nodeName) | ||
| if not self.dynAttrName or not node.hasAttribute(self.dynAttrName): | ||
| return True | ||
| dynAttr = node.attribute(self.dynAttrName) |
| dynAttr = dstNode.attribute("dynInputs") | ||
| srcDesc = srcNode.attribute("output")._desc | ||
|
|
||
| newAttr = dstNode.addDynamicInput("dynInputs_0", srcDesc, dynAttr) |
| @@ -0,0 +1,144 @@ | |||
| """Tests for the DynamicAttribute feature.""" | |||
| import pytest | |||
| """Tests for the DynamicAttribute feature.""" | ||
| import pytest | ||
|
|
||
| from meshroom.core import desc |
| attr = self.attribute(k) | ||
| attr.value = v | ||
|
|
||
| def _insertDynamicInput(self, attrName, typeName, dynAttrName, value=None): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
DynamicAttributeto Meshroom. ADynamicAttributeis a special input attribute that appears as an empty connection pin (no label, highlighted) in the graph editor. When an output attribute is connected to it, a new sibling input attribute of the same type as the source is automatically created on the node and linked. The DynamicAttribute itself stays empty and accepts further connections.Changes
Core
meshroom/core/desc/attribute.pyDynamicAttributedescriptor classmeshroom/core/desc/__init__.pyDynamicAttributemeshroom/core/attribute.pyDynamicAttributeinstance –_validateIncomingConnectionalways returnsTruemeshroom/common/core.pyinsert(i, obj)method onCoreDictModel(enables ordered insertion in standalone mode)meshroom/core/node.pyNodeextended with_dynamicInputstracking,addDynamicInput(),removeDynamicInput(),_insertDynamicInput()and serialization intoDict()meshroom/core/nodeFactory.pyUI
meshroom/ui/commands.pyAddDynamicInputCommandandRemoveDynamicInputCommand(full undo/redo support)meshroom/ui/graph.pyaddEdgedispatches toAddDynamicInputCommandfor DynamicAttribute targets;removeEdgeauto-removes the dynamic input when its edge is deletedmeshroom/ui/qml/GraphEditor/AttributePin.qmlisDynamicproperty, hidden label, highlighted pin colourTests
tests/nodes/test/DynamicInputsNode.pyDynamicAttributetests/test_dynamic_attribute.pyHow it works
desc.DynamicAttribute(name="dynInputs", ...).UIGraph.addEdge, which pushes anAddDynamicInputCommand.dynInputs_0,dynInputs_1, …), inserts the new attribute before the DynamicAttribute in the node, and connects the edge.RemoveDynamicInputCommand).dynamicInputsfield of the node's JSON and reconstructed on load.