[FYI]: Instance Objects randomized

   122   0   1
User Avatar
Member
72 posts
Joined: Oct. 2018
Offline
Hi !
Just a small contribution...

I just saw in a few tutorials on instancing, that the authors copied their objects to be instanced, and then dived inside, just to make small adjustments, to get different Objects.

My $0.02 on this:
Create an Attribute Wrangle on Details with this VEX code
string meParent=opfullpath(".."); // This gets the name of the "parent" object
int meSeed=opdigits(meParent); // Here we get the numbers after the object's name

// Now we save our values in the detail attributes for later use
s@meParent=meParent;
i@meObjId=meSeed;

and then anywhere you need "randomized" Values to modify you object use this expression in the input field
fit(rand(detail("../SeedSrc/","Seed",0)),0,1,0,6)
in this example it is wanted to have a random value between 0 and 6...

Now you just rename the geo1to geo_1234and you have set the seed for this object to 1234. Now you can copy this object, and Houdini automagically increases this number. If you do not dislike the result with this new seed, just change the numbers part and you are done !

Just my $0.02 as said before...
Hope this helps somehow save a few clicks...
Edited by GOgraphR - Nov. 7, 2024 14:41:32
  • Quick Links