Skip to content

Use the node name as the default label in the graph editor#3157

Open
Alxiice wants to merge 6 commits into
developfrom
feat/match_node_name_and_label
Open

Use the node name as the default label in the graph editor#3157
Alxiice wants to merge 6 commits into
developfrom
feat/match_node_name_and_label

Conversation

@Alxiice

@Alxiice Alxiice commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

  1. This PR will make sure the node name and displayed name in the graph editor are the same (Fig. 1).
  2. This PR fixes an issue in the task manager. When a node is computed, it is added to the task manager dict model. If the node is renamed the node is still in the dict model but with the wrong key. It used to block relaunching the compute on this node. Now renaming the node will also update the key in the task manager dict model.
  3. Now copying nodes will set the correct name, not reset the node name to the node type.
  4. Node name by default has no index suffix (only if the name is taken). Then if we create a new node with the same name the node will have the suffix _1, then _2, and so on (Fig. 2).
  5. Now, setting the name to an empty string will reset the name to the default label

image
Fig. 1: Before (top) / After (bottom)

image
Fig. 2: Nodes have no more index suffix by default

Important

Even though the node name edition box blocks typing underscores, nodes can technically have underscores in their names : if the underscore character is c/p in the node name; if we edit the graph on disk; or if the node description class name have the symbol.
Now the unique name generation rely on removing the end _N suffix, so underscores are preserved.
The only exception are node types named "XXX_N" (e.g. NodeType_Test_3) : if nodes with this node type are created, the name will be stripped from the _Nprefix (in our case: NodeType_Test for the first instance, then NodeType_Test_1, etc)

@Alxiice Alxiice self-assigned this Jul 2, 2026
@Alxiice Alxiice added the feature new feature (proposed as PR or issue planned by dev) label Jul 2, 2026
@Alxiice Alxiice added this to the Meshroom 2026.1.0 milestone Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.78%. Comparing base (507e2dc) to head (d60be93).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
meshroom/core/node.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3157      +/-   ##
===========================================
+ Coverage    85.75%   85.78%   +0.03%     
===========================================
  Files           78       78              
  Lines        12087    12087              
===========================================
+ Hits         10365    10369       +4     
+ Misses        1722     1718       -4     

☔ 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.

@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 refactors node renaming and labeling in Meshroom. It removes the nameToLabel helper, updates the name property to be writable, and introduces a renameNode method in the task manager. Additionally, it updates the unique node name generation format to omit the underscore separator and allows resetting a node's name to its default label by passing an empty string. The reviewer identified two critical issues: first, calling _taskManager.renameNode directly in UIGraph.renameNode breaks undo/redo functionality, which should instead be handled within RenameNodeCommand; second, removing the underscore separator in unique node names breaks getNodeIndexFromName, which relies on splitting by _ to parse the node index.

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/ui/graph.py Outdated
Comment thread meshroom/core/graph.py
@Alxiice
Alxiice force-pushed the feat/match_node_name_and_label branch 3 times, most recently from 3c43a38 to b0f11d3 Compare July 7, 2026 10:56
Comment on lines +22 to +56


class Input_Int2(desc.InitNode, desc.InputNode):
"""
This node is an init node that receives an Integer.
"""

category = "Other"

inputs = [
desc.IntParam(
name="integer",
label="Input Integer",
description="An integer.",
value=0,
exposed=True
)
]

class Input_Int_3(desc.InitNode, desc.InputNode):
"""
This node is an init node that receives an Integer.
"""

category = "Other"

inputs = [
desc.IntParam(
name="integer",
label="Input Integer",
description="An integer.",
value=0,
exposed=True
)
]

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.

This should be removed, I'm assuming it was intended to be used for tests prior to creating the PR.

Suggested change
class Input_Int2(desc.InitNode, desc.InputNode):
"""
This node is an init node that receives an Integer.
"""
category = "Other"
inputs = [
desc.IntParam(
name="integer",
label="Input Integer",
description="An integer.",
value=0,
exposed=True
)
]
class Input_Int_3(desc.InitNode, desc.InputNode):
"""
This node is an init node that receives an Integer.
"""
category = "Other"
inputs = [
desc.IntParam(
name="integer",
label="Input Integer",
description="An integer.",
value=0,
exposed=True
)
]

@Alxiice
Alxiice force-pushed the feat/match_node_name_and_label branch from d60be93 to 0c03ff2 Compare July 15, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature new feature (proposed as PR or issue planned by dev)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants