Search - User list
Full Version: Instancer custom data
Root » Houdini Engine for Unreal » Instancer custom data
rendereverything
Hi. Since 4.25 there is a feature to add custom float data per instance. Each instance can have several custom float attributes - these attributes can be accessed in shaders and blueprints and are super useful.
I think it would be nice to have ability to export them from Houdini as per-point/packed primitive attributes. Have some sort of naming convention - like "unreal_cdata_N" and export those to Unreal.
dpernuit
Hi,

Support for per-instance custom data has been added to the v2 plugin in Houdini 18.5.521:

The number of custom floats per instance can be set via the "unreal_num_custom_floats" attribute.
The custom data itself can be set on the instances via the "unreal_per_instance_custom_dataX" attributes, where X is the zero-based index of the custom float data.
rendereverything
Fantastic! Thank You!
Eche
Hello, How do I read these custom data into a shader in Unreal?

Ok found it, there is a PerInstanceCustomData node in the material editor.

Btw Unreal will crash if the Houdini attribute indexing doesn't start at 0, as mentioned above.
Kaiserlicht
Can somebody help me with this setup? I can't get this to work. I want to assign a random color to my instances. I'm using the attribute instancer with the unreal_instance attr. set on my points. Then I add an unreal_num_custom_floats integer attribute set to 3 and then three float attributes unreal_per_instance_custom_data0,1,2 set to different values.
Inside Unreal I'm using PerInstanceCustomData in my material assigned to the object I'm instancing. But apparently it doesn't contain any values, it's always black. Any help would be greatly appreciated!
Kaiserlicht
No one? Or is the question too confusing
Siavash Tehrani
Hey Kasierlicht, I know I had this working. I will try to doublecheck this weekend and post the setup.
Kaiserlicht
Awesome, thank you!
Siavash Tehrani
I have attached a little sample hda. It scatters some cubes onto points with the unreal_num_custom_floats and unreal_per_instance_custom_dataX attributes. In Unreal you apply a material to this asset that uses the PerInstanceCustomData nodes passed through a VertexInterpolator. This setup also works fine if you skip the Copy to Points bit in Houdini and use the unreal_instance attribute like you are doing.
Let me know if you have any questions.
Kaiserlicht
Thanks again for the effort! I'm starting to feel stupid but I still can't get this to work. I apply my material to the "static mesh (instanced)" output of my instancer, correct? I had to rebuild your hda because engine won't allow me to import indie assets with a fx license. Can you try if the attached asset works for you?
Kaiserlicht
Oh dear, forget about it. I was on 18.5.499 all the time. Sorry for being stupid, and thanks again for the help
Siavash Tehrani
No worries, I'm glad it's sorted out!
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