Noob question: Nodes for editing the scenegraph via code?

   2291   4   0
User Avatar
Member
240 posts
Joined: 10月 2014
Offline
What are my node-based options for manipulating the scenegraph via code? Is there a LOPs equivalent to Katana's OpScript node for example, that would allow me to generate/delete/edit primitives in the scene graph?


Would the Python be ok for this?
Edited by Tim Crowson - 2020年5月15日 14:01:13
- Tim Crowson
Technical/CG Supervisor
User Avatar
Member
240 posts
Joined: 10月 2014
Offline
Yeah I think I answered my own question. Sorry for the noise.

(specifically I am wanting to generate new arbitrary properties on some prims and am not finding examples of how to do that via Python)
Edited by Tim Crowson - 2020年5月15日 14:16:13
- Tim Crowson
Technical/CG Supervisor
User Avatar
Member
7850 posts
Joined: 9月 2011
Offline
Generally in USD, primitives cannot be renamed or deleted. The stage manger can do this in a way, but it basically creates a new usd and copy's the prims from one stage to another but also flattens the stage.

There are a few options for editing/creating using code.

The python lop uses the usd api directly.

Attribute VOP/Wrangle uses vex. These can be used mostly for editing attributes/primvars or metadata.

The inline lop applies usd layer be entered as text.

There's probably other nodes I'm not thinking of.
User Avatar
Member
240 posts
Joined: 10月 2014
Offline
Thanks. I'm mainly interested in creating new prims, creating arbitrary attributes on said prims, and editing those attributes later. Deactivation and renaming aren't really on the radar.
- Tim Crowson
Technical/CG Supervisor
User Avatar
スタッフ
4458 posts
Joined: 7月 2005
Offline
Creating new prims (and probably for creating new attributes on prims) I'd recommend the Python LOP. Having access to the whole USD python API lets you control exactly what gets authored and how. Plus you can use the pxr.Sdf APIs on the editableLayer, which particularly in the case of creating a lot of new USD prims can be _enormously_ faster than using the pxr.Usd APIs.
  • Quick Links