fbx import error (vertex colors?) #104773

Closed
opened 2023-07-25 10:18:58 +02:00 by sebbbb · 3 comments

System Information
Operating system: Windows 10
Graphics card: RTX 4090

Short description of error
FBX Import fails with error.

Exact steps for others to reproduce the error
When importing the attached FBX (exported from unreal) I get the following error:

Python: Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx_init_.py", line 207, in execute
if import_fbx.load(self, context, filepath=path, **keywords) == {'FINISHED'}:
File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 3109, in load
_(); del _
File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 3103, in _
root_helper.build_hierarchy(fbx_tmpl, settings, scene, view_layer)
File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 2534, in build_hierarchy
child.build_hierarchy(fbx_tmpl, settings, scene, view_layer)
File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 2521, in build_hierarchy
obj = self.build_node_obj(fbx_tmpl, settings)
File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 2324, in build_node_obj
obj.color[0:3] = elem_props_get_color_rgb(fbx_props, b'Color', (0.8, 0.8, 0.8))
File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 195, in elem_props_get_color_rgb
assert(elem_prop.props[1] == b'ColorRGB')
AssertionError

The file imports fine into maya so I don't think there's something wrong with it.

**System Information** Operating system: Windows 10 Graphics card: RTX 4090 **Short description of error** FBX Import fails with error. **Exact steps for others to reproduce the error** When importing the attached FBX (exported from unreal) I get the following error: Python: Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\__init__.py", line 207, in execute if import_fbx.load(self, context, filepath=path, **keywords) == {'FINISHED'}: File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 3109, in load _(); del _ File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 3103, in _ root_helper.build_hierarchy(fbx_tmpl, settings, scene, view_layer) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 2534, in build_hierarchy child.build_hierarchy(fbx_tmpl, settings, scene, view_layer) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 2521, in build_hierarchy obj = self.build_node_obj(fbx_tmpl, settings) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 2324, in build_node_obj obj.color[0:3] = elem_props_get_color_rgb(fbx_props, b'Color', (0.8, 0.8, 0.8)) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_scene_fbx\import_fbx.py", line 195, in elem_props_get_color_rgb assert(elem_prop.props[1] == b'ColorRGB') AssertionError The file imports fine into maya so I don't think there's something wrong with it.
sebbbb added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2023-07-25 10:18:59 +02:00
Member

The Groundplane_SM model (Blender Object equivalent) in this .fbx has a KString type property named Color that is marked as a user property (b'U' in elem_prop.props[3]). Normally, Color is not a user property and would have the ColorRGB type.

I guess when reading properties such as Color, the importer should ignore any marked as user properties. There's probably a lot of places other properties are read that should have the same treatment of ignoring user properties.

This error can also be achieved by exporting from Blender an Object with a Custom Property called Color with the Custom Properties option of the exporter enabled, and then importing that .fbx back into Blender.

Groundplane_SM is a bit extra weird in that all its properties are marked as user properties, even those that I'm pretty sure shouldn't be, yet the other model in the file, UCX_Groundplane_SM, is normal. Another weird .fbx file from Unreal...

The `Groundplane_SM` model (Blender Object equivalent) in this .fbx has a `KString` type property named `Color` that is marked as a user property (`b'U' in elem_prop.props[3]`). Normally, `Color` is not a user property and would have the `ColorRGB` type. I guess when reading properties such as `Color`, the importer should ignore any marked as user properties. There's probably a lot of places other properties are read that should have the same treatment of ignoring user properties. This error can also be achieved by exporting from Blender an Object with a Custom Property called `Color` with the `Custom Properties` option of the exporter enabled, and then importing that .fbx back into Blender. `Groundplane_SM` is a bit extra weird in that all its properties are marked as user properties, even those that I'm pretty sure shouldn't be, yet the other model in the file, `UCX_Groundplane_SM`, is normal. Another weird .fbx file from Unreal...
Author

Thanks for looking into this :) Would it maybe be possible to set the color to the default if the value is malformed, instead of erroring out?

Thanks for looking into this :) Would it maybe be possible to set the color to the default if the value is malformed, instead of erroring out?
Member

yes, can confirm the assert when user property matches the label of FBX property.

yes, can confirm the assert when user property matches the label of FBX property.
Pratik Borhade added
Status
Confirmed
Module
Add-ons (BF-Blender)
and removed
Status
Needs Triage
labels 2023-08-08 06:43:50 +02:00
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-08-08 16:14:47 +02:00
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#104773
No description provided.