Refactor: Collada: remove param, changed order of params in Function call

* In the Collada Module parameters are typically ordered
  in a similar way. I changed this to:

    extern std::string get_joint_id(Object *ob, Bone *bone);

* The Object parameter was not used in get_joint_sid().
  I changed this to:

	extern std::string get_joint_sid(Bone *bone);
This commit is contained in:
Gaia Clary 2018-03-17 14:16:19 +01:00
parent 5389964eea
commit 64fbd50e4c
5 changed files with 11 additions and 11 deletions

View File

@ -771,7 +771,7 @@ void AnimationExporter::dae_baked_animation(std::vector<float> &fra, Object *ob_
addSampler(sampler);
std::string target = get_joint_id(bone, ob_arm) + "/transform";
std::string target = get_joint_id(ob_arm, bone) + "/transform";
addChannel(COLLADABU::URI(empty, sampler_id), target);
closeAnimation();

View File

@ -89,7 +89,7 @@ void ArmatureExporter::add_armature_bones(Object *ob_arm, Scene *sce,
void ArmatureExporter::write_bone_URLs(COLLADASW::InstanceController &ins, Object *ob_arm, Bone *bone)
{
if (bc_is_root_bone(bone, this->export_settings->deform_bones_only))
ins.addSkeleton(COLLADABU::URI(COLLADABU::Utils::EMPTY_STRING, get_joint_id(bone, ob_arm)));
ins.addSkeleton(COLLADABU::URI(COLLADABU::Utils::EMPTY_STRING, get_joint_id(ob_arm, bone)));
else {
for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) {
write_bone_URLs(ins, ob_arm, child);
@ -165,9 +165,9 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene *sce,
std::list<Object *>& child_objects)
{
if (!(this->export_settings->deform_bones_only && bone->flag & BONE_NO_DEFORM)) {
std::string node_id = get_joint_id(bone, ob_arm);
std::string node_id = get_joint_id(ob_arm, bone);
std::string node_name = std::string(bone->name);
std::string node_sid = get_joint_sid(bone, ob_arm);
std::string node_sid = get_joint_sid(bone);
COLLADASW::Node node(mSW);

View File

@ -71,7 +71,7 @@ bool ControllerExporter::is_skinned_mesh(Object *ob)
void ControllerExporter::write_bone_URLs(COLLADASW::InstanceController &ins, Object *ob_arm, Bone *bone)
{
if (bc_is_root_bone(bone, this->export_settings->deform_bones_only))
ins.addSkeleton(COLLADABU::URI(COLLADABU::Utils::EMPTY_STRING, get_joint_id(bone, ob_arm)));
ins.addSkeleton(COLLADABU::URI(COLLADABU::Utils::EMPTY_STRING, get_joint_id(ob_arm, bone)));
else {
for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) {
write_bone_URLs(ins, ob_arm, child);
@ -458,7 +458,7 @@ std::string ControllerExporter::add_joints_source(Object *ob_arm, ListBase *defb
for (def = (bDeformGroup *)defbase->first; def; def = def->next) {
Bone *bone = get_bone_from_defgroup(ob_arm, def);
if (bone)
source.appendValues(get_joint_sid(bone, ob_arm));
source.appendValues(get_joint_sid(bone));
}
source.finish();

View File

@ -327,12 +327,12 @@ std::string get_light_id(Object *ob)
return translate_id(id_name(ob)) + "-light";
}
std::string get_joint_id(Bone *bone, Object *ob_arm)
std::string get_joint_id(Object *ob, Bone *bone)
{
return translate_id(id_name(ob_arm) + "_" + bone->name);
return translate_id(id_name(ob) + "_" + bone->name);
}
std::string get_joint_sid(Bone *bone, Object *ob_arm)
std::string get_joint_sid(Bone *bone)
{
return translate_id(bone->name);
}

View File

@ -97,8 +97,8 @@ extern std::string get_geometry_id(Object *ob, bool use_instantiation);
extern std::string get_light_id(Object *ob);
extern std::string get_joint_id(Bone *bone, Object *ob_arm);
extern std::string get_joint_sid(Bone *bone, Object *ob_arm);
extern std::string get_joint_id(Object *ob, Bone *bone);
extern std::string get_joint_sid(Bone *bone);
extern std::string get_camera_id(Object *ob);