FBX import adds multiple copies of same material #54227

Closed
opened 2018-03-04 20:12:08 +01:00 by Ejnar Brendsdal · 12 comments

System Information
System-Info.txt

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. 1000 Mat green.fbx
2: Notice the 1000 copies of the material.

**System Information** [System-Info.txt](https://archive.blender.org/developer/F2418469/System-Info.txt) **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. [1000 Mat green.fbx](https://archive.blender.org/developer/F2418509/1000_Mat_green.fbx) 2: Notice the 1000 copies of the material.

Added subscriber: @EjnarBrendsdal

Added subscriber: @EjnarBrendsdal

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

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

Added subscriber: @mont29

Added subscriber: @mont29

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

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.

Two Blue Cubes.fbx

Hi Bastien. Thanks for looking at this. Sorry for making such a mess :D Here is a simple scene with two blue cubes. [Two Blue Cubes.fbx](https://archive.blender.org/developer/F2422044/Two_Blue_Cubes.fbx)

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2018-03-05 10:50:37 +01:00

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. :)

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!

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!
Member

Added subscriber: @jesterking

Added subscriber: @jesterking
Member

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

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

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 :)

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 :)
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#54227
No description provided.