Fix T42029: FBX export: armatures linked to mesh only through modifier were not exported correctly.

Now also check modifiers stack.
This commit is contained in:
Bastien Montagne 2014-10-01 08:56:09 +02:00
parent 77618baacd
commit 34998c87c0
Notes: blender-bot 2023-02-14 20:03:09 +01:00
Referenced by issue #42029, FBX Export -> Unity Import
4 changed files with 20 additions and 2 deletions

View File

@ -1676,7 +1676,7 @@ def fbx_skeleton_from_armature(scene, settings, arm_obj, objects, data_meshes,
data_bones.update((bo, get_blender_bone_key(arm_obj.bdata, bo.bdata)) for bo in bones)
for ob_obj in objects:
if not (ob_obj.is_object and ob_obj.type == 'MESH' and ob_obj.parent == arm_obj):
if not ob_obj.is_deformed_by_armature(arm_obj):
continue
# Always handled by an Armature modifier...

View File

@ -1054,6 +1054,15 @@ class ObjectWrapper(metaclass=MetaObjectWrapper):
return ()
material_slots = property(get_material_slots)
def is_deformed_by_armature(self, arm_obj):
if not (self.is_object and self.type == 'MESH'):
return False
if self.parent == arm_obj:
return True
for mod in self.bdata.modifiers:
if mod.type == 'ARMATURE' and mod.object == arm_obj.bdata:
return True
# #### Duplis...
def dupli_list_create(self, scene, settings='PREVIEW'):
if self._tag == 'OB':

View File

@ -1683,7 +1683,7 @@ def fbx_skeleton_from_armature(scene, settings, arm_obj, objects, data_meshes,
data_bones.update((bo, get_blender_bone_key(arm_obj.bdata, bo.bdata)) for bo in bones)
for ob_obj in objects:
if not (ob_obj.is_object and ob_obj.type == 'MESH' and ob_obj.parent == arm_obj):
if not ob_obj.is_deformed_by_armature(arm_obj):
continue
# Always handled by an Armature modifier...

View File

@ -1057,6 +1057,15 @@ class ObjectWrapper(metaclass=MetaObjectWrapper):
return ()
material_slots = property(get_material_slots)
def is_deformed_by_armature(self, arm_obj):
if not (self.is_object and self.type == 'MESH'):
return False
if self.parent == arm_obj:
return True
for mod in self.bdata.modifiers:
if mod.type == 'ARMATURE' and mod.object == arm_obj.bdata:
return True
# #### Duplis...
def dupli_list_create(self, scene, settings='PREVIEW'):
if self._tag == 'OB':