diff options
author | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-08-18 00:15:40 +0400 |
---|---|---|
committer | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-08-18 00:15:40 +0400 |
commit | a46f36c9b6c22d0082f820847c1b60acdf17c08b (patch) | |
tree | dae471fac5057238ffc0f5c144fd9d19887cbca2 /source/blender/collada/AnimationExporter.cpp | |
parent | e86e922f5b6d7c3784bb6ffb840e08336ff42027 (diff) |
Animation export id bone animation + armature importer cleanup.
Diffstat (limited to 'source/blender/collada/AnimationExporter.cpp')
-rw-r--r-- | source/blender/collada/AnimationExporter.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index b39e9bb39d5..7bcb225e3c2 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -66,6 +66,7 @@ void AnimationExporter::exportAnimations(Scene *sce) //transform matrix export for bones are temporarily disabled here. if ( ob->type == OB_ARMATURE ) { + if (!ob->data) return; bArmature *arm = (bArmature*)ob->data; for (Bone *bone = (Bone*)arm->bonebase.first; bone; bone = bone->next) write_bone_animation_matrix(ob, bone); @@ -363,10 +364,18 @@ void AnimationExporter::exportAnimations(Scene *sce) bArmature *arm = (bArmature*)ob_arm->data; int flag = arm->flag; std::vector<float> fra; - char prefix[256]; + //char prefix[256]; - BLI_snprintf(prefix, sizeof(prefix), "pose.bones[\"%s\"]", bone->name); + FCurve* fcu = (FCurve*)ob_arm->adt->action->curves.first; + while(fcu) + { + std::string bone_name = getObjectBoneName(ob_arm,fcu); + int val = BLI_strcasecmp((char*)bone_name.c_str(),bone->name); + if(val==0) break; + fcu = fcu->next; + } + if(!(fcu)) return; bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name); if (!pchan) return; |