-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add support for backdrops in the Graph #2979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2979 +/- ##
===========================================
- Coverage 79.80% 79.66% -0.14%
===========================================
Files 64 65 +1
Lines 8674 8740 +66
===========================================
+ Hits 6922 6963 +41
- Misses 1752 1777 +25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for backdrop nodes in the graph editor, enabling users to visually group and organize nodes with resizable backdrop containers. It replaces PR #2574.
Changes:
- Introduces a new BackdropNode type at both the core (Python) and UI (QML) levels
- Adds resizing functionality for backdrop nodes with drag handles for all four sides
- Implements automatic child node selection when backdrop nodes are selected or dragged
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| meshroom/ui/qml/GraphEditor/qmldir | Registers the new Backdrop.qml component |
| meshroom/ui/qml/GraphEditor/Backdrop.qml | New component implementing the visual representation and interaction logic for backdrop nodes |
| meshroom/ui/qml/GraphEditor/GraphEditor.qml | Updates node instantiation to use Loader pattern supporting both Node and Backdrop components; removes semicolons for consistency |
| meshroom/ui/qml/GraphEditor/NodeEditor.qml | Adds conditional UI handling for backdrop nodes (hides attributes tab, shows only notes/documentation) |
| meshroom/ui/qml/GraphEditor/Node.qml | Adds isBackdropNode property for type checking |
| meshroom/ui/qml/Controls/DelegateSelectionBox.qml | Adds logic to automatically select backdrop children when backdrop is selected |
| meshroom/ui/graph.py | Implements resizeNode and resizeAndMoveNode methods for backdrop manipulation; adds BackdropNode import |
| meshroom/ui/components/geom2D.py | Adds rectRectFullIntersect method for checking if one rectangle fully contains another |
| meshroom/nodes/general/Backdrop.py | Defines the Backdrop node plugin |
| meshroom/core/nodeFactory.py | Adds getNodeConstructor function to select appropriate node class (BackdropNode vs Node) |
| meshroom/core/node.py | Implements BackdropNode class with resizing properties (nodeWidth, nodeHeight, fontSize) |
| meshroom/core/graph.py | Updates node creation to use getNodeConstructor |
| meshroom/core/desc/node.py | Adds BACKDROP MrNodeType, BackdropNode descriptor, and InternalAttributesFactory for managing node internal attributes |
| meshroom/core/desc/init.py | Exports new BackdropNode and InternalAttributesFactory classes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2fac1c7 to
78941e3
Compare
…invalidating attribute Following the changes regarding the internal inputs, `InputNodes` now do not have the `invalidation` internal attribute anymore. If their inputs/outputs are not taken into account in the UID computation, their UID may not be serialized, which leaves them open to an automatic upgrade if they ever are in Compatibility Mode.
This allows to distinguish between the regular `Node` constructor, which was used up until now, and the `BackdropNode` constructor, which is to be used if the node type is "Backdrop".
Co-authored-by: waaake <[email protected]>
…` component Co-authored-by: waaake <[email protected]>
- "resizeNode" only updates the internal width and height attributes - "resizeAndModeNode" updates the internal width and height attributes as well as the position of the backdrop (if it has been resized from the top or left sides, its top-left corner has moved so its position has changed)
Co-authored-by: waaake <[email protected]>
…nodes Co-authored-by: waaake <[email protected]>
- Remove useless `isBackdropNode` property in Node.qml - Remove useless `isBackdrop` property in Backdrop.qml - Use `getItemAt` accessor when relevant - Fix typos in property names and comments - Remove semicolons when they are not needed
78941e3 to
7025ce9
Compare
Description
This PR is a replacement for #2574.
It introduces a new "Backdrop" node type to Meshroom's core and UI, allowing users to visually group nodes in the graph editor.
Backdrops are a specific type of node that can be instantiated as any other node type, but have no input or output attributes. They only possess internal attributes, including their size (width and height) as they can be resized. Backdrops can be given custom names, colors, and display any comment that was added by the user (with an adjustable font size).
Visually, backdrops are always placed behind any non-backdrop node they may be overlapping with. Whenever a node is fully contained within a backdrop node, it is automatically "attached" to it: moving the backdrop will move the node as well. Conversely, moving a node that is contained within a backdrop will not move the backdrop. As selecting a backdrop adds the nodes that are contained in it to the selection, two new controls are added when clicking on a backdrop:
Features list
BackdropNodetype of node which is non-computable and only has internal attributes.Backdropnode description to make backdrops instantiable.BackdropQML component.Implementation remarks
Backdrop Node Support:
BackdropNodeclass in bothdesc.nodeandcore.node, representing a non-computable node for grouping other nodes visually. The Backdrop node has its own internal attributes and serialization logic. (F2d2396aL336R336, [1] [2]getNodeConstructorutility. [1] [2] [3] [4] [5] [6]MrNodeTypeenum and related type-handling logic to recognize the new BACKDROP node type. [1] [2] [3] [4] [5] [6]Node Internal Attributes & Display Properties:
InternalAttributesFactory, with attribute sets for basic, invalidation, and resizable (font size, width, height) properties. [1] [2]NodeforfontSize,nodeWidth, andnodeHeight, enabling UI customization for nodes, especially Backdrop nodes. [1] [2]isBackdropNodeproperty. [1] [2] [3]