FBX: Materials missing from linked duplicates #104737
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 512.78
Broken: 3.6.0, 4.0.0
Short description of error
Moved from blender/blender#109723
When exporting an object with linked data to FBX and importing into Unity, the material on the copied object no longer exists.
Exact steps for others to reproduce the error
- Create a material on an object
- use the ALT+D link to copy the object.
- exporting to FBX
- import into Unity (the material on the copied object no longer exists)
This is not a problem in Blender. The material on the copied object is still present, but when exporting to FBX, the material on the copied object no longer exists.
The attached no_mat.blend in a comment in the original issue has two cubes that share the same mesh and have the same materials. Exporting this as .fbx and importing the .fbx into Unity will result in the material being missing from one of the cubes:
For some reason, this exported .fbx actually works in FBX Review, but it's clear from looking at the code and the .fbx itself that the linked duplicates (aside from the first) are not being given any material slots (material to model connections).
Importing the exported .fbx back into Blender will not show any issues because the materials are imported into the mesh by default. Because the linked duplicates, aside from the first, have no material slots, the materials are imported into the mesh from the first linked duplicate and then the other linked duplicates result in a no-op when it comes to importing their materials.
Will mark as High prio since this seems to be a recent regression.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?