reference paths from list of primitive paths

   568   4   1
User Avatar
Member
25 posts
Joined: April 2015
Offline
Hi, I'm using primitive node to define scene structure. if I use relative reference it references all paths how to reference single one?

Attachments:
prim.png (41.2 KB)

User Avatar
Staff
4517 posts
Joined: July 2005
Offline
What you've got there should produce a scene with three prims, "/root", which will have children "geo" and "mat". There are no relative paths there, and no "references", at least in the USD sense of the word. So I really don't understand what you're asking...
User Avatar
Member
25 posts
Joined: April 2015
Offline
Lets say I'm defining scene structure like in this example and I want to use this defined structure as path references in different nodes, same way as in sop you can create channel reference. That would make sure i can change name in scene structure and auto update it elsewhere since as I understand there are no dynamic links in usd. I'm starting with usd and solaris so I'm not sure if this kind of channel referencing is necessary, but I feel like this would reduce possible errors in paths.
User Avatar
Staff
4517 posts
Joined: July 2005
Offline
Yes, we use `chs` expressions in prim path parameters all the time when building HDAs, and setting up demo files. It's extremely handy. The `loplastmodifiedprim` and `loplastmodifiedprims` expressions can also be very useful as a way of affecting all prims affected by some other node (without having to now the exact parameter name(s) on the source node). The `lopinputprim` and `lopinputprims` expressions you see popping up as the default values for a lot of LOP nodes are just specialized versions of `loplastmodifiedprim(s)` that look at a node connected to the input of the current node.
User Avatar
Member
8770 posts
Joined: July 2007
Offline
for your case you can use strsplit() HScript function to get a single line of the primpath parm

I assumed using "\n" as a separator per new line would work, but in my test I had to use the actual newline
`strsplit(chs("../primitive1/primpath"), "
", 0)`
`strsplit(chs("../primitive1/primpath"), "
", 1)`
`strsplit(chs("../primitive1/primpath"), "
", 2)`
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links