Skip to content

Conversation

@gregoire-dl
Copy link
Member

@gregoire-dl gregoire-dl commented Sep 26, 2025

Important

This pull request is based on #2878.

Description

This PR introduces shapes attributes, a shape viewer and a shape editor.
The goal is to support primitive shape node attributes with both display and visual editing capabilities in Meshroom.

Shape attributes:

New attributes available for Meshroom nodes:

  • Shape attributes (keyable or not):
    • Size2d: (width: FloatParam, height: FloatParam)
    • Point2d: (x: FloatParam, y: FloatParam)
    • Line2d: (a: Point2d, b: Point2d)
    • Rectangle: (center: Point2d, size: Size2d)
    • Circle: (center: Point2d, radius: FloatParam)
  • ShapeList attribute to handle a list of shapes (keyable or not).

Shape editor:

The new ShapeEditor in NodeEditor allows users to display or hide shapes in the viewer, initialize or reset them, add or remove elements from a ShapeList, change shape colors, and select individual shapes.

editor
The new shape editor on the NodeEditor.

Shape viewer:

The new ShapeViewer allows to display and visually edit the shapes directly on top of the Meshroom 2d Viewer.
Shapes can be repositioned and adjusted via draggable handles, with stroke width remaining consistent during zoom.

circle line
rectangle point
Various shape attributes in the ShapeViewer.

JSON shape file support:

The ShapeEditor and ShapeViewer can automatically load JSON shape data from node File attributes.
With File attribute semantic="shapeFile" and a JSON file with the proper structure.
This can be really useful for visualizing computation results and debugging.
Shape files also support text display.

shapefile
file
A node output shape file in the ShapeEditor and the ShapeViewer.

Unit tests cover:

  • Creation and initialization of shape attributes / shape list attributes.
  • Modification and deletion of shape attributes / shape list attributes.
  • Linked shape attributes / shape list attributes.
  • Shape attribute with keyable shape.
  • Shape attribute value exported as python dict.

Samples:

Features list

  • Add shape attribute
  • Add shape list attribute
  • Add shape attribute descriptions (Point2d, Line2d, Rectangle and Circle)
  • Display current node shape attributes
  • Display current node shape files (json)
  • Add shape attribute editing (drawing, dragging)
  • Add shape editor in NodeEditor
  • Add unit tests for shape attributes
  • Sample node DrawKeyablePoint2dList

@gregoire-dl gregoire-dl added this to the Meshroom 2026.1.0 milestone Sep 26, 2025
@gregoire-dl gregoire-dl self-assigned this Sep 26, 2025
@gregoire-dl gregoire-dl added the feature new feature (proposed as PR or issue planned by dev) label Sep 26, 2025
@codecov
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 95.41284% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.61%. Comparing base (3e1d496) to head (35035d0).
⚠️ Report is 54 commits behind head on develop.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
meshroom/core/attribute.py 86.66% 18 Missing ⚠️
meshroom/core/keyValues.py 50.00% 1 Missing ⚠️
meshroom/core/node.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2908      +/-   ##
===========================================
+ Coverage    79.61%   80.61%   +0.99%     
===========================================
  Files           53       55       +2     
  Lines         7256     7692     +436     
===========================================
+ Hits          5777     6201     +424     
- Misses        1479     1491      +12     

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

@natowi
Copy link
Member

natowi commented Sep 28, 2025

I think this would be most interesting for creating manual tie-points: #494

@fabiencastan
Copy link
Member

fabiencastan commented Sep 28, 2025

@natowi Yes, this is a fundamental PR toward this goal, but that will also enable other use cases (replacing custom UI, replacing export of full images to draw simple shapes, etc).

Also change set / remove observation icons.
@cbentejac cbentejac merged commit e88f34a into develop Oct 6, 2025
4 checks passed
@cbentejac cbentejac deleted the dev/shapes branch October 6, 2025 13:49
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.

5 participants