Skip to content

Conversation

@cbentejac
Copy link
Contributor

@cbentejac cbentejac commented Dec 26, 2024

Description

This PR will invalidate all pre-existing graphs.

Failures of the CI will be solved when the following PR will be merged: meshroomHub/mrSegmentation#12.

This PR adds new variables that can be used in the description of nodes to write relative paths. For each Node object, there are currently two variables that are available by default:

  • {nodeCacheFolder}, which points towards the cache folder for this node (and is effectively the same as desc.Node.internalFolder);
  • {nodeSourceCodeFolder}, which points towards the folder containing the node's description.

These variables are resolved with the cmdVars dictionary, which contains essentially the {"key": "value"} mapping for all the attributes in a node's command line. desc.Node.internalFolder is removed as its purpose is fully replaced by {nodeCacheFolder}, and {nodeSourceCodeFolder} replaces the absolute path for the Blender script in the ScenePreview node.

Features

  • Add {nodeCacheFolder} and {nodeSourceCodeFolder} to the list of command-line variables
  • Fix "Open File" links in the Node Editor

Implementation remarks

For output attributes, we implement a change that will invalidate almost all pre-existing graphs: when computing an output attribute, we want "/path/to/something" to evaluate to the same thing as "/path/to/something/". "/" on the right are thus stripped from invalidation values when evaluating the UID for an output attribute. This causes all the nodes which had outputs finishing with a "/" to evaluate to a new UID, hence the invalidation of all pre-existing graphs.

@cbentejac cbentejac added this to the Meshroom 2024.1.0 milestone Dec 26, 2024
@cbentejac cbentejac self-assigned this Dec 26, 2024
@cbentejac cbentejac force-pushed the dev/relativePaths branch 2 times, most recently from 53206f9 to 34e1495 Compare December 27, 2024 08:52
@codecov
Copy link

codecov bot commented Dec 27, 2024

Codecov Report

Attention: Patch coverage is 78.12500% with 7 lines in your changes missing coverage. Please review.

Project coverage is 73.31%. Comparing base (5791bdb) to head (2c06ea4).
Report is 14 commits behind head on develop.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
meshroom/nodes/aliceVision/ImageProcessing.py 25.00% 3 Missing ⚠️
meshroom/nodes/aliceVision/Texturing.py 0.00% 3 Missing ⚠️
meshroom/nodes/aliceVision/CameraInit.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2629      +/-   ##
===========================================
+ Coverage    73.26%   73.31%   +0.05%     
===========================================
  Files          131      131              
  Lines         7873     7889      +16     
===========================================
+ Hits          5768     5784      +16     
  Misses        2105     2105              

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

@cbentejac cbentejac force-pushed the dev/relativePaths branch 8 times, most recently from 8c37fd0 to 3042f94 Compare December 27, 2024 13:42
@cbentejac cbentejac marked this pull request as ready for review December 27, 2024 14:31
Copy link
Member

@fabiencastan fabiencastan left a comment

Choose a reason for hiding this comment

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

Sorry, I should have seen that in the first review...

@cbentejac cbentejac marked this pull request as draft January 8, 2025 16:41
@cbentejac cbentejac added the invalidate:graph Invalidates the cache of the entire computation graph. label Jan 14, 2025
@cbentejac cbentejac force-pushed the dev/relativePaths branch 2 times, most recently from e21fc38 to 0dd5c10 Compare January 23, 2025 10:52
@cbentejac cbentejac marked this pull request as ready for review January 23, 2025 15:56
@cbentejac cbentejac marked this pull request as draft February 13, 2025 17:32
@cbentejac cbentejac added the feature new feature (proposed as PR or issue planned by dev) label Feb 17, 2025
@cbentejac cbentejac marked this pull request as ready for review February 17, 2025 12:20
cbentejac added 10 commits March 5, 2025 13:26
This property stores the location of the source code for a given node
and is not exposed to the QML side.
Add 2 default entries to the command line variables:
- `nodeCacheFolder`, which contains the location of the cache folder
- `nodeSourceCodeFolder`, which contains the location of the file
describing the node
This is fully replaced with `{nodeCacheFolder}`.
By doing so, invalidation values will evaluate to the same UID
independently from whether the attribute's value has been written
with an extra "/" or not.
Otherwise, input attributes with variables (either environment ones
or local ones) cannot be opened through "Open File", even though "Open
Containing Folder" works fine.
@cbentejac cbentejac force-pushed the dev/relativePaths branch from 31d0b71 to 2c06ea4 Compare March 5, 2025 13:36
@fabiencastan
Copy link
Member

Need update to fix the CI.

@cbentejac cbentejac merged commit 21afd05 into develop Mar 10, 2025
6 of 9 checks passed
@cbentejac cbentejac deleted the dev/relativePaths branch March 10, 2025 10:48
cbentejac added a commit to meshroomHub/mrDepthEstimation that referenced this pull request Mar 10, 2025
cbentejac added a commit that referenced this pull request Mar 10, 2025
For nodes that were added right before the merge of #2629, the replacement
still needed to be done.
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) invalidate:graph Invalidates the cache of the entire computation graph.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants