How to modify USD hierarchy procedurally

   2030   3   0
User Avatar
Member
21 posts
Joined: 5月 2015
Offline
Hi all,

Is there a way that I can select a few prims by comparing its attribtues, say "translate", and put the ones higher than X under a new transform. Not sure how to do this procedurally and whether it's achievable with VEX.

Thanks!
Shawn
User Avatar
スタッフ
4444 posts
Joined: 7月 2005
Offline
USD does not support "moving" prims in the composed scene graph hierarchy. You _can_ move prims on a specific layer using lower-level SDF APIs, which are only accessible through the Python LOP. And in fact this is what the "Restructure Scene Graph" LOP does. Dive in and look at the edit_operations LOP inside there to see how it works (or just use this LOP as-is).
User Avatar
Member
21 posts
Joined: 5月 2015
Offline
Ok I see. Thanks. What about comparing attributes and "group"(some kind of identifier) them? Is that possible?
Edited by NMVHS - 2022年9月6日 10:32:02
User Avatar
スタッフ
4444 posts
Joined: 7月 2005
Offline
Comparing attribute values is not something natively supported by Houdini's primitive patterns. But you can write a VEX node that does whatever complex calculations/comparisons you want, and have it author a collection into the USD stage. Then you can use a primitive pattern to access the contents of that collection.
  • Quick Links