- Home /
Blender FBX - Material Generation on Import Weirdness
So I have spent a few hours now, trying to understand how Unity imports blender materials, so that I don't end up with a whole bunch of unused materials over time (like I have in the past). In Unity there are two Material Generation options: "Per Texture" and "Per Material". Likewise in blender there are two places textures are applied, One is in the UV area (used only for the viewport), the other is in the Material (used only in the render).
I have been testing the "Per Material" option and I'm having the following problem:
Say I have and fbx file called "test.fbx" wich contains two objects: "box1" and "box2" each with the same material applied called "mat1" and that material has a texture linked to it called "tex1.psd". None of the objects have a texture selected in the UV area, only in the material.
If I import this FBX to Unity I get exactly what I want, Only one material called "test-mat1.mat" which is applied to both objects. I can link the correct texture to it in Unity and I'm good to go.
But if in Blender I add the "tex1.psd" texture to "box1" in the UV area (so I can see it textured in the viewport) and export again. Unity now creates a second material for "box1" called "test-mat1_ _tex1_psd.mat". This behavior doesn't make sense to me because unity is creating a material that doesn't exist in blender. Dose anyone know of a way for Unity to actually only import per material like the option is supposed to work?
I would like to be able to assign texturs in Blender in the UV area so that I can see in my viewport what I'm working with, but I don't want these textures to affect materials at all in Unity; thats what I set up materials for in Blender in the first place. The other fix would be if there was a way for blender to display in the viewport the material texture rather than the UV texture.
$$anonymous$$aterials assigned the way you describe should already be showing in the Blender 3D view. You shouldn't need to also assign them in the UV view.
Answer by guategeek_legacy · Jul 01, 2011 at 12:00 AM
Ok thanks for the pointer, I was able to find out how to set this to work. For anyone else with the same problem the viewport/display/shading needs to be set to GLSL instead of the default "Multitexture". This way blender and Unity both display the material texture and there is no need for you to set a UV texture in blender (which adds more materials in unity).
To set the viewport Dispay shader to GLSL do the following:
make sure the mouse is over the 3D view
press "n" to display the properties panel (if you already have the properties panel displayed ignore this step)
Look for the "Display" section and open it if its closed
look for the "Shading:" drop down and select "GLSL"