Skip to content

Conversation

@demoulinv
Copy link
Contributor

Description

This PR implements the path resolution function within meshroom core in the new file fileUtils.py. That resolution was formerly implemented in meshroom ui components. The original method still exists but has been cleaned up and calls the new ones.

The path resolution function replace all the fields in a template name by their corresponding value extracted whether from an input filepath or a viewpoint.

A dictionary is built from the input filepath or the viewpoint. The fields to be replaced in the template name are supposed to be found amongst the keys of that dictionary. In case a key does not exist the corresponding input field is discarded to build the resolved path. Such a case can occur for example if the field is used in the template whereas the input filepath does not contain any value corresponding to a frame number.

The way the replacement is done has also been optimized using regex sub function.

Features list

Implementation remarks

@demoulinv demoulinv added this to the Meshroom 2026.1.0 milestone Sep 9, 2025
@demoulinv demoulinv requested a review from Copilot September 9, 2025 13:44
@demoulinv demoulinv self-assigned this Sep 9, 2025
@demoulinv demoulinv added the python Pull requests that update python code label Sep 9, 2025
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 refactors path resolution functionality from the UI layer to the core layer by implementing a new fileUtils.py module in meshroom core. The refactoring centralizes template-based path resolution logic that replaces field placeholders like <FIELD> with actual values extracted from file paths or viewpoints.

Key changes:

  • Creates new fileUtils.py with functions for extracting file elements, view elements, and pattern replacement
  • Simplifies the UI filepath.py by removing duplicate path resolution logic and delegating to the new core functions
  • Optimizes replacement implementation using regex substitution instead of iterative string replacement

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
meshroom/core/fileUtils.py New module implementing core path resolution functions with regex-based pattern matching
meshroom/ui/components/filepath.py Simplified by removing path resolution logic and calling new core functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.55%. Comparing base (b21ca05) to head (cc4efe9).
⚠️ Report is 170 commits behind head on develop.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2881   +/-   ##
========================================
  Coverage    79.55%   79.55%           
========================================
  Files           51       51           
  Lines         6974     6974           
========================================
  Hits          5548     5548           
  Misses        1426     1426           

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

@fabiencastan fabiencastan force-pushed the dev/core_add_file_utils branch from 9957293 to d6c5bef Compare September 20, 2025 22:47
@demoulinv demoulinv force-pushed the dev/core_add_file_utils branch from 57e2061 to b339973 Compare September 22, 2025 12:35
@demoulinv demoulinv force-pushed the dev/core_add_file_utils branch from b339973 to cc4efe9 Compare September 22, 2025 12:36
@cbentejac cbentejac changed the title Path resolution function in meshroom core Perform path resolution function in Meshroom core Oct 17, 2025
@cbentejac cbentejac merged commit c0532e0 into develop Oct 17, 2025
5 checks passed
@cbentejac cbentejac deleted the dev/core_add_file_utils branch October 17, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants