Skip to content

[core] Provide node access in expressions#3013

Open
fabiencastan wants to merge 3 commits intodevelopfrom
dev/nodeAccessInExpressions
Open

[core] Provide node access in expressions#3013
fabiencastan wants to merge 3 commits intodevelopfrom
dev/nodeAccessInExpressions

Conversation

@fabiencastan
Copy link
Member

@fabiencastan fabiencastan commented Feb 24, 2026

On output strings, this allows to directly access the node (as we do with the lamda).
Same on the command line expression of desc.CommandLineNode.

So instead of:
commandLine = "ffmpeg -i {inputValue} {outputValue}"
We can also do:
commandLine = "ffmpeg -i {node.input.value} {node.output.value}"

On output strings, this allows to directly access the node (as we do
with the lamda).
Same on the command line expression of desc.CommandLineNode.

So instead of:
commandLine = "ffmpeg -i {inputValue} {outputValue}"
We can also do:
commandLine = "ffmpeg -i {node.input.value} {node.output.value}"
@fabiencastan fabiencastan added the feature new feature (proposed as PR or issue planned by dev) label Feb 24, 2026
@fabiencastan fabiencastan added this to the Meshroom 2026.1.0 milestone Feb 24, 2026
Copy link
Contributor

Copilot AI left a 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 direct node access in string expressions by including the node object itself in the _expVars dictionary. This enhancement allows users to write expressions like {node.input.value} in addition to the existing shorthand {inputValue} or lambda-based approaches.

Changes:

  • Added "node": self to the _expVars dictionary in the _buildExpVars method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

self._expVars = {
"uid": self._uid,
"nodeCacheFolder": self._internalFolder,
"node": self,
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

The existing test for expression variables in tests/test_nodes.py::test_expVariables should be extended to verify that the new 'node' key is present in _expVars and that it correctly references the node object. This would ensure that the feature works as intended and prevent regressions.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor

Copilot AI commented Feb 24, 2026

@fabiencastan I've opened a new pull request, #3014, to work on those changes. Once the pull request is ready, I'll request review from you.

@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.38%. Comparing base (43a24bb) to head (5a896a6).
⚠️ Report is 11 commits behind head on develop.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3013      +/-   ##
===========================================
+ Coverage    81.99%   82.38%   +0.38%     
===========================================
  Files           69       70       +1     
  Lines         9315     9359      +44     
===========================================
+ Hits          7638     7710      +72     
+ Misses        1677     1649      -28     

☔ View full report in Codecov by Sentry.
📢 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.

Move generic attributes formatting in a dedicated unit test.
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.

3 participants