Importing Custom Normals with FBX fails #43582

Closed
opened 2015-02-06 14:59:05 +01:00 by Przemyslaw Golab (SirPigeonz) · 11 comments

Build Bot: Blender 2.73.6 2015-02-05 21:14 Hash: ced4c5f
GA.org build: Blender 2.72.1 2014-10-08 18:15 Hash: 6b2952c Branch testbuild

Exports from BB and GA versions using Smoothing set to "Edge" in exporter options opens correctly in Mudbox and probably Max too.

Importing FBXs.

In BB build:

  • doesn't import correctly FBX saved from blender BB or GA, all faces are flat
  • importing FBX made probably in Max (maybe Maya not sure sorry) crashes import and displays this traceback:
Traceback (most recent call last):
  File "C:\Users\pgolab\Desktop\blender-2.73-ced4c5f-win64\2.73\scripts\addons\io_scene_fbx\__init__.py", line 200, in execute
    return import_fbx.load(self, context, **keywords)
  File "C:\Users\pgolab\Desktop\blender-2.73-ced4c5f-win64\2.73\scripts\addons\io_scene_fbx\import_fbx.py", line 2242, in load
    _(); del _
  File "C:\Users\pgolab\Desktop\blender-2.73-ced4c5f-win64\2.73\scripts\addons\io_scene_fbx\import_fbx.py", line 2236, in _
    fbx_item[1] = blen_read_texture_image(fbx_tmpl_img, fbx_obj, basedir, settings)
  File "C:\Users\pgolab\Desktop\blender-2.73-ced4c5f-win64\2.73\scripts\addons\io_scene_fbx\import_fbx.py", line 1281, in blen_read_texture_image
    filepath = filepath.replace('\\', '/') if (os.sep == '/') else filepath.replace('/', '\\')
AttributeError: 'NoneType' object has no attribute 'replace'

location: <unknown location>:-1

In GA build:

  • doesn't import correctly FBX saved from blender BB or GA, all faces are flat same as BB build
  • importing Max FBX works correctly
Build Bot: Blender 2.73.6 2015-02-05 21:14 Hash: ced4c5f GA.org build: Blender 2.72.1 2014-10-08 18:15 Hash: 6b2952c Branch testbuild **Exports from BB and GA versions** using Smoothing set to "Edge" in exporter options opens correctly in Mudbox and probably Max too. **Importing FBXs.** **In BB build:** - doesn't import correctly FBX saved from blender BB or GA, all faces are flat - importing FBX made probably in Max (maybe Maya not sure sorry) crashes import and displays this traceback: ``` Traceback (most recent call last): File "C:\Users\pgolab\Desktop\blender-2.73-ced4c5f-win64\2.73\scripts\addons\io_scene_fbx\__init__.py", line 200, in execute return import_fbx.load(self, context, **keywords) File "C:\Users\pgolab\Desktop\blender-2.73-ced4c5f-win64\2.73\scripts\addons\io_scene_fbx\import_fbx.py", line 2242, in load _(); del _ File "C:\Users\pgolab\Desktop\blender-2.73-ced4c5f-win64\2.73\scripts\addons\io_scene_fbx\import_fbx.py", line 2236, in _ fbx_item[1] = blen_read_texture_image(fbx_tmpl_img, fbx_obj, basedir, settings) File "C:\Users\pgolab\Desktop\blender-2.73-ced4c5f-win64\2.73\scripts\addons\io_scene_fbx\import_fbx.py", line 1281, in blen_read_texture_image filepath = filepath.replace('\\', '/') if (os.sep == '/') else filepath.replace('/', '\\') AttributeError: 'NoneType' object has no attribute 'replace' location: <unknown location>:-1 ``` **In GA build:** - doesn't import correctly FBX saved from blender BB or GA, all faces are flat same as BB build - importing Max FBX works correctly

Changed status to: 'Open'

Changed status to: 'Open'
Bastien Montagne was assigned by Przemyslaw Golab (SirPigeonz) 2015-02-06 14:59:05 +01:00

Added subscriber: @SirPigeonz

Added subscriber: @SirPigeonz

Please always attach need files to reproduce the issue (in this case, FBX from max, and .blend + FBX from blender)…

Please always attach need files to reproduce the issue (in this case, FBX from max, and .blend + FBX from blender)…

FBX from BB build: lamp.fbx
FBX from GA build: lamp_ga.fbx

Mudbox FBX: mudbox_fbx_example.fbx

I can't create or share Max FBX that worked but I made Mudbox FBX (they should be compatible) but which also has issues but a bit different.
In BB build the same as above.
In GA buld mesh imports but it resets custom normals and displays this traceback:

Traceback (most recent call last):
  File "C:\Users\pgolab\Desktop\testbuild-blender-2.72-6b2952c-win64\2.72\scripts\addons\io_scene_fbx\__init__.py", line 213, in execute
    return import_fbx.load(self, context, **keywords)
  File "C:\Users\pgolab\Desktop\testbuild-blender-2.72-6b2952c-win64\2.72\scripts\addons\io_scene_fbx\import_fbx.py", line 2709, in load
    _(); del _
  File "C:\Users\pgolab\Desktop\testbuild-blender-2.72-6b2952c-win64\2.72\scripts\addons\io_scene_fbx\import_fbx.py", line 2637, in _
    tex_map = texture_mapping_get(fbx_lnk)
  File "C:\Users\pgolab\Desktop\testbuild-blender-2.72-6b2952c-win64\2.72\scripts\addons\io_scene_fbx\import_fbx.py", line 2526, in texture_mapping_get
    assert(fbx_props[0] is not None)
