Skip to content

PrimUpdaterManager: Call UsdMayaPrimUpdater::editAsMaya on the pulled prim subtree - #4727

Open
jufrantz wants to merge 4 commits into
Autodesk:devfrom
jufrantz:isp/edit_as_maya_customize_subtree
Open

jufrantz wants to merge 4 commits into
Autodesk:devfrom
jufrantz:isp/edit_as_maya_customize_subtree

Conversation

@jufrantz

@jufrantz jufrantz commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This PR changes PrimUpdaterManager::editAsMaya so that it calls the UsdMayaPrimUpdater::editAsMaya per-prim customization hook on the whole pulled prim subtree. Before, only the topmost pulled DAG path was customized.

We hit this with an in-house updater, but it also affects workflow with a built-in one: editing as Maya an ancestor of a MayaReference prim did not call PxrUsdTranslators_MayaReferenceUpdater::editAsMaya(), so its attribute specific locking never ran and the stand-in transform stayed fully editable.

This aligns editAsMaya with what the other actions already do: mergeToUsd calls UsdMayaPrimUpdater::pushCopySpecs() on all the prims exported to USD, and discardEdits calls UsdMayaPrimUpdater::discardEdits() on the whole pulled DAG hierarchy.

Changes

  • c2d844d: call the hook on every pulled prim.
  • 53c6fd1: move the prim rendering exclusion out of pullImport() so that it runs after pullCustomize(). The subtree then stays composed while the hooks run, so a nested updater can reach its prim through getUsdPrim(). This mirrors mergeToUsd, which removes the exclusion before pushCopySpecs().
  • 612e1eb: guard against a null updater from the factory, as pushCustomize() and canEditAsMaya() already do.
  • 6864a97: unit test on a nested hierarchy.

Before this change, only the topmost DAG paths that
UsdMaya_ReadJob::Read returns were customized. For example, editing an
ancestor of a MayaReference prim did not call
PxrUsdTranslators_MayaReferenceUpdater::editAsMaya(), leaving every
attribute of that reference editable.

Now we traverse the pulled subtree on the stage, looking up each prim by
its path in the read job's GetNewNodeRegistry() to get its Maya node.
Each node found is then used to call UsdMayaPrimUpdater::editAsMaya().

As a result, pullCustomize() now covers the whole hierarchy, like
pushCustomize() and discardPrimEdits() already do.
…Customize

addExcludeFromRendering() deactivates the pulled prim. Calling it from
pullImport() meant pullCustomize() ran while that prim was inactive, so
its descendants did not resolve on the stage.
UsdMayaPrimUpdater::getUsdPrim() returned an invalid prim for them.

It is now called from editAsMaya(), after pullCustomize().
This matches mergeToUsd(), which calls removeExcludeFromRendering()
before pushCustomize().
@seando-adsk seando-adsk added the help wanted Extra attention is needed label Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants