Python and USD Stage

   1343   2   1
User Avatar
Member
46 posts
Joined: Aug. 2015
Offline
Hello,

Anyone know how to change a Name and Path Attribute in Solaris in Houdini. I know that I can add point and prim attributes pretty easily with a wrangle in the sop context, but trying to figure out how to do this on the stage. Just not seeing a lot out there for intro with Python and Solaris to even get started. Any help is greatly appreciated.
User Avatar
Member
34 posts
Joined: Sept. 2014
Offline
Every node in solaris outputs a usd stage.


The folks over at Nvidia-Omniverse have this great resource, which has clear examples and well as easy explanations to follow here: https://github.com/NVIDIA-Omniverse/USD-Tutorials-And-Examples [github.com]

If you follow along with these, you can pretty much copy/paste the example code directly into a python script lop, just make sure to comment out the line that declares the stage variable, as you want to take the stage variable the python script lop has already provided to you.

You can also remove the Export at the end, as Solaris will keep the stage that you have created or modified in the python script lop and make it available to any of the downstream nodes.

This then makes it easier to use the usd api docs in practice in houdini.

Further learning if you want to see how some of houdini uses the python usd api directly, then taking a look at the usdaddassetstogallery hda in a topnet, shows some of the awesome utilities the devs have written to utilize the api and make our workflows more efficient.

My entry point for learning the python usd api was because i wanted to understand why our studio assets wouldn't work with the usdaddassetstogallery hda, i realized that we could tweak our asset publishing workflow and have them render the thumbnail and update the asset gallery directly.

Hope this helps.

Cheers
Kym
User Avatar
Member
46 posts
Joined: Aug. 2015
Offline
This is Amazing! Thank you. Ive been diving in and learning alot. I'm also trying to figure out how to access and remove primvars. Any special tips are greatly appreciated.

I've been looking at https://openusd.org/dev/api/class_usd_geom_primvars_a_p_i.html [openusd.org]

So far I'm only crashing Houdini 19. Again, any specifics on removing primvars are really appreciated.
Edited by tinyT - July 17, 2023 10:52:50
  • Quick Links