Page MenuHome

FBX import adds multiple copies of same material
Closed, ArchivedPublic

Description

System Information

Blender Version
2.79

Short description of error
When I import a FBX file with ie. 1000 objects alle with the same material, Blender creates a unique material for each object.
So we end up with 1000 copies of the same material each named "Material_1", "Material_2", "Material_3"... etc.

The FBX is generated by Rhino btw.
And when reimporting into Rhino only one material is created.

Is this intended behaviour or is it a bug?

Exact steps for others to reproduce the error
1: Import the attached file.


2: Notice the 1000 copies of the material.

Event Timeline

PS: It does not ppear to happen when using a FBX file exported from Blender itself...

Bastien Montagne (mont29) lowered the priority of this task from 90 to 30.Mar 5 2018, 8:57 AM

There is probably something in how materials are stored… Can you please submit rather a two-objects-using-same-material FBX from rhino? One thousand one does not add anything here, except tremendous amount of noise in a huge file, making it impossible to analyze. :P

Hi Bastien.

Thanks for looking at this. Sorry for making such a mess :D
Here is a simple scene with two blue cubes.

Bastien Montagne (mont29) changed the task status from Unknown Status to Unknown Status.Mar 5 2018, 10:50 AM
Bastien Montagne (mont29) claimed this task.

Thanks for the report and file. I can confirm there are two materials in Blender, but… it’s because there are two materials in FBX file!

As you can see in this JSON-ified snippet of the FBX file:

["Material", [110261568, "Blue Material::Material", ""], "LSS", [
    ["Version", [102], "I", []],
    ["ShadingModel", ["lambert"], "S", []],
    ["MultiLayer", [0], "I", []],
    ["Properties70", [], "", [
        ["P", ["AmbientColor", "ColorRGB", "Color", "", 0.0, 0.0, 0.0], "SSSSDDD", []],
        ["P", ["DiffuseColor", "ColorRGB", "Color", "", 0.0, 0.0, 1.0], "SSSSDDD", []],
        ["P", ["Emissive", "Vector3D", "Vector", "", 0.0, 0.0, 0.0], "SSSSDDD", []],
        ["P", ["Ambient", "Vector3D", "Vector", "", 0.0, 0.0, 0.0], "SSSSDDD", []],
        ["P", ["Diffuse", "Vector3D", "Vector", "", 0.0, 0.0, 1.0], "SSSSDDD", []],
        ["P", ["Opacity", "double", "Number", "", 1.0], "SSSSD", []]]]]],
["Material", [110264256, "Blue Material_2::Material", ""], "LSS", [
    ["Version", [102], "I", []],
    ["ShadingModel", ["lambert"], "S", []],
    ["MultiLayer", [0], "I", []],
    ["Properties70", [], "", [
        ["P", ["AmbientColor", "ColorRGB", "Color", "", 0.0, 0.0, 0.0], "SSSSDDD", []],
        ["P", ["DiffuseColor", "ColorRGB", "Color", "", 0.0, 0.0, 1.0], "SSSSDDD", []],
        ["P", ["Emissive", "Vector3D", "Vector", "", 0.0, 0.0, 0.0], "SSSSDDD", []],
        ["P", ["Ambient", "Vector3D", "Vector", "", 0.0, 0.0, 0.0], "SSSSDDD", []],
        ["P", ["Diffuse", "Vector3D", "Vector", "", 0.0, 0.0, 1.0], "SSSSDDD", []],
        ["P", ["Opacity", "double", "Number", "", 1.0], "SSSSD", []]]]]]]],

Rhino is probably doing some smart processing when re-importing its file back (probably based on naming scheme?), but that is totally out of FBX or Blender area, FBX do support since ages a single material definition used by multiple objects (well, Model nodes in FBX terminology). This should probably be reported as a bug to rhino actually. :)

Hmm... Interesting.
I did not know you could JSON-ify FBX files.
I will contact McNeel and hear what they have to say on the matter.

Thanks for the help so far!

Note that Rhino imports the file with multiple materials as well...

Hmm... wierd. In my rhino it only imports as one material...
Anyway the discussion has moved on to the McNeel forum.
As far as that goes it could seem to be solved in the latest version of Rhino.

For interested follow along here:
https://discourse.mcneel.com/t/exporting-fbx-results-in-a-lot-of-copies-of-same-material/56692

Allright here is the conclusion. The bug was on the Rhino side of things and is also solved.
So this issue can be closed and everyone is happy :)