Apply Schema to one Primitive with Python

   1146   1   1
User Avatar
Member
123 posts
Joined: Nov. 2016
Offline
Hello!

I want to ask if someone knows which is the process to add a Schema to one primitive using Python and the PXR module? I'm trying to do a "translator" of USD lights from C4D to Houdini and I want to try to assign the "ShapingAPI" schema to the Spot Light to have the correct viewport guide representation:



I saw that this is how it looks on the usd file:
prepend apiSchemas = ["ShapingAPI"]

Also it would be interesting to apply the "CollectionAPI:lightLink" schema to translate the light linking data too, but let's see if the ShapingAPI can be done first :P

Thanks a lot!
Edited by cdordelly - June 21, 2023 00:06:56
User Avatar
Member
123 posts
Joined: Nov. 2016
Offline
Looks like that I found the solution with this

shaping_api = UsdLux.ShapingAPI.Apply(prim)
  • Quick Links