Jump to content
theprogg

Separating Multiple Geometry Inputs from a String Attribute

Recommended Posts

Im currently using multiple geometry inputs from Unreal into an HDA via the + symbol on the HDA rollout. It works fine for passing the separate assets into the HDA, but I'm trying to separate the geometry so I can randomize which object I use at different parts of the HDA. 

The documentation states:
“When there is more than one geometry set as input, the geometries can be differentiated in the Digital Asset with the Unreal to Houdini attribute unreal_input_mesh_name which is created on the input geometry primitives.”

This is great, except that I'm trying to make the HDA procedural in that I dont want to have to manually separate the inputs inside of houdini based on an exact mesh string attribute value because the tool could have infinite amounts of inputs. Ideally the marshalling from Unreal to Houdini would include an index of the asset as a primitive attribute as well but currently it doesnt. I was trying to figure out a way to compare strings in such a way that I dont have to specify exact values as that defeats the purpose of being able to change the inputs in Unreal on the fly, but I cant really come up with clean way to convert the unique string attributes into a usable format. Connectivity SOP would work except that some of the input assets are made of multiple subobjects so that doesnt work in this case. The only attribute differentiating the input assets from Unreal is that prim string attribute 'unreal_input_mesh_name' which is an exact reference of the mesh in the content browser in Unreal.

 

Any ideas on how to split primitives into a group or assign an attribute based solely on a unique string value?

Edited by theprogg

Share this post


Link to post
Share on other sites

This turned out to be stupidly easy. Just needed a foreach named loop with piece attribute set to unreal_input_mesh_name

Share this post


Link to post
Share on other sites
On 3/22/2018 at 6:00 AM, theprogg said:

This turned out to be stupidly easy. Just needed a foreach named loop with piece attribute set to unreal_input_mesh_name

can you share your node and their settings I'm trying to do this and if it's okay the link on the documents? appreciate any help thank you.

Share this post


Link to post
Share on other sites

If you just want to group your geo according to the string coming in from Unreal you could just put down an attribute wrangle set to run over prims and run this code :

setprimgroup(0, s@unreal_input_mesh_name, @primnum, 1, "set");

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×