From 426383bde9dd79431ba4bb2d21a2ac92803696f4 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 27 May 2020 16:26:03 +0200 Subject: Fix T67708: UDP3DSMAX custom properties need even more work... Because, why would you stick to a single separator between name and value, right? Where would be the fun in that? --- io_scene_fbx/__init__.py | 2 +- io_scene_fbx/import_fbx.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'io_scene_fbx') diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py index 2e7d6987..f52e3edd 100644 --- a/io_scene_fbx/__init__.py +++ b/io_scene_fbx/__init__.py @@ -21,7 +21,7 @@ bl_info = { "name": "FBX format", "author": "Campbell Barton, Bastien Montagne, Jens Restemeier", - "version": (4, 21, 1), + "version": (4, 21, 2), "blender": (2, 90, 3), "location": "File > Import-Export", "description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions", diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py index a2534884..6664be4e 100644 --- a/io_scene_fbx/import_fbx.py +++ b/io_scene_fbx/import_fbx.py @@ -328,9 +328,15 @@ def blen_read_custom_properties(fbx_obj, blen_obj, settings): items = fbx_prop.props[4].decode('utf-8', 'replace') for item in items.split('\r\n'): if item: - prop_name, prop_value = item.split('=', 1) - prop_name = validate_blend_names(prop_name.strip().encode('utf-8')) - blen_obj[prop_name] = prop_value.strip() + split_item = item.split('=', 1) + if len(split_item) != 2: + split_item = item.split(':', 1) + if len(split_item) != 2: + print("cannot parse UDP3DSMAX custom property '%s', ignoring..." % item) + else: + prop_name, prop_value = split_item + prop_name = validate_blend_names(prop_name.strip().encode('utf-8')) + blen_obj[prop_name] = prop_value.strip() else: prop_name = validate_blend_names(fbx_prop.props[0]) prop_type = fbx_prop.props[1] -- cgit v1.2.3