Page MenuHome

FBX import fails with long custom property names
Closed, ResolvedPublic

Description

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

  1. Import the attached FBX
  2. 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'

Related Objects

Event Timeline

Philipp Oeser (lichtwerk) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.

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 @Bastien Montagne (mont29) for an opinion...

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.