Automatic assign maps from my FBX to unity material.

Hi everybody,

First of all, sorry for my bad english :wink:

Here is my problem :

When I import a .fbx file (ASCII with embed media) from 3dsmax to unity, unity creates automaticaly a material with only a diffuse slot.
When my FBX contains a diffuse map, unity put it in the diffuse slot. (and creates a FBM folder with the good texture in it)
For now, everything work as expected.

BUT, when the FBX contains, for example, a bump map with another texture, unity creates the FBM folder with the right textures in it, but automaticaly creates a material with only a diffuse slot.
So I have to manualy change my material type and reasign the texture from my FBM folder.
When i look in the FBX file with a text editor, I can find the link to all the texture maps, but I can’t find a way to tell unity to use them.

I read some thread about this problem but the only solution seem to manualy assigning the textures.
Easy when you have 2 or 3 material but a big waste of time when you have 150 materials to remap.

So, do someone know how to parse the FBX file in unity and relink textures to the materials ?
This task seems easy to do (for example, it takes few lines of code in maxscript) but I can’t find a way to do that in Unity.

Hope my question is clear … if not feel free to ask me for details.
Thanks in advance for your answers.

Kind regards

Chris.

Hmm , i might be wrong , but as far as i know , once imported to Unity , you MUST recreate all your materials. I have never found any other way.

Improved importing and automatic creation of proper materials for Bump/Spec, Transparent, etc is coming in Unity 3.5. Until then you either need to recreate the Materials in Unity or create a postprocessor script to automate this yourself:

Looks very interesting.
I will try this and wait for 3.5 for an automatic process.
I come back to you if it works

Thx

If you’re using 3dsMax, then import via the Max scene file, and not direct FBX export from 3dsMax. This gives better results and if in 3dsMax you were using a standard material with diffuse and normal maps applied, you’ll get those maps connected in Unity automatically- one of the key advantages to using the native .max scene translation from Unity.

Looking forward to the improvements from Unity 3.5.

@Antenna Tree
Can you guys have a look at how Epic implemented FBX with Unreal? They did it pretty smart, if in your FBX file you exported a material (3dsMax, Maya, or Softimage) with maps in the diffuse, specular, normal map, and self illumination channels; Unreal automatically connects those maps for you perfectly in the Material Editor (UnrealEd). It’s all automated and if you guys could just mimic some of that good stuff, Unity development would be that much better. Thoughts?

Hello everybody,

Thanks for your answers.
We tried to apply your advice before answering to this post.

@ Antenna tree
We tried to write a post processor script based on the OnAssignMaterialModel but in this one we didn’t succeed to access to the FBX data. (texture names etc.)
So we can’t assign a texture to a new created material based on the FBX data.
Maybe we missed something … if so, please give us a clue.

@i3DTutorials
We tried to import .max files directly in unity, without any success.
The problem seems to be our version of 3dsmax (64bits)
After reinstalling a 32 bit version of max, Unity is able to import .max correctly.
(did someone have the same “problem” ?)
Unfortunately, Unity doesn’t import any of our texture files.
It works only with diffuse when we use a FBX file with embeded media.
No texture at all is exported when we use .max file. (same file as the working .FBX file)
Once again, maybe we missed something …

If you have any idea, fell free to help us.

Thanks

Chris.

I am able to successfully work with 3dsMax 2012 64-bit and Unity3D 3.4

Which version of 3dsMax are you running?

Hello i3d

Actually we use 3dsmax 64bits (32bits for unity) 2011 sp1.
I will probably try with a demo version of max 2012.
But it’s cheeper to wait for Unity 3.5 rather than upgrading our copies of 3dsmax to the newer version … :slight_smile:

I come back to you if it works.
Thanks a lot

Chris.

5 years later I run into this problem with Unity 5.3… :smile:

Is it suppose to work now automatically? I can only get the diffuse slot in my 3ds Max 2016 standard material slot to be assigned in Unity but it doesnt add the bump (normal) map in unity when I import the FBX with embedded media.

Can someone shed a light? Thanks!