Help using python with USD

   1686   0   1
User Avatar
Member
88 posts
Joined: Feb. 2021
Offline
Anyone know how to get prim.GetAttribute('*') working in lops ?

I always get the error that the attribute does not exist.
Both id and info:id yield me an error like this

Usd.Prim(</mat/mat_2/mat_2_preview>)
invalid attribute 'id' on 'Shader' prim </mat/mat_2/mat_2_preview> on stage with rootLayer @anon:0000000192A60900:LOP:rootlayer@, sessionLayer
.


I'm Also having difficulties Filtering on primitive type.

When I use the code from the example with
ls.setPathPattern('{ usd_istype(0, @primpath, "UsdLuxLight") }')

I get thrown the following error.


Python error: Traceback (most recent call last):
File "<stdin>", line 16, in <module>
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'


And I'm not sure I need to use the same technique for filtering on PrimitiveType since script 5 doesn`t work.
Edited by TangheStudent - Dec. 10, 2021 20:21:59

Attachments:
lops_python.hipnc (889.4 KB)

  • Quick Links