Skip to content

[graph] Add possibility to set a specific cacheDir in the mg scene#3077

Open
Alxiice wants to merge 2 commits intodevelopfrom
feature/set_custom_path_for_cache_dir
Open

[graph] Add possibility to set a specific cacheDir in the mg scene#3077
Alxiice wants to merge 2 commits intodevelopfrom
feature/set_custom_path_for_cache_dir

Conversation

@Alxiice
Copy link
Copy Markdown
Contributor

@Alxiice Alxiice commented Apr 14, 2026

Description

Add possibility to set a specific cache folder in the mg scene

  • In meshroom_batch a new option enables saving the scene with a specific cache folder.
  • a _explicitCacheDir parameter in the Graph tracks whether the cache folder should be the default one or a custom one
  • functions were added to set the default cache path or a custom one

About the Meshroom file :

  • graphIO : a CacheDir key was added to the serialized format. Serialization is designed to save the cacheDir inside the .mg file
  • graph : the deserialization is designed to load the explicit cache folder if we get one, and if we don't to select the default path (./MeshroomCache)

Tests

Here is a command that can be used to set a new cache directory in a meshroom file

ROOT="..."
MG_FILE_IN="$ROOT/scene.mg"
MG_FILE_OUT="$MG_FILE_IN"
CACHE_DIR="$ROOT/MeshroomCache-v001"
meshroom_batch -p $MG_FILE_IN -s $MG_FILE_OUT --compute no --overrideCacheDir $CACHE_DIR

The following steps can test this feature :

  1. Create a new meshroom scene
  2. Compute the graph
  3. Close it
  4. Follow above script to set a new custom cache
  5. Open the scene
  6. You should see that the nodes are considered not computed (because we changed the cache to an empty folder). The new cache folder is set and can be seen on the status bar (at the bottom)
  7. Empty the previous cache folder (MeshroomCache)
  8. Launch the process on the current (new) scene
  9. It doesn't affect the original cache folder but the new cache is filled with the current scene nodes computation data

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 88.46154% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.36%. Comparing base (2ed841d) to head (036dcba).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
meshroom/core/graph.py 85.71% 2 Missing ⚠️
meshroom/core/graphIO.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3077   +/-   ##
========================================
  Coverage    83.35%   83.36%           
========================================
  Files           73       73           
  Lines         9890     9913   +23     
========================================
+ Hits          8244     8264   +20     
- Misses        1646     1649    +3     

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

@Alxiice Alxiice force-pushed the feature/set_custom_path_for_cache_dir branch from d9ec9d4 to b1c1131 Compare April 14, 2026 16:13
@Alxiice Alxiice force-pushed the feature/set_custom_path_for_cache_dir branch from b1c1131 to 036dcba Compare April 17, 2026 13:29
ghost

This comment was marked as spam.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant