- Home /
Material to Mesh Mapping for FBX
I have a custom OnAssignMaterialModel script that assigns specific materials within my project to the model based on the name of the material that is coming out of Maya. My script is working great, and doing everything that I want it to do, but I have noticed a problem. When I reimport that fbx after creating some new materials, I will see them get assigned to that model just fine on my screen. However, when I push that model up to our version control and someone else pulls down my changes, they will see that model in the same state they had originally had it in. They then have to do a reimport of that model themselves, so that the script will run once again, in order to see the correct materials on that model.
I had originally assumed that the mapping for which material is assigned to each element within each mesh of the model would be contained in the meta file, but after looking at the meta file it is obvious that isn't the case. Which makes it very painful to work with across multiple work stations when each model takes 8-10 minutes to import.
Where does the information live that is mapping which material is assigned to an element on a mesh when you import in an FBX?
Answer by Binxalot · Jun 03, 2015 at 07:01 PM
Are they putting the models on to the scene as prefabs or directly dragging the fbx model to the scene? What I have to do to see changes to a fbx is make a prefab first, then when I update the mesh in the project I have to drag the updated mesh to the prefab object in the project view and the updated changes then show on the prefab in the scene
.but.
If I just drag a fbx without it being a prefab, Unity sort of makes a phantom copy of the original file that lives on the scene and is somehow separated from the mesh in the project. I wish I had a more technical explanation to give you of why this happens, I just know it does. I'm dealing with it now as I updated my unity 3 project to unity 5.
We are dropping the FBX file directly into the scene. This should be using the "prefab" that unity makes directly for you upon importing the model into the project.
The problem that you will most likely see by making the model into your own prefab and then dropping that into the scene, is some disconnects when you attempt to add new geometry to that model. The new prefab that you made will not take any of this new geometry into effect as it already has its entire hierarchy saved and the meshes that each game object maps to.
Your answer
Follow this Question
Related Questions
Can't edit the model materials,Can't edit the model materials 0 Answers
Unity material pipeline 1 Answer
share or reassign materials 0 Answers
Animation Root Motion Problem 0 Answers
Maya/Unity FBX Round-trip Not Working 0 Answers