[Bf-extensions-cvs] [34564dc] master: Fix T45813: FBX export: add dummy stringification of custom props which are not directly supported by FBX format.

Bastien Montagne noreply at git.blender.org
Mon Aug 17 22:19:05 CEST 2015


Commit: 34564dc442de355acfb7edd426a1dc265f0d761a
Author: Bastien Montagne
Date:   Mon Aug 17 22:17:43 2015 +0200
Branches: master
https://developer.blender.org/rBA34564dc442de355acfb7edd426a1dc265f0d761a

Fix T45813: FBX export: add dummy stringification of custom props which are not directly supported by FBX format.

This allows some thrid party app to have someting to parse if needed.

Quite obviously, this only applies to exporter.

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

M	io_scene_fbx/__init__.py
M	io_scene_fbx/export_fbx_bin.py

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

diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index 5e3f93a..5bd609a 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": (3, 5, 3),
+    "version": (3, 5, 4),
     "blender": (2, 74, 0),
     "location": "File > Import-Export",
     "description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index 58cfea1..6e1fc6a 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -542,8 +542,13 @@ def fbx_data_element_custom_properties(props, bid):
             elem_props_set(props, "p_integer", k.encode(), v, custom=True)
         elif isinstance(v, float):
             elem_props_set(props, "p_double", k.encode(), v, custom=True)
-        elif list_val and len(list_val) == 3:
-            elem_props_set(props, "p_vector", k.encode(), list_val, custom=True)
+        elif list_val:
+            if len(list_val) == 3:
+                elem_props_set(props, "p_vector", k.encode(), list_val, custom=True)
+            else:
+                elem_props_set(props, "p_string", k.encode(), str(list_val), custom=True)
+        else:
+            elem_props_set(props, "p_string", k.encode(), str(v), custom=True)
 
 
 def fbx_data_empty_elements(root, empty, scene_data):



More information about the Bf-extensions-cvs mailing list