substance files packed into an HDA

   2866   2   1
User Avatar
Member
193 posts
Joined: Aug. 2011
Offline
hi, is there a way to pack substance files into the HDA and then have them extract into the Unity project and can be assigned properly when the asset loads?

because that would be cool.

.
.
.


also, if anybody knows how to do that in Unreal, but i will ask over there, too, when i need it.
Edited by twelveplusplus - Aug. 11, 2017 11:52:59
User Avatar
Member
571 posts
Joined: May 2017
Offline
Apologies for the delay.

There isn't a way to pack substance files into an HDA to be extracted into Unity. Rather what you can do instead is to set attributes on your primitives with the substance path. Then place the substance files in your Unity project at that path. This way when you bring in the HDA, it will pick up the substance files using that path.

First create a primitive attribute called ‘unity_material’ and set it as String type, and with value of the path to your substance .sbsar file in Unity relative to your Resources folder or Assets folder.

Then create another primitive attribute called ‘unity_sub_material_name’ with String type, and with value of the name of your actual substance material.
OR
You can specify the substance material index by creating a primitive attribute called ‘unity_sub_material_index’ with Integer type, and value of the index of your material.

I attached an OTL which was one of our examples. It has a drop down to choose different types of materials, including the last option which has the substance materials (via name and index). I also attached the substance file as well for you to place in Unity. Check it out to see how it was done.

Attachments:
unity_materials.otl (9.8 KB)
Aircraft_Metal.sbsar (4.9 KB)

User Avatar
Member
193 posts
Joined: Aug. 2011
Offline
oh, thanks! i didn't know about those substance related attributes. that could be pretty useful
  • Quick Links