EMSUSD-1695 USDSkel: Curves are not deformed in Maya viewport - #4693
EMSUSD-1695 USDSkel: Curves are not deformed in Maya viewport#4693barbalt wants to merge 3 commits into
Conversation
| } | ||
| } | ||
|
|
||
| void MayaUsdRPrim::_UpdateComputedPrimvarSourcesGeneric( |
There was a problem hiding this comment.
This function is almost a 1 to 1, from what mesh.cpp had. It was moved here so that it can be used by the other shapes (points and curves).
|
|
||
| //! Shared tail of an rprim's Sync(): resolve the render tag, sync the shared data and | ||
| //! clear the dirty bits. | ||
| void _SyncEndCommon( |
There was a problem hiding this comment.
_SyncEndCommon, _RequirePrimvar, _ResolvePoints, _CommitPositionsBuffer
Are just helper functions that has code being repeated in the different shapes (mesh, points and curves). Moved them to a function to make it easier to reuse them.
| } | ||
| } | ||
|
|
||
| void MayaUsdRPrim::_SyncEndCommon( |
There was a problem hiding this comment.
The code in these functions here were also extracted from places that already existed. They were made into a function so that it can be reused into the other shapes.
There was a problem hiding this comment.
Pull request overview
This PR fixes VP2 render delegate handling of UsdSkel skinning for non-mesh gprims by ensuring point positions can be sourced from HdExtComputation outputs (skinned points) rather than only the authored/rest points primvar, and adds regression tests to validate deformation for BasisCurves and Points.
Changes:
- Add a new image-based regression test that authors a skinned USD scene for curves/points, verifies the prim deforms over time, and matches a baked reference at a target frame.
- Update VP2
PointsandBasisCurvesrprims to always requirepoints, resolve computed primvar sources, and commit positions from resolved (possibly computed) points. - Refactor shared rprim sync/primvar logic into
MayaUsdRPrimhelpers (_SyncEndCommon,_UpdateComputedPrimvarSourcesGeneric,_ResolvePoints,_CommitPositionsBuffer) and centralize_pointsFromSkeltracking in the common base.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/lib/mayaUsd/render/vp2RenderDelegate/testVP2RenderDelegateUsdSkel.py | Adds new regression tests that validate UsdSkel deformation for curves and points in VP2. |
| lib/mayaUsd/render/vp2RenderDelegate/points.cpp | Ensures points primvar is required/resolved (including computed) and uses shared sync/commit helpers. |
| lib/mayaUsd/render/vp2RenderDelegate/basisCurves.cpp | Same as points.cpp, but for BasisCurves, enabling UsdSkel-driven curve deformation. |
| lib/mayaUsd/render/vp2RenderDelegate/mesh.h | Removes per-mesh _pointsFromSkel state now handled in the common base. |
| lib/mayaUsd/render/vp2RenderDelegate/mesh.cpp | Uses _SyncEndCommon and common computed-primvar resolution; removes mesh-local computed-primvar logic. |
| lib/mayaUsd/render/vp2RenderDelegate/mayaPrimCommon.h | Adds common helper declarations for sync end, computed primvar resolution, resolving points, and buffer commits. |
| lib/mayaUsd/render/vp2RenderDelegate/mayaPrimCommon.cpp | Implements common helpers and moves computed-primvar resolution (HdExtComputation) to shared code. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #include <algorithm> | ||
| #include <limits> | ||
|
|
|
|
||
| //! Return the points to render. These normally come straight from the scene delegate, | ||
| //! but for a UsdSkel-skinned prim the delegate reports the undeformed rest points and | ||
| //! the deformed ones are the output of an HdExtComputation, which |
| primvarName, cpuComputation->GetOutputByIndex(outputIndex), HdInterpolationVertex); | ||
| } | ||
|
|
||
| // Records that points primvar is computed. |
There was a problem hiding this comment.
Should we not record it as computed if we got INVALID_OUTPUT_INDEX above?
There was a problem hiding this comment.
Good point. This was copied as it is from mesh.cpp, but I think it's worth fixing in this case.
| HdRprimSharedData& sharedData, | ||
| ReprVector const& reprs); | ||
|
|
||
| //! Append \p primvar to \p requiredPrimvars unless it is already there. |
There was a problem hiding this comment.
Not sure what the \p do here and in other comments
There was a problem hiding this comment.
Doxygen provides the command \p for indicating that the next word is a parameter to the function.
…https://github.com/Autodesk/maya-usd into barbalt/dev/EMSUSD-1695-Curves-not-deformed-viewport
This PR fixes an issue where UsdSkel skinning wasn't being applied to curves (and points) in the viewport.
Since the mesh shape was already working. This PR is mostly a refactor of the mesh.cpp to allow to be reused into the curves and points.
The outer lines around the cube weren't being deformed before this fix
