diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-05 20:03:57 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-05 20:03:57 +0400 |
commit | 1dccd4c98a4909383b9c11f7c2ee987e22833dad (patch) | |
tree | 3d127436243536d6ceaba4cb884249156ba215cd /source/blender/collada | |
parent | ff4ff9c8a429d9869e7056417bc7acd47a545eb2 (diff) |
code cleanup: naming - pose/armature/image
also use ..._find_name(..., name) rather then ..._find_named(..., name) --- both were used.
Diffstat (limited to 'source/blender/collada')
-rw-r--r-- | source/blender/collada/AnimationExporter.cpp | 20 | ||||
-rw-r--r-- | source/blender/collada/AnimationImporter.cpp | 18 | ||||
-rw-r--r-- | source/blender/collada/ArmatureExporter.cpp | 12 | ||||
-rw-r--r-- | source/blender/collada/ArmatureImporter.cpp | 14 | ||||
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 6 | ||||
-rw-r--r-- | source/blender/collada/MeshImporter.cpp | 2 | ||||
-rw-r--r-- | source/blender/collada/SkinInfo.cpp | 4 | ||||
-rw-r--r-- | source/blender/collada/SkinInfo.h | 2 |
8 files changed, 39 insertions, 39 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 3c90c5ad055..3e40afadd99 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -371,7 +371,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B } if (!(fcu)) return; - bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name); + bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, bone->name); if (!pchan) return; @@ -379,7 +379,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B if (flag & ARM_RESTPOS) { arm->flag &= ~ARM_RESTPOS; - where_is_pose(scene, ob_arm); + BKE_pose_where_is(scene, ob_arm); } if (fra.size()) { @@ -388,7 +388,7 @@ void AnimationExporter::sample_and_write_bone_animation_matrix(Object *ob_arm, B if (flag & ARM_RESTPOS) arm->flag = flag; - where_is_pose(scene, ob_arm); + BKE_pose_where_is(scene, ob_arm); } void AnimationExporter::dae_baked_animation(std::vector<float> &fra, Object *ob_arm, Bone *bone) @@ -739,7 +739,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj bPoseChannel *pchan = NULL; bPose *pose = ob_arm->pose; - pchan = get_pose_channel(pose, bone->name); + pchan = BKE_pose_channel_find_name(pose, bone->name); if (!pchan) return ""; @@ -756,7 +756,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj float ctime = BKE_scene_frame_get_from_ctime(scene, *it); 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); + BKE_pose_where_is_bone(scene, ob_arm, pchan, ctime, 1); // compute bone local mat if (bone->parent) { @@ -1206,7 +1206,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo BLI_snprintf(prefix, sizeof(prefix), "pose.bones[\"%s\"]", bone->name); - bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name); + bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, bone->name); if (!pchan) return; //Fill frame array with key frame values framed at \param:transform_type @@ -1227,7 +1227,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo // exit rest position if (flag & ARM_RESTPOS) { arm->flag &= ~ARM_RESTPOS; - where_is_pose(scene, ob_arm); + BKE_pose_where_is(scene, ob_arm); } //v array will hold all values which will be exported. if (fra.size()) { @@ -1257,7 +1257,7 @@ void AnimationExporter::sample_and_write_bone_animation(Object *ob_arm, Bone *bo // restore restpos if (flag & ARM_RESTPOS) arm->flag = flag; - where_is_pose(scene, ob_arm); + BKE_pose_where_is(scene, ob_arm); } void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, int type, Bone *bone, Object *ob_arm, bPoseChannel *pchan) @@ -1265,7 +1265,7 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i bPoseChannel *parchan = NULL; bPose *pose = ob_arm->pose; - pchan = get_pose_channel(pose, bone->name); + pchan = BKE_pose_channel_find_name(pose, bone->name); if (!pchan) return; @@ -1282,7 +1282,7 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i 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); + BKE_pose_where_is_bone(scene, ob_arm, pchan, ctime, 1); // compute bone local mat if (bone->parent) { diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index d6b6bfeb73d..195057817dd 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -206,7 +206,7 @@ void AnimationImporter::add_fcurves_to_object(Object *ob, std::vector<FCurve*>& if (bone_name) { /* try to find group */ - grp = action_groups_find_named(act, bone_name); + grp = BKE_action_group_find_name(act, bone_name); /* no matching groups, so add one */ if (grp == NULL) { @@ -361,7 +361,7 @@ virtual void AnimationImporter::change_eul_to_quat(Object *ob, bAction *act) create_fcurve(3, rna_path) }; - bPoseChannel *chan = get_pose_channel(ob->pose, grp->name); + bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, grp->name); float m4[4][4], irest[3][3]; invert_m4_m4(m4, chan->bone->arm_mat); @@ -670,7 +670,7 @@ void AnimationImporter::apply_matrix_curves( Object * ob, std::vector<FCurve*>& get_joint_rest_mat(irest_dae, root, node); invert_m4(irest_dae); - Bone *bone = get_named_bone((bArmature*)ob->data, bone_name); + Bone *bone = BKE_armature_find_bone_name((bArmature*)ob->data, bone_name); if (!bone) { fprintf(stderr, "cannot find bone \"%s\"\n", bone_name); return; @@ -784,7 +784,7 @@ void AnimationImporter::apply_matrix_curves( Object * ob, std::vector<FCurve*>& } if (is_joint) { - bPoseChannel *chan = get_pose_channel(ob->pose, bone_name); + bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, bone_name); chan->rotmode = ROT_MODE_QUAT; } else { @@ -1025,7 +1025,7 @@ void AnimationImporter::add_bone_animation_sampled(Object * ob, std::vector<FCur get_joint_rest_mat(irest_dae, root, node); invert_m4(irest_dae); - Bone *bone = get_named_bone((bArmature*)ob->data, bone_name); + Bone *bone = BKE_armature_find_bone_name((bArmature*)ob->data, bone_name); if (!bone) { fprintf(stderr, "cannot find bone \"%s\"\n", bone_name); return; @@ -1123,7 +1123,7 @@ void AnimationImporter::add_bone_animation_sampled(Object * ob, std::vector<FCur add_bone_fcurve(ob, node, newcu[i]); } - bPoseChannel *chan = get_pose_channel(ob->pose, bone_name); + bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, bone_name); chan->rotmode = ROT_MODE_QUAT; } @@ -1307,7 +1307,7 @@ Object *AnimationImporter::translate_animation_OLD(COLLADAFW::Node *node, get_joint_rest_mat(irest_dae, root, node); invert_m4(irest_dae); - Bone *bone = get_named_bone((bArmature*)ob->data, bone_name); + Bone *bone = BKE_armature_find_bone_name((bArmature*)ob->data, bone_name); if (!bone) { fprintf(stderr, "cannot find bone \"%s\"\n", bone_name); return NULL; @@ -1515,7 +1515,7 @@ Object *AnimationImporter::translate_animation_OLD(COLLADAFW::Node *node, if (is_rotation || is_matrix) { if (is_joint) { - bPoseChannel *chan = get_pose_channel(ob->pose, bone_name); + bPoseChannel *chan = BKE_pose_channel_find_name(ob->pose, bone_name); chan->rotmode = ROT_MODE_QUAT; } else { @@ -1849,7 +1849,7 @@ void AnimationImporter::add_bone_fcurve(Object *ob, COLLADAFW::Node *node, FCurv bAction *act = ob->adt->action; /* try to find group */ - bActionGroup *grp = action_groups_find_named(act, bone_name); + bActionGroup *grp = BKE_action_group_find_name(act, bone_name); /* no matching groups, so add one */ if (grp == NULL) { diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp index d5a3b4cb0a2..38a5e9b5df4 100644 --- a/source/blender/collada/ArmatureExporter.cpp +++ b/source/blender/collada/ArmatureExporter.cpp @@ -251,13 +251,13 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene* sce, }*/ void ArmatureExporter::add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW::Node& node) { - bPoseChannel *pchan = get_pose_channel(ob_arm->pose, bone->name); + bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, bone->name); float mat[4][4]; if (bone->parent) { // get bone-space matrix from armature-space - bPoseChannel *parchan = get_pose_channel(ob_arm->pose, bone->parent->name); + bPoseChannel *parchan = BKE_pose_channel_find_name(ob_arm->pose, bone->parent->name); float invpar[4][4]; invert_m4_m4(invpar, parchan->pose_mat); @@ -481,12 +481,12 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase // put armature in rest position if (!(arm->flag & ARM_RESTPOS)) { arm->flag |= ARM_RESTPOS; - where_is_pose(scene, ob_arm); + BKE_pose_where_is(scene, ob_arm); } for (bDeformGroup *def = (bDeformGroup*)defbase->first; def; def = def->next) { if (is_bone_defgroup(ob_arm, def)) { - bPoseChannel *pchan = get_pose_channel(pose, def->name); + bPoseChannel *pchan = BKE_pose_channel_find_name(pose, def->name); float mat[4][4]; float world[4][4]; @@ -515,7 +515,7 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase // back from rest positon if (!(flag & ARM_RESTPOS)) { arm->flag = flag; - where_is_pose(scene, ob_arm); + BKE_pose_where_is(scene, ob_arm); } source.finish(); @@ -525,7 +525,7 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase Bone *ArmatureExporter::get_bone_from_defgroup(Object *ob_arm, bDeformGroup* def) { - bPoseChannel *pchan = get_pose_channel(ob_arm->pose, def->name); + bPoseChannel *pchan = BKE_pose_channel_find_name(ob_arm->pose, def->name); return pchan ? pchan->bone : NULL; } diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp index 4316edf1e67..97de7590d07 100644 --- a/source/blender/collada/ArmatureImporter.cpp +++ b/source/blender/collada/ArmatureImporter.cpp @@ -321,7 +321,7 @@ void ArmatureImporter::set_leaf_bone_shapes(Object *ob_arm) for (it = leaf_bones.begin(); it != leaf_bones.end(); it++) { LeafBone& leaf = *it; - bPoseChannel *pchan = get_pose_channel(pose, leaf.name); + bPoseChannel *pchan = BKE_pose_channel_find_name(pose, leaf.name); if (pchan) { pchan->custom = get_empty_for_leaves(); } @@ -499,7 +499,7 @@ void ArmatureImporter::create_armature_bones(SkinInfo& skin) std::map<COLLADAFW::UniqueId, SkinInfo>::iterator it; for (it = skin_by_data_uid.begin(); it != skin_by_data_uid.end(); it++) { SkinInfo *b = &it->second; - if (b == a || b->get_armature() == NULL) + if (b == a || b->BKE_armature_from_object() == NULL) continue; skin_root_joints.clear(); @@ -509,7 +509,7 @@ void ArmatureImporter::create_armature_bones(SkinInfo& skin) std::vector<COLLADAFW::Node*>::iterator ri; for (ri = skin_root_joints.begin(); ri != skin_root_joints.end(); ri++) { if (a->uses_joint_or_descendant(*ri)) { - shared = b->get_armature(); + shared = b->BKE_armature_from_object(); break; } } @@ -582,13 +582,13 @@ void ArmatureImporter::set_pose(Object * ob_arm, COLLADAFW::Node * root_node, c get_node_mat(obmat, root_node, NULL, NULL); //if (*edbone) - bPoseChannel * pchan = get_pose_channel(ob_arm -> pose, bone_name); + bPoseChannel * pchan = BKE_pose_channel_find_name(ob_arm -> pose, bone_name); //else fprintf ( "", // get world-space if (parentname) { mult_m4_m4m4(mat, parent_mat, obmat); - bPoseChannel *parchan = get_pose_channel(ob_arm->pose, parentname); + bPoseChannel *parchan = BKE_pose_channel_find_name(ob_arm->pose, parentname); mult_m4_m4m4(pchan->pose_mat, parchan->pose_mat, mat ); @@ -660,7 +660,7 @@ void ArmatureImporter::make_armatures(bContext *C) // set armature parent if any Object *par = skin.get_parent(); if (par) - bc_set_parent(skin.get_armature(), par, C, false); + bc_set_parent(skin.BKE_armature_from_object(), par, C, false); // free memory stolen from SkinControllerData skin.free(); @@ -761,7 +761,7 @@ Object *ArmatureImporter::get_armature_for_joint(COLLADAFW::Node *node) SkinInfo& skin = it->second; if (skin.uses_joint_or_descendant(node)) - return skin.get_armature(); + return skin.BKE_armature_from_object(); } std::map<COLLADAFW::UniqueId, Object*>::iterator arm; diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index 98a30fbef74..6dca7828cc2 100644 --- a/source/blender/collada/DocumentImporter.cpp +++ b/source/blender/collada/DocumentImporter.cpp @@ -572,7 +572,7 @@ bool DocumentImporter::writeMaterial( const COLLADAFW::Material* cmat ) return true; const std::string& str_mat_id = cmat->getName().size() ? cmat->getName() : cmat->getOriginalId(); - Material *ma = add_material((char*)str_mat_id.c_str()); + Material *ma = BKE_material_add((char*)str_mat_id.c_str()); this->uid_effect_map[cmat->getInstantiatedEffect()] = ma; this->uid_material_map[cmat->getUniqueId()] = ma; @@ -949,8 +949,8 @@ bool DocumentImporter::writeLight( const COLLADAFW::Light* light ) la_id = light->getOriginalId(); la_name = light->getName(); - if (la_name.size()) lamp = (Lamp*)add_lamp((char*)la_name.c_str()); - else lamp = (Lamp*)add_lamp((char*)la_id.c_str()); + if (la_name.size()) lamp = (Lamp*)BKE_lamp_add((char*)la_name.c_str()); + else lamp = (Lamp*)BKE_lamp_add((char*)la_id.c_str()); if (!lamp) { fprintf(stderr, "Cannot create lamp.\n"); diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index c20975145ac..ca1f2d2f1be 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -962,7 +962,7 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry* geom) } const std::string& str_geom_id = mesh->getName().size() ? mesh->getName() : mesh->getOriginalId(); - Mesh *me = add_mesh((char*)str_geom_id.c_str()); + Mesh *me = BKE_mesh_add((char*)str_geom_id.c_str()); me->id.us--; // is already 1 here, but will be set later in set_mesh // store the Mesh pointer to link it later with an Object diff --git a/source/blender/collada/SkinInfo.cpp b/source/blender/collada/SkinInfo.cpp index d807b049152..f7cb7dc96c2 100644 --- a/source/blender/collada/SkinInfo.cpp +++ b/source/blender/collada/SkinInfo.cpp @@ -178,7 +178,7 @@ bool SkinInfo::get_joint_inv_bind_matrix(float inv_bind_mat[][4], COLLADAFW::Nod return false; } -Object *SkinInfo::get_armature() +Object *SkinInfo::BKE_armature_from_object() { return ob_arm; } @@ -288,7 +288,7 @@ void SkinInfo::link_armature(bContext *C, Object *ob, std::map<COLLADAFW::Unique bPoseChannel *SkinInfo::get_pose_channel_from_node(COLLADAFW::Node *node) { - return get_pose_channel(ob_arm->pose, bc_get_joint_name(node)); + return BKE_pose_channel_find_name(ob_arm->pose, bc_get_joint_name(node)); } void SkinInfo::set_parent(Object *_parent) diff --git a/source/blender/collada/SkinInfo.h b/source/blender/collada/SkinInfo.h index 7befe7168d3..894f53f07c3 100644 --- a/source/blender/collada/SkinInfo.h +++ b/source/blender/collada/SkinInfo.h @@ -105,7 +105,7 @@ public: bool get_joint_inv_bind_matrix(float inv_bind_mat[][4], COLLADAFW::Node *node); - Object *get_armature(); + Object *BKE_armature_from_object(); const COLLADAFW::UniqueId& get_controller_uid(); |