Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>2011-08-21 17:51:04 +0400
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>2011-08-21 17:51:04 +0400
commit4f75566672b06931556888b0b300533c110d6e3d (patch)
tree8bfed4eb94812bc18bd05a9bf20ff747ad123af9 /source/blender/collada/AnimationExporter.cpp
parentee938c3be861d55ceea217ff09c5f42c89b956c6 (diff)
export animations if a bone is in a deform group. ( on hold )
Diffstat (limited to 'source/blender/collada/AnimationExporter.cpp')
-rw-r--r--source/blender/collada/AnimationExporter.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index 8a7d285abcb..014c13d8986 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -352,13 +352,34 @@ void AnimationExporter::exportAnimations(Scene *sce)
if (!ob_arm->adt)
return;
+ //This will only export animations of bones in deform group.
+ /*if(!is_bone_deform_group(bone))
+ return;*/
+
sample_and_write_bone_animation_matrix(ob_arm, bone);
for (Bone *child = (Bone*)bone->childbase.first; child; child = child->next)
write_bone_animation_matrix(ob_arm, child);
}
-
+ bool AnimationExporter::is_bone_deform_group(Bone * bone)
+ {
+ bool is_def;
+ //Check if current bone is deform
+ if((bone->flag & BONE_NO_DEFORM) == 0 ) return true;
+ //Check child bones
+ else
+ {
+ for (Bone *child = (Bone*)bone->childbase.first; child; child = child->next){
+ //loop through all the children until deform bone is found, and then return
+ is_def = is_bone_deform_group(child);
+ if (is_def) return true;
+ }
+ }
+ //no deform bone found in children also
+ return false;
+ }
+
void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, Bone *bone)
{
bArmature *arm = (bArmature*)ob_arm->data;