diff options
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/ArmatureImporter.cpp | 22 | ||||
-rw-r--r-- | source/blender/collada/ControllerExporter.cpp | 2 |
2 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp index 0cd48707566..eb92b089f48 100644 --- a/source/blender/collada/ArmatureImporter.cpp +++ b/source/blender/collada/ArmatureImporter.cpp @@ -133,24 +133,28 @@ void ArmatureImporter::create_bone(SkinInfo *skin, COLLADAFW::Node *node, EditBo add_v3_v3v3(bone->tail, bone->head, vec); // set parent tail - if (parent && totchild == 1) { - copy_v3_v3(parent->tail, bone->head); - - // not setting BONE_CONNECTED because this would lock child bone location with respect to parent - bone->flag |= BONE_CONNECTED; + if (parent) { // XXX increase this to prevent "very" small bones? const float epsilon = 0.000001f; // derive leaf bone length - float length = len_v3v3(parent->head, parent->tail); + float length = len_v3v3(parent->head, bone->head); if ((length < leaf_bone_length || totbone == 0) && length > epsilon) { leaf_bone_length = length; } - // treat zero-sized bone like a leaf bone - if (length <= epsilon) { - add_leaf_bone(parent_mat, parent, node); + if (totchild == 1) { + copy_v3_v3(parent->tail, bone->head); + + // not setting BONE_CONNECTED because this would lock child bone location with respect to parent + bone->flag |= BONE_CONNECTED; + + + // treat zero-sized bone like a leaf bone + if (length <= epsilon) { + add_leaf_bone(parent_mat, parent, node); + } } } diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp index 4c6f71ff1a6..d04ed8d6fa1 100644 --- a/source/blender/collada/ControllerExporter.cpp +++ b/source/blender/collada/ControllerExporter.cpp @@ -123,7 +123,7 @@ void ControllerExporter::operator()(Object *ob) if (ob_arm) { export_skin_controller(ob, ob_arm); } - if (key) { + if (key && this->export_settings->include_shapekeys) { export_morph_controller(ob, key); } } |