Skip to content

Add expanded assembly subcomponent support for pxrUsdReferenceAssembly#4644

Open
dj-mcg wants to merge 2 commits into
Autodesk:devfrom
dj-mcg:pr/expanded-assembly-subcomponents
Open

Add expanded assembly subcomponent support for pxrUsdReferenceAssembly#4644
dj-mcg wants to merge 2 commits into
Autodesk:devfrom
dj-mcg:pr/expanded-assembly-subcomponents

Conversation

@dj-mcg

@dj-mcg dj-mcg commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Fix double-transform rendering and add variant selection editing for subcomponent proxy shapes created when a pxrUsdReferenceAssembly is expanded.

Double-transform fix:

  • Add virtual isRootPrimTransformInDagPath() to MayaUsdProxyShapeBase so subclasses can signal that the Maya DAG already contains the root prim's world transform.
  • pxrUsdProxyShape implements this via a new hidden boolean attribute "skipRootPrimTransform", set by the assembly translator on expand.
  • proxyDrawOverride, usdProxyShapeAdapter, and proxyRenderDelegate check the flag before applying the root prim transform.
  • pxrUsdProxyShape::boundingBox() uses ComputeUntransformedBound when the flag is set, fixing picking and framing.

Variant selection support:

  • Extend UsdMayaEditUtil to parse variant selection edits (usdVariantSet_* attributes) alongside transform edits.
  • Add setDependentsDirty/compute overrides to pxrUsdProxyShape that apply variant selections from dynamic attributes onto the stage session layer.
  • Replace AEpxrUsdProxyShapeTemplate.mel with a Python version that builds variant set UI dynamically from the USD prim.
  • Register the AE template Python module in init.py.

Tests:

  • Add testUsdReferenceAssemblyExpandedTransforms verifying correct transforms and bounding boxes for expanded sub-proxies.

Fix double-transform rendering and add variant selection editing for
subcomponent proxy shapes created when a pxrUsdReferenceAssembly is
expanded.

Double-transform fix:
- Add virtual isRootPrimTransformInDagPath() to MayaUsdProxyShapeBase
  so subclasses can signal that the Maya DAG already contains the root
  prim's world transform.
- pxrUsdProxyShape implements this via a new hidden boolean attribute
  "skipRootPrimTransform", set by the assembly translator on expand.
- proxyDrawOverride, usdProxyShapeAdapter, and proxyRenderDelegate
  check the flag before applying the root prim transform.
- pxrUsdProxyShape::boundingBox() uses ComputeUntransformedBound when
  the flag is set, fixing picking and framing.

Variant selection support:
- Extend UsdMayaEditUtil to parse variant selection edits
  (usdVariantSet_* attributes) alongside transform edits.
- Add setDependentsDirty/compute overrides to pxrUsdProxyShape that
  apply variant selections from dynamic attributes onto the stage
  session layer.
- Replace AEpxrUsdProxyShapeTemplate.mel with a Python version that
  builds variant set UI dynamically from the USD prim.
- Register the AE template Python module in __init__.py.

Tests:
- Add testUsdReferenceAssemblyExpandedTransforms verifying correct
  transforms and bounding boxes for expanded sub-proxies.
Comment thread plugin/pxr/maya/lib/usdMaya/CMakeLists.txt Outdated
Comment thread plugin/pxr/maya/lib/usdMaya/CMakeLists.txt
Comment thread lib/mayaUsd/nodes/proxyShapeBase.h

@AramAzhari-adsk AramAzhari-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.

Just some minor adjustments

- CMakeLists.txt: Replace AEpxrUsdProxyShapeTemplate.mel with .py in
  PYMODULE_FILES (matching the MEL-to-Python conversion in the SConscript)
- proxyShapeBase.h: Expand isRootPrimTransformInDagPath() comment to
  clarify why it defaults to false and when subclasses should override
@seando-adsk seando-adsk added pxr Related to Pixar plugin workflows Related to in-context workflows labels Jun 23, 2026
@AramAzhari-adsk

Copy link
Copy Markdown
Collaborator

@dj-mcg one of the unit tests seem to fail on OSX platforms. Does that also occur for you?

======================================================================
13:17:23      FAIL: testClipboardCutPaste (testClipboard.ClipboardHandlerTestCase.testClipboardCutPaste)
13:17:23      Basic test for the Clipboard cut/paste support.
13:17:23      ----------------------------------------------------------------------
13:17:23      Traceback (most recent call last):
13:17:23        File ".../ecg-maya-usd/maya-usd/test/lib/ufe/testClipboard.py", line 190, in testClipboardCutPaste
13:17:23          self.assertTrue(ch.hasItemsToPaste_())
13:17:23          ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
13:17:23      AssertionError: False is not true
13:17:23
13:17:23      ----------------------------------------------------------------------
13:17:23      Ran 9 tests in 0.701s
13:17:23
13:17:23      FAILED (failures=1)

@AramAzhari-adsk AramAzhari-adsk assigned dj-mcg and unassigned dj-mcg Jun 24, 2026
@seando-adsk

Copy link
Copy Markdown
Collaborator

@AramAzhari-adsk / @dj-mcg I think that was just a random glitch test failure. I re-ran the OSX 2027 build and it passed the 2nd time. Aram I can also see that you re-ran the entire preflight and OSX 2027 also passed there, but then there was a Linux build with bunch of interactive tests failures - I think that was just a network glitch. I'm marking this as ready for merge.

Sean

@seando-adsk seando-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jun 24, 2026
@AramAzhari-adsk

Copy link
Copy Markdown
Collaborator

@AramAzhari-adsk / @dj-mcg I think that was just a random glitch test failure. I re-ran the OSX 2027 build and it passed the 2nd time. Aram I can also see that you re-ran the entire preflight and OSX 2027 also passed there, but then there was a Linux build with bunch of interactive tests failures - I think that was just a network glitch. I'm marking this as ready for merge.

Sean

if the test failures changed to something else then I think we're good to check in.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pxr Related to Pixar plugin ready-for-merge Development process is finished, PR is ready for merge workflows Related to in-context workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants