Skip to content

Conversation

@Alxiice
Copy link
Contributor

@Alxiice Alxiice commented Aug 18, 2025

  • Adding ExpressionTextField component that is evaluating and replacing the text field when entered math expressions
    expre1
  • Error cases are handled with NaN values and a visual indicator
    expre2
  • Possibility to specify if the field is int or float (int will automatically cast to an integer)

For now this is used :

  • On slider attributes (Used for IntParam and FloatParam)
  • On the HdrImageToolbar component and on the gamma and gain settings

Some additional examples :
Peek 2025-09-09 13-03

@Alxiice Alxiice added this to the Meshroom 2025.x milestone Aug 18, 2025
@codecov
Copy link

codecov bot commented Aug 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.79%. Comparing base (e704e5b) to head (5bc6fdb).
⚠️ Report is 5 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2836   +/-   ##
========================================
  Coverage    77.79%   77.79%           
========================================
  Files           50       50           
  Lines         6725     6725           
========================================
  Hits          5232     5232           
  Misses        1493     1493           

☔ 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 dev/enable_math_expressions_on_text_fields branch 2 times, most recently from f95c885 to b071519 Compare August 21, 2025 09:03
@Alxiice Alxiice force-pushed the dev/enable_math_expressions_on_text_fields branch 2 times, most recently from 04cb651 to e53a9ff Compare August 25, 2025 08:48
@cbentejac cbentejac requested a review from Copilot August 25, 2025 12:46
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 introduces mathematical expression evaluation capabilities to specific text fields in the UI, allowing users to input mathematical expressions that are automatically evaluated and replaced with their computed results.

  • Adds a new ExpressionTextField component that evaluates math expressions and handles error cases with visual indicators
  • Implements a JavaScript-based math evaluator supporting common mathematical functions and constants
  • Replaces standard text fields with expression-enabled fields in slider controls and HDR image toolbar

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
meshroom/ui/qml/Controls/mathEvaluator.js JavaScript math evaluator library supporting functions, constants, and expression parsing
meshroom/ui/qml/Controls/ExpressionTextField.qml New TextField component with expression evaluation and error handling capabilities
meshroom/ui/qml/Controls/qmldir Module registration for the new components
meshroom/ui/qml/GraphEditor/AttributeItemDelegate.qml Replaces TextField with ExpressionTextField for slider components
meshroom/ui/qml/Viewer/HdrImageToolbar.qml Updates gain and gamma controls to use ExpressionTextField
meshroom/core/desc/attribute.py Adds NaN validation for integer attributes

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

This comment was marked as off-topic.

@Alxiice Alxiice force-pushed the dev/enable_math_expressions_on_text_fields branch from e53a9ff to 7c9e85b Compare September 5, 2025 14:23
@Alxiice Alxiice requested a review from cbentejac September 9, 2025 11:05
@Alxiice Alxiice force-pushed the dev/enable_math_expressions_on_text_fields branch from 7f26db7 to 5bc6fdb Compare September 9, 2025 12:39
@cbentejac cbentejac merged commit 077135e into develop Sep 10, 2025
5 checks passed
@cbentejac cbentejac deleted the dev/enable_math_expressions_on_text_fields branch September 10, 2025 16:20
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.

3 participants