Last active
February 14, 2025 10:12
-
-
Save BigRoy/c37009a5399ea1172d8be5b284999578 to your computer and use it in GitHub Desktop.
Maya USD define Usd Primitives on the stage using Python for MayaUsdProxyShape
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tested December 21st, 2020 | |
# This is just a test example of how one could use the USD Api against a mayaUsdProxyShape and its USD stage. | |
# Note: The outliner doesn't really like it when you change the stage | |
# so you might need to toggle shape display off and on to get it to update. | |
import mayaUsd | |
from maya import cmds | |
from pxr import Usd, UsdGeom | |
shape = cmds.ls(type="mayaUsdProxyShape", long=True)[0] # make sure to use long full paths | |
stage = mayaUsd.ufe.getStage('|world' + shape) | |
obj = UsdGeom.Xform.Define(stage, '/test_group') | |
The type name start with lower case letter, to be
mayaUsdProxyShape
Updated. Not sure why it worked for me at the time.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The type name start with lower case letter, to be
mayaUsdProxyShape