Assigning an attribute based on another attribute

   3006   3   1
User Avatar
Member
21 posts
Joined: April 2018
Offline
Hello

I'm trying to utilize the variant attribute from the heightfield scatter node to assign unreal_instance attributes for use in ue4.



What is happening here is the top loop is just creating and merging boxes based on the amount of inputs I have from the multiparameter. Basically the same as creating different geometry nodes and merging them together.

Going through the heightfield scatter those different boxes are each assigned a variant value (in this example from 0 - 3)

I then want to assign the Unreal Mesh string value you can see in the parameter list to the corresponding variant attribute.

I'm guessing maybe a loop would be suitable but I have no idea where to start. Should I be using attribute expression with vex or just a regular group node with something extra or maybe even just looping through the entire point list in the thousands and individually assigning them one by one?
User Avatar
Member
205 posts
Joined: Jan. 2014
Offline
Do you want to assign a string attribute based on your integer number?

Attachments:
rand_string_v01_t001.hiplc (86.6 KB)

I contribute to the beauty of this world
https://houdininotes.ivanlarinin.com/ [houdininotes.ivanlarinin.com]
User Avatar
Member
21 posts
Joined: April 2018
Offline
Yes, but based on the 'unreal mesh' input give in the multiparameter list.
e.g. list index 0 'asdf' is added to points with the 'variant' value of 0 and so on.

So not defining the list in the wrangle node but from the multiparm parameter value.
I was able to do it fine with the boxes but am unsure how to proceed with this part of it as there are thousands of points.

Also for more context why I'm doing it like this, the heightfield scatter node does not retain custom attributes created for the instances so the only other option is creating them after going through that node.
User Avatar
Member
1 posts
Joined: Feb. 2022
Offline


A good way is using the "Labs Attribute Value Replace" node. With it you can specify an existing attribute to map to another value and you can rename the Attribute to unreal_instance for use in UE. The initialize values button is great for quickly adding your map

Attachments:
NameReplace.png (99.7 KB)

  • Quick Links