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.
Reference USD attribute data
4986 6 1- Forests
- Member
- 24 posts
- Joined: June 2019
- Offline
- mtucker
- Staff
- 4419 posts
- Joined: July 2005
- Offline
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
- Member
- 24 posts
- Joined: June 2019
- Offline
- jsmack
- Member
- 7659 posts
- Joined: Sept. 2011
- Offline
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()
Edited by jsmack - Sept. 17, 2020 16:01:53
- mtucker
- Staff
- 4419 posts
- Joined: July 2005
- Offline
- Forests
- Member
- 24 posts
- Joined: June 2019
- Offline
- mtucker
- Staff
- 4419 posts
- Joined: July 2005
- Offline
-
- Quick Links