検索 - User list
Full Version: Reference USD attribute data
Root » Solaris and Karma » Reference USD attribute data
Forests
Hi,

I am, as a Python beginner, trying to use the USD API to reference a USD attribute in a parameter.
This is how far I've got:


Now it seemed I needed an SdfPath object, but I couldn't figure out how to get one. But after deciding I should try this function (GetAttributeAtPath) just with a string as input then, I saw that my ‘Stage’ object didn't even know that function.

Help would be greatly appreciated.
mtucker
I typed in exactly what you have there and I don't get the same error message as is displayed there. GetAttributeAtPath can be passed a regular string, and it is automatically converted to a pxr.Sdf.Path object. If you could post a simple hip file that would make it easier to help you, but also I'd suggest experimenting the in the Python Shell window yourself first. That window provides auto-completion while you type which is extremely helpful in making sure you use the right function names, valid objects, etc.
Forests
Thanks for the tip. I checked at the Python Shell and there appear a few functions there, which I think are from the USD API, but not GetAttribureAtPath:


Also here is a small hipfile:
jsmack
mtucker
I typed in exactly what you have there and I don't get the same error message as is displayed there. GetAttributeAtPath can be passed a regular string, and it is automatically converted to a pxr.Sdf.Path object. If you could post a simple hip file that would make it easier to help you, but also I'd suggest experimenting the in the Python Shell window yourself first. That window provides auto-completion while you type which is extremely helpful in making sure you use the right function names, valid objects, etc.

I think GetAttributeAtPath is only available in USD 20.08, and therefore not available in Houdini 18.0

instead of GetAttributeAtPath() you can use GetPrimAtPath().GetAttribute()
mtucker
Oh, thanks @jsmack… I didn't realize that was a new API.
Forests
Yep, It works..

How can we check what version of USD we are on?
It will be available in H18.5? did we get an accidental feature leak here of H18.5 right from the developers? :-)


Thanks for the help guys
mtucker
hou.lop.usdVersionInfo() will print the USD version information.
H18.5? What's H18.5?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB