diff options
author | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-25 00:27:27 +0400 |
---|---|---|
committer | Sukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com> | 2011-07-25 00:27:27 +0400 |
commit | 1e0e0ff5c4e88f2ee21c849b151a1899ae4c714f (patch) | |
tree | c49683682a8c456fce83752c9c4fb3da23af0e98 /source/blender | |
parent | 6a392e8cb505b753a0bac24e42778306007c45b8 (diff) |
Blender profile for leaf_bone tip. (untested).
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/collada/AnimationExporter.cpp | 3 | ||||
-rw-r--r-- | source/blender/collada/ArmatureExporter.cpp | 17 | ||||
-rw-r--r-- | source/blender/collada/ArmatureExporter.h | 2 | ||||
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 5 | ||||
-rw-r--r-- | source/blender/collada/DocumentImporter.h | 2 |
5 files changed, 22 insertions, 7 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 222838c3838..0e6fa4d0d92 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -415,7 +415,8 @@ void AnimationExporter::exportAnimations(Scene *sce) float ctime = bsystem_time(scene, ob_arm, *it, 0.0f); - BKE_animsys_evaluate_animdata(&ob_arm->id, ob_arm->adt, *it, ADT_RECALC_ANIM); + //BKE_animsys_evaluate_animdata(&ob_arm->id, ob_arm->adt, *it, ADT_RECALC_ANIM); + //BKE_animsys_evaluate_animdata(scene , &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM); where_is_pose_bone(scene, ob_arm, pchan, ctime, 1); // compute bone local mat diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp index ad9098db3d8..6849e4de7dd 100644 --- a/source/blender/collada/ArmatureExporter.cpp +++ b/source/blender/collada/ArmatureExporter.cpp @@ -177,6 +177,9 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm) node.setNodeName(node_name); node.setNodeSid(node_sid); + if ( bone->childbase.first == NULL ) + add_blender_leaf_bone( bone, ob_arm , node ); + else{ node.start(); add_bone_transform(ob_arm, bone, node); @@ -186,8 +189,22 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm) } node.end(); + } } +void ArmatureExporter::add_blender_leaf_bone(Bone *bone, Object *ob_arm, COLLADASW::Node& node) +{ + node.start(); + + add_bone_transform(ob_arm, bone, node); + + node.addExtraTechniqueParameter("blender", "tip_x", bone->tail[0] ); + node.addExtraTechniqueParameter("blender", "tip_y", bone->tail[1] ); + node.addExtraTechniqueParameter("blender", "tip_z", bone->tail[2] ); + + node.end(); + +} void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW::Node& node) { bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name); diff --git a/source/blender/collada/ArmatureExporter.h b/source/blender/collada/ArmatureExporter.h index f4488942f7b..b3441c797e8 100644 --- a/source/blender/collada/ArmatureExporter.h +++ b/source/blender/collada/ArmatureExporter.h @@ -92,6 +92,8 @@ private: void add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW::Node& node); + void add_blender_leaf_bone(Bone *bone, Object *ob_arm, COLLADASW::Node& node); + std::string get_controller_id(Object *ob_arm, Object *ob); // ob should be of type OB_MESH diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index d4eeb594922..c3090eebc9f 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -537,10 +537,7 @@ bool DocumentImporter::writeMaterial( const COLLADAFW::Material* cmat ) this->uid_effect_map[cmat->getInstantiatedEffect()] = ma; this->uid_material_map[cmat->getUniqueId()] = ma; - this->matUidforEffect = &(cmat->getUniqueId()); - /*COLLADAFW::Material * matCopy = new COLLADAFW::Material(&cmat); - this->FW_object_map[cmat->getUniqueId()] = matCopy; - *///matForEff = cmat; + return true; } diff --git a/source/blender/collada/DocumentImporter.h b/source/blender/collada/DocumentImporter.h index 8af0996885b..f6917c2e9bf 100644 --- a/source/blender/collada/DocumentImporter.h +++ b/source/blender/collada/DocumentImporter.h @@ -158,8 +158,6 @@ private: std::vector<const COLLADAFW::VisualScene*> vscenes; std::vector<Object*> libnode_ob; - const COLLADAFW::UniqueId *matUidforEffect; - std::map<COLLADAFW::UniqueId, COLLADAFW::Node*> root_map; // find root joint by child joint uid, for bone tree evaluation during resampling std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map; |