[Bf-extensions-cvs] [184e74f] master: Fix T48322: Proxy Armature Animations are not exported to FBX.

Bastien Montagne noreply at git.blender.org
Sun May 1 17:37:00 CEST 2016


Commit: 184e74fbe76d105919689b24e2dbd80aaac8f588
Author: Bastien Montagne
Date:   Sun May 1 17:29:17 2016 +0200
Branches: master
https://developer.blender.org/rBA184e74fbe76d105919689b24e2dbd80aaac8f588

Fix T48322: Proxy Armature Animations are not exported to FBX.

This is the 'proxy case', only fixable one for now (linked object have un-editable animdata.action,
so we cannot export animations for them for now).

Issue was simply that armature modifier of linked mesh object still 'points' to linked armature
object, and not to its local proxy. Fix is luckily easy (for once)!

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

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

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

diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index c97478b..decd947 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, 7, 3),
+    "version": (3, 7, 4),
     "blender": (2, 77, 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 add9d7f..98cc265 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -1794,10 +1794,10 @@ def fbx_skeleton_from_armature(scene, settings, arm_obj, objects, data_meshes,
         # Always handled by an Armature modifier...
         found = False
         for mod in ob_obj.bdata.modifiers:
-            if mod.type not in {'ARMATURE'}:
+            if mod.type not in {'ARMATURE'} or not mod.object:
                 continue
             # We only support vertex groups binding method, not bone envelopes one!
-            if mod.object == arm_obj.bdata and mod.use_vertex_groups:
+            if mod.object in {arm_obj.bdata, arm_obj.bdata.proxy} and mod.use_vertex_groups:
                 found = True
                 break
 
diff --git a/io_scene_fbx/fbx_utils.py b/io_scene_fbx/fbx_utils.py
index 53a540e..7467f4f 100644
--- a/io_scene_fbx/fbx_utils.py
+++ b/io_scene_fbx/fbx_utils.py
@@ -1158,7 +1158,7 @@ class ObjectWrapper(metaclass=MetaObjectWrapper):
         if self.parent == arm_obj and self.bdata.parent_type == 'ARMATURE':
             return True
         for mod in self.bdata.modifiers:
-            if mod.type == 'ARMATURE' and mod.object == arm_obj.bdata:
+            if mod.type == 'ARMATURE' and mod.object in {arm_obj.bdata, arm_obj.bdata.proxy}:
                 return True
 
     # #### Duplis...



More information about the Bf-extensions-cvs mailing list