Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant running schema Python Example;UsdSchemaExamples ;UsdSchemaExamples.ParamsAPI.Apply; #3380

Open
fzss2012 opened this issue Oct 28, 2024 · 4 comments
Labels
build Build-related issue/PR

Comments

@fzss2012
Copy link

Description of Issue

cant running schema Python Example.

Steps to Reproduce

from pxr import Usd, UsdSchemaExamples
stage = Usd.Stage.Open("test.usda")
cp = stage.GetPrimAtPath("/Complex")
simple = UsdSchemaExamples.Simple(cp)
target = simple.GetTargetRel()
intAttr = simple.GetIntAttrAttr()
complex = UsdSchemaExamples.Complex(cp)
print('complexString: %s' % complex.GetComplexStringAttr().Get())
obj = stage.GetPrimAtPath("/Object")

paramsAPI = UsdSchemaExamples.ParamsAPI.Apply(obj) #pxr.Tf.ErrorException

assert obj.HasAPI(UsdSchemaExamples.ParamsAPI)
print('mass: %s' % paramsAPI.GetMassAttr().Get())
print('velocity: %s' % paramsAPI.GetVelocityAttr().Get())
print('volume: %s' % paramsAPI.GetVolumeAttr().Get())


(usdenv) root@hcss-ecs-e6b2:/home/test# /home/usdenv/bin/python /home/test/payload.py
complexString: a really complex string
Traceback (most recent call last):
File "/home/test/payload.py", line 10, in
paramsAPI = UsdSchemaExamples.ParamsAPI.Apply(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pxr.Tf.ErrorException:
Error in 'pxrInternal_v0_24_11__pxrReserved__::UsdPrim::ApplyAPI' at line 1127 in file /home/OpenUSD/pxr/usd/usd/prim.h : 'Class 'UsdSchemaExamplesParamsAPI' is not correctly registered with the UsdSchemaRegistry as a schema type. The schema may need to be regenerated.'

System Information (OS, Hardware)

Ubuntu 22.04 server 64bit

Package Versions

USD 24.11
Python 3.12.7

Build Flags

@asluk asluk added the build Build-related issue/PR label Oct 28, 2024
@asluk
Copy link
Collaborator

asluk commented Oct 28, 2024

I believe the install location of the examples in https://github.com/PixarAnimationStudios/OpenUSD/tree/release/extras/usd/examples is not bootstrapped by default -- you may need to add find usdSchemaExamples.so in your install hierarchy and add its location to PATH and/or PXR_PLUGINPATH_NAME -- see also https://openusd.org/release/tut_generating_new_schema.html#using-the-schema-classes

@fzss2012
Copy link
Author

@asluk
Thanks, I'll try again.

@fzss2012
Copy link
Author

@asluk
I noticed that the capitalization of the library name in the compilation and the class name in the Python binding don't seem to match, and it’s affecting the compilation process.

@jesschimein
Copy link
Contributor

Filed as internal issue #USD-10359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build-related issue/PR
Projects
None yet
Development

No branches or pull requests

3 participants