2
$\begingroup$

I have a model which has a light mesh in it. I have 2 materials, a light on and light off material for the light, but the mesh can only have one material at a time in its slot 1. This is all fine and well so far. I am exporting the model to FBX to be used in Unity.

The problem, is that when I import to Unity, only the slot 1 material gets imported. I have also tried importing the FBX back into Blender and the material is missing. This leads me to believe the material is getting dropped on export from Blender (not import to Unity). I have tried to assign the material to slot 2, and also added a fake user to the material, but it still seems to disappear on export. Any ideas would be hugely helpful. I am fairly new to Blender.

My export settings:

enter image description here

Some more stuff for clarification:

enter image description here

The goal here is to have the materials embedded in the model and then reassign them from within Unity as I toggle the switch. If I assign the "on" materials to an object in its 1st material slot, then they embed and it works, but that would mean creating dummy objects and hiding them inside geometry. Very bad workaround for something seemingly so trivial. Again, any suggestions would be very appreciated. Thanks!!

$\endgroup$
2
$\begingroup$

You can export a dummy object from Blender that contains all of your materials as "materials.fbx". In unity use the materials from "materials.fbx" and the model from the blender file.

It's not ideal, however it's one better than create dummy objects hidden inside of the geometry.

It would be great if there was a proper way to do this. I noticed the .fbx files exported from Blender contain the material even if it isn't used, so it's Unity that's not letting us see them.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.