Skip to content

EMSUSD-1695 USDSkel: Curves are not deformed in Maya viewport - #4693

Merged
seando-adsk merged 3 commits into
devfrom
barbalt/dev/EMSUSD-1695-Curves-not-deformed-viewport
Aug 11, 2026
Merged

EMSUSD-1695 USDSkel: Curves are not deformed in Maya viewport#4693
seando-adsk merged 3 commits into
devfrom
barbalt/dev/EMSUSD-1695-Curves-not-deformed-viewport

Conversation

@barbalt

@barbalt barbalt commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

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
image

@barbalt barbalt self-assigned this Aug 7, 2026
}
}

void MayaUsdRPrim::_UpdateComputedPrimvarSourcesGeneric(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

_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(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 Points and BasisCurves rprims to always require points, resolve computed primvar sources, and commit positions from resolved (possibly computed) points.
  • Refactor shared rprim sync/primvar logic into MayaUsdRPrim helpers (_SyncEndCommon, _UpdateComputedPrimvarSourcesGeneric, _ResolvePoints, _CommitPositionsBuffer) and centralize _pointsFromSkel tracking 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.

Comment on lines +33 to 35
#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

@pierrebai-adsk pierrebai-adsk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One question

primvarName, cpuComputation->GetOutputByIndex(outputIndex), HdInterpolationVertex);
}

// Records that points primvar is computed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we not record it as computed if we got INVALID_OUTPUT_INDEX above?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure what the \p do here and in other comments

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Doxygen provides the command \p for indicating that the next word is a parameter to the function.

@barbalt barbalt assigned barbalt and unassigned barbalt Aug 7, 2026
@barbalt
barbalt requested a review from pierrebai-adsk August 10, 2026 14:42
@barbalt barbalt assigned barbalt and unassigned barbalt Aug 10, 2026
@barbalt barbalt added the ready-for-merge Development process is finished, PR is ready for merge label Aug 10, 2026
@seando-adsk seando-adsk added the vp2renderdelegate Related to VP2RenderDelegate label Aug 11, 2026
@seando-adsk
seando-adsk merged commit f3da838 into dev Aug 11, 2026
14 checks passed
@seando-adsk
seando-adsk deleted the barbalt/dev/EMSUSD-1695-Curves-not-deformed-viewport branch August 11, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge Development process is finished, PR is ready for merge vp2renderdelegate Related to VP2RenderDelegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants