FBX import fails with long custom property names #53812

Closed
opened 2018-01-17 06:06:47 +01:00 by Jesse · 6 comments

{F1864160}System Information
Mac OS 10.12.6
NVIDIA GeForce GT 750M

Blender Version
Broken: (example: 2.69.7 4b206af, see splash screen)
Worked: (optional)

Short description of error
When importing an FBX I get the traceback listed below. I don't understand where the key length limit comes from, but there appears to be a long custom property name that exceeds this limit. If I add the below lines to import_fbx.py L318, the FBX imports correctly.

if len(prop_name) > 62:
     prop_name = prop_name[:62]

Exact steps for others to reproduce the error

  • Import the attached FBX
  • Check the INFO output
Traceback (most recent call last):
  File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/__init__.py", line 234, in execute
    return import_fbx.load(self, context, **keywords)
  File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2698, in load
    _(); del _
  File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2692, in _
    root_helper.build_hierarchy(fbx_tmpl, settings, scene)
  File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2129, in build_hierarchy
    child.build_hierarchy(fbx_tmpl, settings, scene)
  File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2120, in build_hierarchy
    child.build_hierarchy(fbx_tmpl, settings, scene)
  File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2120, in build_hierarchy
    child.build_hierarchy(fbx_tmpl, settings, scene)
  File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2120, in build_hierarchy
    child.build_hierarchy(fbx_tmpl, settings, scene)
  File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2120, in build_hierarchy
    child.build_hierarchy(fbx_tmpl, settings, scene)
  File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2116, in build_hierarchy
    obj = self.build_node_obj(fbx_tmpl, settings)
  File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 1928, in build_node_obj
    blen_read_custom_properties(self.fbx_elem, obj, settings)
  File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 338, in blen_read_custom_properties
    blen_obj[prop_name] = fbx_prop.props[4]
KeyError: 'the length of IDProperty names is limited to 63 characters'

{[F1864160](https://archive.blender.org/developer/F1864160/torso.fbx)}**System Information** Mac OS 10.12.6 NVIDIA GeForce GT 750M **Blender Version** Broken: (example: 2.69.7 4b206af, see splash screen) Worked: (optional) **Short description of error** When importing an FBX I get the traceback listed below. I don't understand where the key length limit comes from, but there appears to be a long custom property name that exceeds this limit. If I add the below lines to `import_fbx.py` L318, the FBX imports correctly. ``` if len(prop_name) > 62: prop_name = prop_name[:62] ``` **Exact steps for others to reproduce the error** - Import the attached FBX - Check the INFO output ``` Traceback (most recent call last): File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/__init__.py", line 234, in execute return import_fbx.load(self, context, **keywords) File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2698, in load _(); del _ File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2692, in _ root_helper.build_hierarchy(fbx_tmpl, settings, scene) File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2129, in build_hierarchy child.build_hierarchy(fbx_tmpl, settings, scene) File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2120, in build_hierarchy child.build_hierarchy(fbx_tmpl, settings, scene) File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2120, in build_hierarchy child.build_hierarchy(fbx_tmpl, settings, scene) File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2120, in build_hierarchy child.build_hierarchy(fbx_tmpl, settings, scene) File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2120, in build_hierarchy child.build_hierarchy(fbx_tmpl, settings, scene) File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 2116, in build_hierarchy obj = self.build_node_obj(fbx_tmpl, settings) File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 1928, in build_node_obj blen_read_custom_properties(self.fbx_elem, obj, settings) File "/Applications/blender/blender.app/Contents/Resources/2.79/scripts/addons/io_scene_fbx/import_fbx.py", line 338, in blen_read_custom_properties blen_obj[prop_name] = fbx_prop.props[4] KeyError: 'the length of IDProperty names is limited to 63 characters' ```
Author

Added subscriber: @FreakTheMighty

Added subscriber: @FreakTheMighty
Member

Added subscribers: @mont29, @lichtwerk

Added subscribers: @mont29, @lichtwerk
Bastien Montagne was assigned by Philipp Oeser 2018-01-17 16:51:29 +01:00
Member

Can confirm the limitation, but it is a known limitation.
The limit was raised from 32 a couple of years back.

Now capping the prop name at 63 chars might work in some cases but ask for more trouble [in case of multiple colliding very long names].

Not sure what the best strategy is here: have some very generic way of handling such very long idprops? Leave to the exporting app/user to respect this limitation?

Confirming for now (as it throws an error), but would kindly ask @mont29 for an opinion...

Can confirm the limitation, but it is a known limitation. The limit was raised from 32 a couple of years back. Now capping the prop name at 63 chars might work in some cases but ask for more trouble [in case of multiple colliding very long names]. Not sure what the best strategy is here: have some very generic way of handling such very long idprops? Leave to the exporting app/user to respect this limitation? Confirming for now (as it throws an error), but would kindly ask @mont29 for an opinion...
Author

If we're worried about collisions, maybe we could replace the ID with some sort of UUID or content hash when it exceeds the limit. I'm not really sure what the side effects of changing the ID are, but the import seemed to work fine as far as my needs go.

If we're worried about collisions, maybe we could replace the ID with some sort of UUID or content hash when it exceeds the limit. I'm not really sure what the side effects of changing the ID are, but the import seemed to work fine as far as my needs go.

This issue was referenced by 3dc0ceb198

This issue was referenced by 3dc0ceb198da078de839fcb1b23f98967da0ceb7

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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#53812
No description provided.