[Bf-extensions-cvs] [426383bd] master: Fix T67708: UDP3DSMAX custom properties need even more work...

Bastien Montagne noreply at git.blender.org
Wed May 27 16:29:10 CEST 2020


Commit: 426383bde9dd79431ba4bb2d21a2ac92803696f4
Author: Bastien Montagne
Date:   Wed May 27 16:26:03 2020 +0200
Branches: master
https://developer.blender.org/rBA426383bde9dd79431ba4bb2d21a2ac92803696f4

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?

===================================================================

M	io_scene_fbx/__init__.py
M	io_scene_fbx/import_fbx.py

===================================================================

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]



More information about the Bf-extensions-cvs mailing list