Mark Tucker
mtucker
About Me
EXPERTISE
Developer
Connect
LOCATION
Canada
WEBSITE
Houdini Skills
Availability
Not Specified
Recent Forum Posts
Correct way to get instancer using variants March 28, 2024, 2:47 p.m.
am_wilkins
@mtucker: The goal is just to ensure that the incoming "prototypes" randomize between the variants. While having an intuitive/neat workflow. Cause right now, spamming the same asset ref USD multiple times seems really strange workflow.
I'm not sure what might be going wrong in your setup, but it's certainly possible to make things work as expected (see attached file). The "trickiest" part was realizing that the instancer LOP have to turn off the option to only import the prototype prims... Because the per-variant prims are references to another prim in a different part of the scene graph, you can't _just_ copy the per-variant prims onto the instancer stage.
Correct way to get instancer using variants March 28, 2024, 11:35 a.m.
flipsideza
I might be doing this wrong, but something I have been playing with is using a `for each` loop.
The problem here is that you only have one "copy" or the asset in your scene. So in the for each loop, each iteration is setting the variant selection _on that same scene graph location_ to different values. So the last one wins. If you move the asset reference _inside_ the for each loop, and use the ITERATION context option to make a unique asset reference location for each iteration, then you will end up with multiple references to the asset, each with a different variant chosen.
If you take this approach, then you also don't want to feed the asset to the for each first input, because then you'll end up with one too many copies of your asset in the scene (the stage connected to the first input is "passed through"). So you'd want to also connect the asset reference to the _second_ input of the for each LOP, and iterate over variants on the second input. The stage connected to the second input is not made part of the output of the for each LOP.
I've attached a hip file that demonstrates this.
Correct way to get instancer using variants March 26, 2024, 10:49 a.m.
"it doesn't vary between the variants" - you're going to need to explain this to me