Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Material ID order has changed

Discussion in 'Editor & General Support' started by Kragh, Sep 12, 2008.

Thread Status:
Not open for further replies.
  1. Kragh

    Kragh

    Joined:
    Jan 22, 2008
    Posts:
    656
    Hi everybody. I have problem with material ID's. When I export from max via the FBX-eksporter, it seems the order of the material ID's changes. Sometimes... Not allways.
    If i.e. I have an object with ten ID's, and ten different types of material attached to these, it is rather anoying, when I get the model into Unity, when the order has changed. So if I in Max had to put the brushed aluminium on Mat ID 3, then now I maybe need to put it on element No. 7 in Unity. Any reason for this? Any solutions? Any ways two avoid this from happening?

    The reason I write it now, is because I just found a rather dumb mistake in my latest project. Two objects very much alike (two facades on a building) with many different types of material, which were originally the same ID-wise, are now completely different from each other. And I have to make trial and errors to make sure the right materials are on the right parts of the object.
     
    zakirshikhli likes this.
  2. Alpha-Loup

    Alpha-Loup

    Joined:
    Jun 23, 2006
    Posts:
    797
    A solution would be very interesting. I encountered the same problem with one of my models imported from cinema 4D. Its made of different parts, each uses the same two materials. And the IDs change on some parts wich makes it impossible to render it as a combined mesh...

    As it is happening from different apps, it could have something to do with fbx or the sequence in wich the materials are assigned. I will try to delete and reasssign the materials in the right order inside the render-app this evening to see if this helps...

    Any solution or workaround on this topic would be great.

    Frank
     
  3. cyuxi

    cyuxi

    Joined:
    Apr 21, 2014
    Posts:
    49
    12 years gone...
    Just find out that the order of Material ID in Unity is only relative to the sequence of attaching the submeshes when you modeling the mesh(FBX).
    Say you have A for the base mesh, and you make a B part and attach it to A as a whole, in fact, this attachment action implies that A is ID 1 and B is ID 2.
    Whatever sub materials you afterward have assigned to each of both will not change the order of ID element after importing FBX in unity.
     
Thread Status:
Not open for further replies.