Skip to content

Conversation

@BigRoy
Copy link
Contributor

@BigRoy BigRoy commented Jul 30, 2024

Changelog Description

  • Prototype loading of USD references into a Maya USD proxy while keeping it managed by the pipeline
  • Prototype loading of Maya references into a Maya USD proxy while keeping it managed by the pipeline

Additional info

Separated from #2

Testing notes:

  1. Loading of the USD data should work as intended into Maya USD Proxy Shapes.
  2. Managing (updating) and removal via scene inventory should also do what is expected.

@BigRoy BigRoy added the type: enhancement Improvement of existing functionality or minor addition label Jul 30, 2024
shape = mayaUsd_createStageWithNewLayer.createStageWithNewLayer()
stage = mayaUsd.ufe.getStage('|world' + shape)
prim_path = "/root"
UsdGeom.Xform.Define(stage, prim_path)
Copy link
Member

@moonyuet moonyuet Jan 2, 2025

Choose a reason for hiding this comment

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

i got some error on this line when loading the USD. It appears that it cannot find the stage layer from the loaded usd(which is weird as it should be using the staging layer which is newly created)
image

During load error happened on Product: "usdAsset" Representation: "usd" Version: 7

Error message: 
	Error in 'pxrInternal_v0_23__pxrReserved__::UsdGeomXform::Define' at line 70 in file S:\jenkins\workspace\ECP\ecg-usd-build\ecg-usd-full-python3.11-windows\ecg-usd-build\usd\pxr\usd\usdGeom\xform.cpp : 'Invalid stage'

Traceback (most recent call last):
  File "D:\ayon-core\client\ayon_core\tools\loader\models\actions.py", line 740, in _load_representations_by_loader
    load_with_repre_context(
  File "D:\ayon-core\client\ayon_core\pipeline\load\utils.py", line 325, in load_with_repre_context
    return loader.load(repre_context, name, namespace, options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ayon-addon_template\ayon-maya\client\ayon_maya\plugins\load\load_maya_usd_add_reference.py", line 52, in load
    UsdGeom.Xform.Define(stage, prim_path)
pxr.Tf.ErrorException: 
	Error in 'pxrInternal_v0_23__pxrReserved__::UsdGeomXform::Define' at line 70 in file S:\jenkins\workspace\ECP\ecg-usd-build\ecg-usd-full-python3.11-windows\ecg-usd-build\usd\pxr\usd\usdGeom\xform.cpp : 'Invalid stage'

def load(self, context, name=None, namespace=None, options=None):

selection = list(iter_ufe_usd_selection())
assert len(selection) == 1, "Select only one PRIM please"
Copy link
Member

Choose a reason for hiding this comment

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

Does it mean it is only allowed one geometry in the loaded asset(or can we load with multiple assets)? Maybe we can exclude some families to load this as we can load stuff via this loader if it is also layout product(which is mostly with multiple assets).
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The error means that you need to SELECT a PRIM inside the Maya USD Proxy to 'reference into'. Unfortunately since it 'references into a prim' there isn't really something more intuitive I could think of whilst still allowing to load anywhere inside the USD hierarchy.

@antirotor antirotor added the sponsored This is directly sponsored by a client or community member label Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sponsored This is directly sponsored by a client or community member type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants