Blender profile for leaf_bone tip. (untested).
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user