Blender cannot import pbr materials from FBX (the imported material is totally black, without textures) #83399

Closed
opened 2020-12-04 15:05:01 +01:00 by Jorge Gascon Perez · 11 comments

System Information
Operating system: Linux-5.9.10-arch1-1-x86_64-with-arch 64 Bits
Graphics card: Radeon RX 590 Series (POLARIS10, DRM 3.39.0, 5.9.10-arch1-1, LLVM 11.0.0) X.Org 4.6 (Core Profile) Mesa 20.2.3

Blender Version
Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-10-27 14:27, hash: blender/blender@90e12e823f

Short description of error
When I try to import a fbx from sketchfab that have PBR materials configured (for example this: https://sketchfab.com/3d-models/assault-rifle-pbr-8c6ed34adaf740318f6ab1b08ac4e7d4),
shot-2020-12-04_14-59-34.jpg
The materials are not imported in Blender, instead, I only get all the meshes black (I enable "Material Preview" in the viewport shading controls).
shot-2020-12-04_15-00-03.jpg

shot-2020-12-04_15-00-14.jpg

Exact steps for others to reproduce the error
Uncompress the attached file: Import the fbx file "source/LOW_WEPON.fbx" in Blender using the menú "Import --> FBX".
(Or download the fbx file from "https://sketchfab.com/3d-models/assault-rifle-pbr-8c6ed34adaf740318f6ab1b08ac4e7d4")
In Blender, in the "Viewport Shading" buttons, select the button "Display in Material Preview Mode", all the meshes will be shown in black.

Thank you very much in advance.

assault-rifle-pbr.zip

**System Information** Operating system: Linux-5.9.10-arch1-1-x86_64-with-arch 64 Bits Graphics card: Radeon RX 590 Series (POLARIS10, DRM 3.39.0, 5.9.10-arch1-1, LLVM 11.0.0) X.Org 4.6 (Core Profile) Mesa 20.2.3 **Blender Version** Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-10-27 14:27, hash: `blender/blender@90e12e823f` **Short description of error** When I try to import a fbx from sketchfab that have PBR materials configured (for example this: https://sketchfab.com/3d-models/assault-rifle-pbr-8c6ed34adaf740318f6ab1b08ac4e7d4), ![shot-2020-12-04_14-59-34.jpg](https://archive.blender.org/developer/F9476880/shot-2020-12-04_14-59-34.jpg) The materials are not imported in Blender, instead, I only get all the meshes black (I enable "Material Preview" in the viewport shading controls). ![shot-2020-12-04_15-00-03.jpg](https://archive.blender.org/developer/F9476879/shot-2020-12-04_15-00-03.jpg) ![shot-2020-12-04_15-00-14.jpg](https://archive.blender.org/developer/F9476878/shot-2020-12-04_15-00-14.jpg) **Exact steps for others to reproduce the error** Uncompress the attached file: Import the fbx file "source/LOW_WEPON.fbx" in Blender using the menú "Import --> FBX". (Or download the fbx file from "https://sketchfab.com/3d-models/assault-rifle-pbr-8c6ed34adaf740318f6ab1b08ac4e7d4") In Blender, in the "Viewport Shading" buttons, select the button "Display in Material Preview Mode", all the meshes will be shown in black. Thank you very much in advance. [assault-rifle-pbr.zip](https://archive.blender.org/developer/F9476886/assault-rifle-pbr.zip)

Added subscriber: @JorgeGasconPerez

Added subscriber: @JorgeGasconPerez
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

I did test this, and this fbx does show up all black. However, the fbx in #83395 does import with materials, so I am not sure that this is an issue in Blender, and not this file.

Also note that the gITF version of the weapon imports as expected with the correct materials.

I did test this, and this fbx does show up all black. However, the fbx in #83395 does import with materials, so I am not sure that this is an issue in Blender, and not this file. Also note that the gITF version of the weapon imports as expected with the correct materials.

Added subscriber: @virtualbri

Added subscriber: @virtualbri

Several PBR material property names are not being checked for in the import_fbx.py, assuming this was exported correctly.

After running into this problem with some 3DS Max files and having access to the source I added additional parameters to look for which made my particular FBX's work.

This is the amended import_fbx.py I am using. If there are other programs using PBD materials with other property names, they'd have to be included too. Maybe this will help someone to come up with a better way to search for all these differing names in Blender.

My python file doesn't work for this assault rifle, nor does importing this model into 3DS Max, so it might just not be textured.
file{F9507411}

Several PBR material property names are not being checked for in the import_fbx.py, assuming this was exported correctly. After running into this problem with some 3DS Max files and having access to the source I added additional parameters to look for which made my particular FBX's work. This is the amended import_fbx.py I am using. If there are other programs using PBD materials with other property names, they'd have to be included too. Maybe this will help someone to come up with a better way to search for all these differing names in Blender. My python file doesn't work for this assault rifle, nor does importing this model into 3DS Max, so it might just not be textured. file{[F9507411](https://archive.blender.org/developer/F9507411/import_fbx.py)}
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Hi, thx for the report (terribly sorry this has been lying around for so long)

  • FBX importer just does not find texture connections (not sure how this has been exported, but it actually seems this has been written with Blender (stable FBX IO) - 2.79 (sub 5) -- not sure if this is what Sketchfab uses or if they just make available whatever the artist provides?). I traced the connections here https://developer.blender.org/diffusion/BA/browse/master/io_scene_fbx/import_fbx.py$3132
  • Mesh turns black because Alpha is zero, changing this to 1.0 in the Principled BSDF gives us at least non-black shading
  • note blenders importer only searches for images in subdirectories (this is not how the sketchfab .zip is structured (but this is irrelevant in this case, because the FBX just does not seem to have these texture connections)
  • if this is exported by blenders exporter, note that it only has very limited support for textures (in that it does not export textures if these are not directly plugged into the corresponding socket -- no inbetween nodes allowed)
  • both the alpha/black issue as well as the missing textures could be the result of the limitations the exporter has had (and not neccessarily the importing process)

Sooo, trying to progress here I would like to ask if this FBX imports "correctly" in any other application?
As a workaround, I would also suggest using GLTF (this by now is more mature in many cases)

Hi, thx for the report (terribly sorry this has been lying around for so long) - FBX importer just does not find texture connections (not sure how this has been exported, but it actually seems this has been written with `Blender (stable FBX IO) - 2.79 (sub 5)` -- not sure if this is what Sketchfab uses or if they just make available whatever the artist provides?). I traced the connections here https://developer.blender.org/diffusion/BA/browse/master/io_scene_fbx/import_fbx.py$3132 - Mesh turns black because Alpha is zero, changing this to 1.0 in the Principled BSDF gives us at least non-black shading - note blenders importer only searches for images in subdirectories (this is not how the sketchfab .zip is structured (but this is irrelevant in this case, because the FBX just does not seem to have these texture connections) - if this is exported by blenders exporter, note that it only has very limited support for textures (in that it does not export textures if these are not directly plugged into the corresponding socket -- no inbetween nodes allowed) - both the alpha/black issue as well as the missing textures could be the result of the limitations the exporter has had (and not neccessarily the importing process) Sooo, trying to progress here I would like to ask if this FBX imports "correctly" in any other application? As a workaround, I would also suggest using GLTF (this by now is more mature in many cases)

Hi Philip,

Thank you for pointing to this issue, I think that it's a problem from sketchfab exporter, it "forgets" the texture connections when the fbx is exported.

That generated fbx files don't work in other softwares either.

Should we close this issue?

Thanks a lot.

Hi Philip, Thank you for pointing to this issue, I think that it's a problem from sketchfab exporter, it "forgets" the texture connections when the fbx is exported. That generated fbx files don't work in other softwares either. Should we close this issue? Thanks a lot.
Member

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'
Member

In #83399#1318594, @JorgeGasconPerez wrote:
Hi Philip,

Thank you for pointing to this issue, I think that it's a problem from sketchfab exporter, it "forgets" the texture connections when the fbx is exported.

That generated fbx files don't work in other softwares either.

Should we close this issue?

Thanks a lot.

Thx getting back!
I think this can be closed then, yes. It might make sense to check with sketchfab on their side, but not much we can here here then.

> In #83399#1318594, @JorgeGasconPerez wrote: > Hi Philip, > > Thank you for pointing to this issue, I think that it's a problem from sketchfab exporter, it "forgets" the texture connections when the fbx is exported. > > That generated fbx files don't work in other softwares either. > > Should we close this issue? > > Thanks a lot. Thx getting back! I think this can be closed then, yes. It might make sense to check with sketchfab on their side, but not much we can here here then.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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#83399
No description provided.