I'm manually placing copies of objects (ie at the /obj level) but need each to have some random stuff internally - spin axis etc. So each object needs a different seed value to work with internally (@ptnum has no relevance here
Houdini must use some kinda UUID-ish thing internally to refer to objects, so you can rename stuff and all the references across the scene are updated (right? Or does Houdini just do a global “search and replace” whenever you rename something?)
But I can't find any kinda unique number in objects' detail attributes.
Or do I just have to hash the objects' nodepaths and make my own? (I'd rather not if I don't have to: it'd be nice to be able to rename a node without it altering its unique seed)
How to get a unique ID / UUIDish thing for each object (for use as a random seed)?
7424 6 0- howiem
- Member
- 146 posts
- Joined: 9月 2011
- Offline
- Werner Ziemerink
- Member
- 1268 posts
- Joined: 3月 2014
- Offline
- howiem
- Member
- 146 posts
- Joined: 9月 2011
- Offline
- Blue Prayer
- Member
- 15 posts
- Joined: 2月 2019
- Offline
- mrCatfish
- Member
- 734 posts
- Joined: 12月 2006
- Offline
There's a lot of ways to do this, but let's say you have /obj/foo1 and /obj/foo2, etc. Inside each, you might have an attribute create node with this in it:
opdigits extracts the digits only from any node, thus geo1 and geo2 will have different id attributes
attribute: id value: rand(opdigits(".."))
opdigits extracts the digits only from any node, thus geo1 and geo2 will have different id attributes
Edited by mrCatfish - 2019年4月2日 10:56:34
Sean Lewkiw
CG Supervisor
Machine FX - Cinesite MTL
CG Supervisor
Machine FX - Cinesite MTL
- jsmack
- Member
- 8052 posts
- Joined: 9月 2011
- Online
howiem
Houdini must use some kinda UUID-ish thing internally to refer to objects, so you can rename stuff and all the references across the scene are updated (right? Or does Houdini just do a global “search and replace” whenever you rename something?)
Nodes have an op id, but it is only unique within a given session. Reloading your scene in a new session will assign new ids. The node name is the unique identifier stored with the scene file.
One solution to your workflow that would allow renaming the nodes as you please, would be to create a shelf tool script that creates a geo node with your setup inside, and adds a spare parameter to the geo node. The script would then set the value to a random number such as with the python random module. You can drag a selection to your toolbar to create an initial tool starting point, and modify the script to add the spare parm/random number.
Edited by jsmack - 2019年4月2日 13:44:46
- howiem
- Member
- 146 posts
- Joined: 9月 2011
- Offline
-
- Quick Links