diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-15 06:05:32 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-15 06:05:32 +0400 |
commit | e59ab6486f9e7285815671044b785c28365d5165 (patch) | |
tree | 4a9406c8181a817a8b96243ae167acc740ed20f7 /source/blender/collada | |
parent | 35ab6cabbf62187290e417dba6d8b18cd4fe18de (diff) | |
parent | b1019a56b54294fc91293c5c43ef46d54950ae84 (diff) |
svn merge -r41751:41779 ^/trunk/blender
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/ArmatureExporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/ArmatureImporter.cpp | 26 | ||||
-rw-r--r-- | source/blender/collada/ArmatureImporter.h | 2 |
3 files changed, 14 insertions, 16 deletions
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp index 077a06ce6ca..df786c38c71 100644 --- a/source/blender/collada/ArmatureExporter.cpp +++ b/source/blender/collada/ArmatureExporter.cpp @@ -267,7 +267,7 @@ void ArmatureExporter::export_controller(Object* ob, Object *ob_arm) std::string controller_id = get_controller_id(ob_arm, ob); openSkin(controller_id, controller_name, - COLLADABU::URI(COLLADABU::Utils::EMPTY_STRING, get_geometry_id(ob))); + COLLADABU::URI(COLLADABU::Utils::EMPTY_STRING, get_geometry_id(ob))); add_bind_shape_mat(ob); diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp index 7e9634da21d..bababf880a6 100644 --- a/source/blender/collada/ArmatureImporter.cpp +++ b/source/blender/collada/ArmatureImporter.cpp @@ -112,8 +112,7 @@ void ArmatureImporter::create_unskinned_bone( COLLADAFW::Node *node, EditBone *p bone->roll=angle; // set head copy_v3_v3(bone->head, mat[3]); - - + // set tail, don't set it to head because 0-length bones are not allowed float vec[3] = {0.0f, 0.5f, 0.0f}; add_v3_v3v3(bone->tail, bone->head, vec); @@ -427,7 +426,7 @@ void ArmatureImporter::create_armature_bones( ) TODO: check if bones have already been created for a given joint */ - leaf_bone_length = FLT_MAX; + leaf_bone_length = FLT_MAX; create_unskinned_bone(*ri, NULL, (*ri)->getChildNodes().getCount(), NULL, ob_arm); fix_leaf_bones(); @@ -593,17 +592,16 @@ void ArmatureImporter::set_pose ( Object * ob_arm , COLLADAFW::Node * root_node } else { copy_m4_m4(mat, obmat); - float invObmat[4][4]; - invert_m4_m4(invObmat, ob_arm->obmat); - mul_m4_m4m4(pchan->pose_mat, mat, invObmat); - + float invObmat[4][4]; + invert_m4_m4(invObmat, ob_arm->obmat); + mul_m4_m4m4(pchan->pose_mat, mat, invObmat); } - - mat4_to_axis_angle(ax,&angle,mat); - pchan->bone->roll = angle; - - COLLADAFW::NodePointerArray& children = root_node->getChildNodes(); + mat4_to_axis_angle(ax,&angle,mat); + pchan->bone->roll = angle; + + + COLLADAFW::NodePointerArray& children = root_node->getChildNodes(); for (unsigned int i = 0; i < children.getCount(); i++) { set_pose(ob_arm, children[i], bone_name, mat); } @@ -762,8 +760,8 @@ Object *ArmatureImporter::get_armature_for_joint(COLLADAFW::Node *node) if (skin.uses_joint_or_descendant(node)) return skin.get_armature(); } - - std::map<COLLADAFW::UniqueId, Object*>::iterator arm; + + std::map<COLLADAFW::UniqueId, Object*>::iterator arm; for (arm = unskinned_armature_map.begin(); arm != unskinned_armature_map.end(); arm++) { if(arm->first == node->getUniqueId() ) return arm->second; diff --git a/source/blender/collada/ArmatureImporter.h b/source/blender/collada/ArmatureImporter.h index d2e3b8be4f5..343badaca28 100644 --- a/source/blender/collada/ArmatureImporter.h +++ b/source/blender/collada/ArmatureImporter.h @@ -107,7 +107,7 @@ private: float parent_mat[][4], bArmature *arm); void create_unskinned_bone(COLLADAFW::Node *node, EditBone *parent, int totchild, - float parent_mat[][4], Object * ob_arm); + float parent_mat[][4], Object * ob_arm); void add_leaf_bone(float mat[][4], EditBone *bone, COLLADAFW::Node * node); |