AssertionError

location: <unknown location>:-1


.blend file: lamp.blend

FBX from BB build: [lamp.fbx](https://archive.blender.org/developer/F141647/lamp.fbx) FBX from GA build: [lamp_ga.fbx](https://archive.blender.org/developer/F141648/lamp_ga.fbx) Mudbox FBX: [mudbox_fbx_example.fbx](https://archive.blender.org/developer/F141651/mudbox_fbx_example.fbx) I can't create or share Max FBX that worked but I made Mudbox FBX (they should be compatible) but which also has issues but a bit different. In BB build the same as above. In GA buld mesh imports but it resets custom normals and displays this traceback: ``` Traceback (most recent call last): File "C:\Users\pgolab\Desktop\testbuild-blender-2.72-6b2952c-win64\2.72\scripts\addons\io_scene_fbx\__init__.py", line 213, in execute return import_fbx.load(self, context, **keywords) File "C:\Users\pgolab\Desktop\testbuild-blender-2.72-6b2952c-win64\2.72\scripts\addons\io_scene_fbx\import_fbx.py", line 2709, in load _(); del _ File "C:\Users\pgolab\Desktop\testbuild-blender-2.72-6b2952c-win64\2.72\scripts\addons\io_scene_fbx\import_fbx.py", line 2637, in _ tex_map = texture_mapping_get(fbx_lnk) File "C:\Users\pgolab\Desktop\testbuild-blender-2.72-6b2952c-win64\2.72\scripts\addons\io_scene_fbx\import_fbx.py", line 2526, in texture_mapping_get assert(fbx_props[0] is not None) AssertionError location: <unknown location>:-1 ``` .blend file: [lamp.blend](https://archive.blender.org/developer/F141655/lamp.blend)

Fixed issue with mudbox FBX file.

I tried your two lamp.fbx files, none of them have normals, so it cannot import correctly (as in, like org .blend file) in Blender nor any other application.

I tried to export and re-import lamp.blend with current master, and it works as expected. So think you are using incorrect export settings, most likely you have set Smoothing to 'Face' or 'Edge', please let it to 'Off' if you want normals.

Fixed issue with mudbox FBX file. I tried your two lamp.fbx files, none of them have normals, so it cannot import correctly (as in, like org .blend file) in Blender nor any other application. I tried to export and re-import lamp.blend with current master, and it works as expected. So think you are using incorrect export settings, most likely you have set Smoothing to 'Face' or 'Edge', please let it to 'Off' if you want normals.

Hmm, yes I used Edge Smoothing if I used Off or Face when I exported files and opened them in Mudbox there was no sharp edges in Mudbox.

I'm not sure how the workflow with custom normals nor FBX options should work then. Is there documentation on them? I didn't found any. I was testing it blindly I must admit. Testing what works and what not, exporting with Edge Smoothing was closest I get.
This would help me testing it further. (but at Monday I don't have access to Autodesk tools at home).

I'm mostly interested how to export Blender model to FBX with sharp edges/loops that I or somebody on the team can open in Mudbox, Max or Maya and that imports the same to Blender. Is it possible?

Well I can use Edge Split modifier but that is destructive workflow that leaves separated vertices so I can't use it on project.

Hmm, yes I used Edge Smoothing if I used Off or Face when I exported files and opened them in Mudbox there was no sharp edges in Mudbox. I'm not sure how the workflow with custom normals nor FBX options should work then. Is there documentation on them? I didn't found any. I was testing it blindly I must admit. Testing what works and what not, exporting with Edge Smoothing was closest I get. This would help me testing it further. (but at Monday I don't have access to Autodesk tools at home). I'm mostly interested how to export Blender model to FBX with sharp edges/loops that I or somebody on the team can open in Mudbox, Max or Maya and that imports the same to Blender. Is it possible? Well I can use Edge Split modifier but that is destructive workflow that leaves separated vertices so I can't use it on project.

There was a bug due to recent custom normals merge, that resulted in always exporting only vertex normals (i.e. smooth shading). I fixed it yesterday evening, so you hould be able to confirm with latest builds from buildbot that everything is back to normal?

There was a bug due to recent custom normals merge, that resulted in always exporting only vertex normals (i.e. smooth shading). I fixed it yesterday evening, so you hould be able to confirm with latest builds from buildbot that everything is back to normal?

Sorry for late reply. I've tested new builds and:

  • exported FBX with Smoothing OFF imports correctly to Blender but Mudbox imports it as globaly smoothed, ignoring splited edges
  • exported FBX with Smoothing Edge imports as flat faces in Blender but imports correctly to Mudbox
Sorry for late reply. I've tested new builds and: - exported FBX with Smoothing OFF imports correctly to Blender but Mudbox imports it as globaly smoothed, ignoring splited edges - exported FBX with Smoothing Edge imports as flat faces in Blender but imports correctly to Mudbox

This issue was referenced by blender/blender-addons@95633e7f1b

This issue was referenced by blender/blender-addons@95633e7f1b1bb40f058cbb6d7ed0d7afd1512a24

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Closed by commit blender/blender-addons@95633e7f1b.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
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#43582
No description provided.