Skip to content

Add support for USD Points primitive (#3210)#3231

Open
kaili-yang wants to merge 16 commits into
f3d-app:masterfrom
kaili-yang:fix/usd-points-primitive-3210
Open

Add support for USD Points primitive (#3210)#3231
kaili-yang wants to merge 16 commits into
f3d-app:masterfrom
kaili-yang:fix/usd-points-primitive-3210

Conversation

@kaili-yang

@kaili-yang kaili-yang commented Jun 10, 2026

Copy link
Copy Markdown

Describe your changes

Add support for the USD Points primitive (UsdGeomPoints) in vtkF3DUSDImporter.
Import UsdGeomPoints → poly-vertex polydata
displayColor / displayOpacity → float direct scalars

Tests:
usd_points_rgb.usda(author-written,BSD-3-Clause default)
No OpenGL2, no mesh refactor, single fixture

Issue ticket number and link if any

Fixes #3210

Checklist for finalizing the PR

  • I have performed a self-review of my code
  • I have added tests for new features and bugfixes
  • I have added documentation for new features
  • If it is a modifying the libf3d API, I have updated bindings
  • If it is a modifying the .github/workflows/versions.json, I have updated docker_timestamp

AI Disclosure

  • I did not use AI to generate any of the content of that pull request
  • I used AI to generate code in that pull request, if yes please disclose which part of the code was generated and with which model.
    Cursor was used as a test assistant (Cursor / Composer) to help debug. I reviewed, validated, and adjusted the changes before submitting.

Continuous integration

Please write a comment to run CI, eg: \ci fast.
See here for more info.

Import UsdGeomPoints as point-cloud polydata with vertex colors and
skinning, and add module and application tests using skeleton_skin_basic.usda.
@kaili-yang kaili-yang requested a review from a team as a code owner June 10, 2026 23:15
@kaili-yang

Copy link
Copy Markdown
Author

\ci fast

@mwestphal mwestphal requested review from Meakk and removed request for a team June 11, 2026 05:33

@Meakk Meakk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good first version!

Comment thread application/testing/tests.usd.cmake Outdated
Comment thread testing/data/skeleton_skin_basic.usda Outdated
Comment thread plugins/usd/module/vtkF3DUSDImporter.cxx Outdated
@Meakk Meakk added ci:main and removed ci:fast labels Jun 11, 2026
Comment thread testing/data/DATA_LICENSES.md Outdated
Use GetDisplayColorPrimvar with float RGB vertex colors, enable direct
scalar coloring on the mapper, register godot-usd test data license, and
fix the module test include and float color checks for CI.
@kaili-yang kaili-yang force-pushed the fix/usd-points-primitive-3210 branch from 76d6269 to f006fbd Compare June 11, 2026 23:46
Add usd_points_rgb.usda with well-separated RGB points so the render
baseline is not occluded by mesh geometry from skeleton_skin_basic.usda.
Commit the CI-generated TestUSDPointsPrimitive baseline and verify
per-vertex displayColor values in the module test.
Use double tuples when reading vtkDataArray values for VTK compatibility.
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.07%. Comparing base (508d68b) to head (3a7fc3a).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3231   +/-   ##
=======================================
  Coverage   97.07%   97.07%           
=======================================
  Files         213      212    -1     
  Lines       17652    17619   -33     
=======================================
- Hits        17135    17103   -32     
+ Misses        517      516    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread testing/data/DATA_LICENSES.md Outdated
Match the assimp plugin so vtkOpenGLShaderProperty is registered when
TestF3DUSDImporterPoints updates skinned USD content in static builds.
Original F3D test data is covered by the default BSD-3-Clause notice.
@kaili-yang

Copy link
Copy Markdown
Author

@Meakk Could you help re-run the failed CI job for me? It seems I don't have the permission to do that.

Comment thread plugins/usd/module/vtkF3DUSDImporter.cxx Outdated
@Meakk

Meakk commented Jun 15, 2026

Copy link
Copy Markdown
Member

@Meakk Could you help re-run the failed CI job for me? It seems I don't have the permission to do that.

See https://f3d.app/dev/CONTRIBUTING#continuous-integration

@Meakk

Meakk commented Jun 15, 2026

Copy link
Copy Markdown
Member

\ci full

@Meakk Meakk added ci:full and removed ci:main labels Jun 15, 2026
Display colors use vtkFloatArray now; the header is no longer referenced.
Comment thread plugins/usd/module/vtkF3DUSDImporter.cxx Outdated
@Meakk

Meakk commented Jun 15, 2026

Copy link
Copy Markdown
Member

@mwestphal do you want to take a look too?

@kaili-yang

Copy link
Copy Markdown
Author

\ci full

Comment thread plugins/usd/module/vtk.module Outdated
Comment thread plugins/usd/module/vtkF3DUSDImporter.cxx
Comment thread testing/data/usd_points_rgb.usda
Comment thread testing/data/skeleton_skin_basic.usda Outdated

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

questions

Comment thread plugins/usd/module/vtkF3DUSDImporter.cxx Outdated
Read displayOpacity alongside displayColor and store RGBA float scalars
when opacity is authored, enabling translucent point rendering.
Comment thread plugins/usd/module/vtkF3DUSDImporter.cxx Outdated
Use a single usd_points_rgb fixture with displayOpacity, keep DirectScalars
Points-only, restore inline mesh skinning, and drop the OpenGL module link.
Remove skeleton_skin_basic and the render baseline pending CI regeneration.
@Meakk

Meakk commented Jun 18, 2026

Copy link
Copy Markdown
Member

Now points without opacity is not covered.
Maybe you can split the three points in two different prims in the usda file, one with opacity containing two points, and one without opacity containing the remaining point?

Split usd_points_rgb.usda into two Points prims so opacity-only and
color-only import paths are both exercised in TestF3DUSDImporterPoints.
@kaili-yang

Copy link
Copy Markdown
Author

@Meakk Good idea, split into RGBAWithOpacity (2 points) and RGBOnly (1 point) in usd_points_rgb.usda. Module test now covers both RGB and RGBA paths. Will update the render baseline from CI.

Refresh the render baseline after usd_points_rgb.usda was split into
RGBAWithOpacity and RGBOnly so TestUSDPointsPrimitive matches CI output.

@Meakk Meakk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!
@mwestphal do you want to take a look?

@mwestphal mwestphal self-requested a review June 19, 2026 20:02
Comment thread plugins/usd/module/Testing/TestF3DUSDImporterPoints.cxx Outdated
Comment thread plugins/usd/module/Testing/TestF3DUSDImporterPoints.cxx Outdated
Comment thread plugins/usd/module/Testing/TestF3DUSDImporterPoints.cxx Outdated
Comment thread plugins/usd/module/Testing/TestF3DUSDImporterPoints.cxx Outdated
Comment thread plugins/usd/module/vtkF3DUSDImporter.cxx
Comment thread plugins/usd/module/vtkF3DUSDImporter.cxx Outdated
Comment thread plugins/usd/module/vtkF3DUSDImporter.cxx Outdated
Comment thread plugins/usd/module/vtkF3DUSDImporter.cxx
@kaili-yang kaili-yang force-pushed the fix/usd-points-primitive-3210 branch from 41f6fc9 to b82decb Compare June 23, 2026 05:49
@Meakk Meakk requested a review from mwestphal June 23, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

USD points primitive is not supported

3 participants