Search - User list
Full Version: can unity_instance attribute automatically create "instace inputs" with a size larger than 1?
Root » Houdini Engine for Unity » can unity_instance attribute automatically create "instace inputs" with a size larger than 1?
Erik_Ostsjo
Hi!
Got a quick question regarding the “unity_instance” attribute that can be used with houdini engine to automatically instance a prefab with an HDA.

I've used the attribute before to generate a single instance input that is populated. What I'm looking for however, is a way to automate the process of expanding the size and filling out more elements so that the HDA can randomize.
The picture shows what I'm currently doing to the left and what I wish I could do on the right. Is there a way to accomplish something like it?
MartinBaadsgaard
I am also currently looking into these things,
but more from the angle of how to not define a mesh to begin with but just let the artist add it in the list like when using a mesh input.

It is a bit problematic if the only way to use a full prefab with HEU is to know where it is beforehand.

Of course, alternatively, you can just randomize between a number of strings, but if they are invalid paths they are discarded, so you can have a folder that has like “placeholdercube_1”, “placeholdercube_2”, “placeholdercube_3” etc.
Which, agreed, is really really ugly.
It does give more control to determine the randomization within the HDA logic though.. In any case, there is a small example attached.
seelan
Erik_Ostsjo
Hi!
Got a quick question regarding the “unity_instance” attribute that can be used with houdini engine to automatically instance a prefab with an HDA.

I've used the attribute before to generate a single instance input that is populated. What I'm looking for however, is a way to automate the process of expanding the size and filling out more elements so that the HDA can randomize.
The picture shows what I'm currently doing to the left and what I wish I could do on the right. Is there a way to accomplish something like it?

This could be an RFE. The unity_instance attribute parsing happens on the Unity plugin side, so it can certainly parse the string and apply multiple inputs, perhaps separated by the space as is in your example. I will add an RFE for this.
seelan
MartinBaadsgaard
I am also currently looking into these things,
but more from the angle of how to not define a mesh to begin with but just let the artist add it in the list like when using a mesh input.

It is a bit problematic if the only way to use a full prefab with HEU is to know where it is beforehand.

Of course, alternatively, you can just randomize between a number of strings, but if they are invalid paths they are discarded, so you can have a folder that has like “placeholdercube_1”, “placeholdercube_2”, “placeholdercube_3” etc.
Which, agreed, is really really ugly.
It does give more control to determine the randomization within the HDA logic though.. In any case, there is a small example attached.

You can make the mesh path a string parameter (single or multiparm), and then in your HDA control how to apply the attribute as the mesh path.
MartinBaadsgaard
seelan
MartinBaadsgaard
I am also currently looking into these things,
but more from the angle of how to not define a mesh to begin with but just let the artist add it in the list like when using a mesh input.

It is a bit problematic if the only way to use a full prefab with HEU is to know where it is beforehand.

Of course, alternatively, you can just randomize between a number of strings, but if they are invalid paths they are discarded, so you can have a folder that has like “placeholdercube_1”, “placeholdercube_2”, “placeholdercube_3” etc.
Which, agreed, is really really ugly.
It does give more control to determine the randomization within the HDA logic though.. In any case, there is a small example attached.

You can make the mesh path a string parameter (single or multiparm), and then in your HDA control how to apply the attribute as the mesh path.

Sorry for thread hijacking, maybe I should make a new one…

Yea I can expose even a dropdown that I populate with python for all the preafabs or something like this, but it is a lot of work to make it dynamic enough or whoever will use my tool will have to write a path instead of just drag/drop a prefab in.
It all comes down to how my tools can be the easiest to work with for the artists, who are not as used to paths and variables and such
Erik_Ostsjo
seelan
This could be an RFE. The unity_instance attribute parsing happens on the Unity plugin side, so it can certainly parse the string and apply multiple inputs, perhaps separated by the space as is in your example. I will add an RFE for this.

Awesome, thanks for the reply!

MartinBaadsgaard
Sorry for thread hijacking, maybe I should make a new one…

Yea I can expose even a dropdown that I populate with python for all the preafabs or something like this, but it is a lot of work to make it dynamic enough or whoever will use my tool will have to write a path instead of just drag/drop a prefab in.
It all comes down to how my tools can be the easiest to work with for the artists, who are not as used to paths and variables and such

No worries, If you want to start without instance inputs you can create them automatically from an object that whoever uses your tool drops into an object input. If that is what you are looking for?
MartinBaadsgaard
This is where my tool is at currently, but rebuilding it to use the unity_instance instancer in an obj node because I want any model with any collider setup to work with the tool.
Solution for me for now is just pointing to Asset/Cube.prefab where I got a basic cube. It's a bit crude
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB