Instancer custom data
2930 11 1-
- rendereverything
- Member
- 44 posts
- Joined: 3月 2014
- Offline
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.
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
- スタッフ
- 530 posts
- Joined: 9月 2016
- Offline
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.
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
- Member
- 44 posts
- Joined: 3月 2014
- Offline
-
- Eche
- Member
- 37 posts
- Joined: 2月 2018
- Offline
-
- Kaiserlicht
- Member
- 18 posts
- Joined: 11月 2015
- Offline
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!
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
- Member
- 18 posts
- Joined: 11月 2015
- Offline
-
- Siavash Tehrani
- Member
- 686 posts
- Joined: 7月 2005
- Online
-
- Kaiserlicht
- Member
- 18 posts
- Joined: 11月 2015
- Offline
-
- Siavash Tehrani
- Member
- 686 posts
- Joined: 7月 2005
- Online
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.
Let me know if you have any questions.
-
- Kaiserlicht
- Member
- 18 posts
- Joined: 11月 2015
- Offline
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
- Member
- 18 posts
- Joined: 11月 2015
- Offline
-
- Siavash Tehrani
- Member
- 686 posts
- Joined: 7月 2005
- Online
-
- Quick Links