Jump to content

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
Link to comment
Share on other sites

  • 3 years later...
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.

Link to comment
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");

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...