HDA won't create multiple material instances

   103   3   1
User Avatar
Member
16 posts
Joined: Jan. 2016
Offline
I have an HDA which is essentially a sphere partitioned into a number of sections. For each section (which might consist of a number of primitives), I would like to assign a different material instance with a different diffuse texture.

So, if I create a sphere with 8 sections (and for simplification here imagine each section is just one primitive), then here is what I have in my 'unreal_material_instance' attribute column:

Material'/Game/Materials/EarthHoudiniTile_0.EarthHoudiniTile_0'
Material'/Game/Materials/EarthHoudiniTile_1.EarthHoudiniTile_1'
Material'/Game/Materials/EarthHoudiniTile_2.EarthHoudiniTile_2'
Material'/Game/Materials/EarthHoudiniTile_3.EarthHoudiniTile_3'
Material'/Game/Materials/EarthHoudiniTile_4.EarthHoudiniTile_4'
Material'/Game/Materials/EarthHoudiniTile_5.EarthHoudiniTile_5'
Material'/Game/Materials/EarthHoudiniTile_6.EarthHoudiniTile_6'
Material'/Game/Materials/EarthHoudiniTile_7.EarthHoudiniTile_7'

And here is what I have in my 'unreal_material_parameter_diffuse' column:

Texture2D'/Game/Textures/A_0.A_0'
Texture2D'/Game/Textures/A_1.A_1'
Texture2D'/Game/Textures/A_2.A_2'
Texture2D'/Game/Textures/A_3.A_3'
Texture2D'/Game/Textures/B_0.B_0'
Texture2D'/Game/Textures/B_1.B_1'
Texture2D'/Game/Textures/B_2.B_2'
Texture2D'/Game/Textures/B_3.B_3'

I have created all those material instances in UE4, and they have a parameter called ‘diffuse’ which is a texture parameter.

Most of this seems to work - I get the geometry in, it has the right number of material slots, with materials assigned to them. However, only the first material is correctly created as an instance with the diffuse texture parameter set. All the other materials are directly linked to the UE4 materials I created, and the parameter is not changed. If I look in the HoudiniEngine/Temp folder there is just one material instance there, called ‘EarthHoudiniTile_0_instance_DFA94D48’.

So it seems like the first material slot has had it's material instance created, with the parameter set, but all the rest have been skipped somehow.

Is this a bug, or am I just going about this the wrong way?
User Avatar
Staff
119 posts
Joined: Sept. 2016
Offline
Hi,

Could you send us your hda so I can check that?

Your setup seems correct to me, it seems to me that the issue is more likely to be a limitation/bug of the current material instances attributes on the ue4 plugin.
User Avatar
Member
16 posts
Joined: Jan. 2016
Offline
Sure, see attached. Thanks!

Attachments:
Sectioned_Sphere.hdalc (8.8 KB)

User Avatar
Staff
119 posts
Joined: Sept. 2016
Offline
Hi,

Your issue is actually due to a limitation in the current material instance attribute implementation, as it only supports one material for now. This was due to the fact that when applying those material instance attributes, the material slots and static meshes are already created, making it hard to match primitive attributes to those..

Tomorrow's daily build (16.5.345) will have a fix for this, helping in supporting multiple material slots to the material instance attribute system, but this should still be considered an edge case and not fully supported by the plug-in.

Let me know if it fixes your issue.
  • Quick Links