diff --git a/io_scene_dae/__init__.py b/io_scene_dae/__init__.py index 6900562..918185d 100644 --- a/io_scene_dae/__init__.py +++ b/io_scene_dae/__init__.py @@ -98,7 +98,8 @@ class ExportDAE(bpy.types.Operator, ExportHelper): ) use_exclude_ctrl_bones = BoolProperty( name="Exclude Control Bones", - description="Exclude skeleton bones with names beginning with 'ctrl'.", + description=("Exclude skeleton bones with names beginning with 'ctrl' " + "or bones which are not marked as Deform bones."), default=True, ) use_anim = BoolProperty( diff --git a/io_scene_dae/export_dae.py b/io_scene_dae/export_dae.py index f5662cf..21abe2e 100644 --- a/io_scene_dae/export_dae.py +++ b/io_scene_dae/export_dae.py @@ -1067,8 +1067,8 @@ class DaeExporter: def export_armature_bone(self, bone, il, si): is_ctrl_bone = ( - bone.name.startswith("ctrl") and - self.config["use_exclude_ctrl_bones"]) + self.config["use_exclude_ctrl_bones"] and + (bone.name.startswith("ctrl") or bone.use_deform == False)) if (bone.parent is None and is_ctrl_bone is True): self.operator.report( {"WARNING"}, "Root bone cannot be a control bone.") @@ -1696,8 +1696,9 @@ class DaeExporter: if (node.type == "ARMATURE"): # All bones exported for now for bone in node.data.bones: - if((bone.name.startswith("ctrl") and - self.config["use_exclude_ctrl_bones"])): + if((bone.name.startswith("ctrl") or + bone.use_deform == False) and + self.config["use_exclude_ctrl_bones"]): continue bone_name = self.skeleton_info[node]["bone_ids"][bone] @@ -1712,8 +1713,10 @@ class DaeExporter: if (bone.parent): if (self.config["use_exclude_ctrl_bones"]): current_parent_posebone = bone.parent - while (current_parent_posebone.name - .startswith("ctrl") and + while ((current_parent_posebone.name + .startswith("ctrl") or + current_parent_posebone.use_deform + == False) and current_parent_posebone.parent): current_parent_posebone = ( current_parent_posebone.parent)