Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-05 20:03:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-05 20:03:57 +0400
commit1dccd4c98a4909383b9c11f7c2ee987e22833dad (patch)
tree3d127436243536d6ceaba4cb884249156ba215cd /source/blender/editors
parentff4ff9c8a429d9869e7056417bc7acd47a545eb2 (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/editors')
-rw-r--r--source/blender/editors/animation/anim_deps.c4
-rw-r--r--source/blender/editors/animation/anim_filter.c2
-rw-r--r--source/blender/editors/animation/keyframing.c2
-rw-r--r--source/blender/editors/animation/keyingsets.c6
-rw-r--r--source/blender/editors/armature/editarmature.c48
-rw-r--r--source/blender/editors/armature/poseUtils.c2
-rw-r--r--source/blender/editors/armature/poselib.c12
-rw-r--r--source/blender/editors/armature/poseobject.c32
-rw-r--r--source/blender/editors/include/ED_keyframing.h2
-rw-r--r--source/blender/editors/interface/interface_templates.c4
-rw-r--r--source/blender/editors/mesh/editface.c22
-rw-r--r--source/blender/editors/mesh/mesh_data.c2
-rw-r--r--source/blender/editors/object/object_add.c6
-rw-r--r--source/blender/editors/object/object_constraint.c30
-rw-r--r--source/blender/editors/object/object_hook.c2
-rw-r--r--source/blender/editors/object/object_lattice.c4
-rw-r--r--source/blender/editors/object/object_modifier.c2
-rw-r--r--source/blender/editors/object/object_relations.c6
-rw-r--r--source/blender/editors/object/object_select.c2
-rw-r--r--source/blender/editors/object/object_transform.c8
-rw-r--r--source/blender/editors/render/render_opengl.c4
-rw-r--r--source/blender/editors/render/render_shading.c2
-rw-r--r--source/blender/editors/screen/screen_context.c2
-rw-r--r--source/blender/editors/screen/screendump.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c8
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c28
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c6
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c2
-rw-r--r--source/blender/editors/space_image/image_buttons.c4
-rw-r--r--source/blender/editors/space_image/image_ops.c14
-rw-r--r--source/blender/editors/space_image/space_image.c2
-rw-r--r--source/blender/editors/space_logic/logic_window.c2
-rw-r--r--source/blender/editors/space_node/drawnode.c2
-rw-r--r--source/blender/editors/space_node/node_edit.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c20
-rw-r--r--source/blender/editors/space_view3d/drawanimviz.c2
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c32
-rw-r--r--source/blender/editors/space_view3d/drawobject.c4
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c2
-rw-r--r--source/blender/editors/transform/transform_conversions.c12
-rw-r--r--source/blender/editors/transform/transform_generics.c2
-rw-r--r--source/blender/editors/transform/transform_manipulator.c2
47 files changed, 185 insertions, 185 deletions
diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c
index b449c11ff7b..5b8e696f05a 100644
--- a/source/blender/editors/animation/anim_deps.c
+++ b/source/blender/editors/animation/anim_deps.c
@@ -144,7 +144,7 @@ static void animchan_sync_group (bAnimContext *UNUSED(ac), bAnimListElem *ale)
* NOTE: this feature will only really work if groups by default contain the F-Curves for a single bone
*/
if (ob->pose) {
- bPoseChannel *pchan= get_pose_channel(ob->pose, agrp->name);
+ bPoseChannel *pchan= BKE_pose_channel_find_name(ob->pose, agrp->name);
/* if one matches, sync the selection status */
if (pchan) {
@@ -179,7 +179,7 @@ static void animchan_sync_fcurve (bAnimContext *UNUSED(ac), bAnimListElem *ale)
/* get bone-name, and check if this bone is selected */
bone_name= BLI_getQuotedStr(fcu->rna_path, "pose.bones[");
- pchan= get_pose_channel(ob->pose, bone_name);
+ pchan= BKE_pose_channel_find_name(ob->pose, bone_name);
if (bone_name) MEM_freeN(bone_name);
/* F-Curve selection depends on whether the bone is selected */
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index cc3401da6c5..180953ea017 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -842,7 +842,7 @@ static short skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_
/* get bone-name, and check if this bone is selected */
bone_name= BLI_getQuotedStr(fcu->rna_path, "pose.bones[");
- pchan= get_pose_channel(ob->pose, bone_name);
+ pchan= BKE_pose_channel_find_name(ob->pose, bone_name);
if (bone_name) MEM_freeN(bone_name);
/* check whether to continue or skip */
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 9d51b42f1a2..281a3e110bb 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -183,7 +183,7 @@ FCurve *verify_fcurve (bAction *act, const char group[], const char rna_path[],
/* if a group name has been provided, try to add or find a group, then add F-Curve to it */
if (group) {
/* try to find group */
- grp= action_groups_find_named(act, group);
+ grp= BKE_action_group_find_name(act, group);
/* no matching groups, so add one */
if (grp == NULL)
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 925cffca288..8f2a228ffef 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -531,7 +531,7 @@ ListBase builtin_keyingsets = {NULL, NULL};
/* --------------- */
/* Find KeyingSet type info given a name */
-KeyingSetInfo *ANIM_keyingset_info_find_named (const char name[])
+KeyingSetInfo *ANIM_keyingset_info_find_name (const char name[])
{
/* sanity checks */
if ((name == NULL) || (name[0] == 0))
@@ -786,7 +786,7 @@ EnumPropertyItem *ANIM_keying_sets_enum_itemf (bContext *C, PointerRNA *UNUSED(p
short ANIM_keyingset_context_ok_poll(bContext *C, KeyingSet *ks)
{
if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) {
- KeyingSetInfo *ksi = ANIM_keyingset_info_find_named(ks->typeinfo);
+ KeyingSetInfo *ksi = ANIM_keyingset_info_find_name(ks->typeinfo);
/* get the associated 'type info' for this KeyingSet */
if (ksi == NULL)
@@ -868,7 +868,7 @@ short ANIM_validate_keyingset(bContext *C, ListBase *dsources, KeyingSet *ks)
/* if relative Keying Sets, poll and build up the paths */
if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) {
- KeyingSetInfo *ksi = ANIM_keyingset_info_find_named(ks->typeinfo);
+ KeyingSetInfo *ksi = ANIM_keyingset_info_find_name(ks->typeinfo);
/* clear all existing paths
* NOTE: BKE_keyingset_free() frees all of the paths for the KeyingSet, but not the set itself
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 5c43ba6e67f..44dfcaacbfc 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -340,7 +340,7 @@ static void fix_bonelist_roll (ListBase *bonelist, ListBase *editbonelist)
for (curBone=bonelist->first; curBone; curBone=curBone->next) {
/* sets local matrix and arm_mat (restpos) */
- where_is_armature_bone(curBone, curBone->parent);
+ BKE_armature_where_is_bone(curBone, curBone->parent);
/* Find the associated editbone */
for (ebone = editbonelist->first; ebone; ebone=ebone->next)
@@ -367,7 +367,7 @@ static void fix_bonelist_roll (ListBase *bonelist, ListBase *editbonelist)
curBone->roll = (float)-atan2(difmat[2][0], difmat[2][2]);
/* and set restposition again */
- where_is_armature_bone(curBone, curBone->parent);
+ BKE_armature_where_is_bone(curBone, curBone->parent);
}
fix_bonelist_roll(&curBone->childbase, editbonelist);
}
@@ -382,7 +382,7 @@ void ED_armature_from_edit(Object *obedit)
Object *obt;
/* armature bones */
- free_bonelist(&arm->bonebase);
+ BKE_armature_bonelist_free(&arm->bonebase);
/* remove zero sized bones, this gives instable restposes */
for (eBone=arm->edbo->first; eBone; eBone= neBone) {
@@ -476,13 +476,13 @@ void ED_armature_from_edit(Object *obedit)
}
/* Make a pass through the new armature to fix rolling */
- /* also builds restposition again (like where_is_armature) */
+ /* also builds restposition again (like BKE_armature_where_is) */
fix_bonelist_roll(&arm->bonebase, arm->edbo);
/* so all users of this armature should get rebuilt */
for (obt= G.main->object.first; obt; obt= obt->id.next) {
if (obt->data==arm)
- armature_rebuild_pose(obt, arm);
+ BKE_pose_rebuild(obt, arm);
}
DAG_id_tag_update(&obedit->id, OB_RECALC_DATA);
@@ -645,7 +645,7 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op)
{
Scene *scene= CTX_data_scene(C);
Object *ob= BKE_object_pose_armature_get(CTX_data_active_object(C)); // must be active object, not edit-object
- bArmature *arm= get_armature(ob);
+ bArmature *arm= BKE_armature_from_object(ob);
bPose *pose;
bPoseChannel *pchan;
EditBone *curbone;
@@ -716,7 +716,7 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op)
ED_armature_edit_free(ob);
/* flush positions of posebones */
- where_is_pose(scene, ob);
+ BKE_pose_where_is(scene, ob);
/* fix parenting of objects which are bone-parented */
applyarmature_fix_boneparents(scene, ob);
@@ -766,7 +766,7 @@ static int pose_visual_transform_apply_exec (bContext *C, wmOperator *UNUSED(op)
* change, thus changing the result we may be trying to record.
*/
copy_m4_m4(delta_mat, pchan->chan_mat);
- pchan_apply_mat4(pchan, delta_mat, TRUE);
+ BKE_pchan_apply_mat4(pchan, delta_mat, TRUE);
}
CTX_DATA_END;
@@ -991,8 +991,8 @@ int join_armature_exec(bContext *C, wmOperator *UNUSED(op))
BLI_remlink(&opose->chanbase, pchan);
BLI_addtail(&pose->chanbase, pchan);
- free_pose_channels_hash(opose);
- free_pose_channels_hash(pose);
+ BKE_pose_channels_hash_free(opose);
+ BKE_pose_channels_hash_free(pose);
}
ED_base_object_free_and_unlink(bmain, scene, base);
@@ -1155,8 +1155,8 @@ static void separate_armature_bones(Object *ob, short sel)
}
/* free any of the extra-data this pchan might have */
- free_pose_channel(pchan);
- free_pose_channels_hash(ob->pose);
+ BKE_pose_channel_free(pchan);
+ BKE_pose_channels_hash_free(ob->pose);
/* get rid of unneeded bone */
bone_free(arm, curbone);
@@ -1694,8 +1694,8 @@ static int armature_delete_selected_exec(bContext *C, wmOperator *UNUSED(op))
curBone = editbone_name_exists(arm->edbo, pchan->name);
if (curBone && (curBone->flag & BONE_SELECTED) && (arm->layer & curBone->layer)) {
- free_pose_channel(pchan);
- free_pose_channels_hash(obedit->pose);
+ BKE_pose_channel_free(pchan);
+ BKE_pose_channels_hash_free(obedit->pose);
BLI_freelinkN (&obedit->pose->chanbase, pchan);
}
else {
@@ -2481,7 +2481,7 @@ void updateDuplicateSubtargetObjects(EditBone *dupBone, ListBase *editbones, Obj
bConstraint *curcon;
ListBase *conlist;
- if ( (pchan = verify_pose_channel(dst_ob->pose, dupBone->name)) ) {
+ if ( (pchan = BKE_pose_channel_verify(dst_ob->pose, dupBone->name)) ) {
if ( (conlist = &pchan->constraints) ) {
for (curcon = conlist->first; curcon; curcon=curcon->next) {
/* does this constraint have a subtarget in
@@ -2552,15 +2552,15 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase
if (src_ob->pose) {
bPoseChannel *chanold, *channew;
- chanold = verify_pose_channel(src_ob->pose, curBone->name);
+ chanold = BKE_pose_channel_verify(src_ob->pose, curBone->name);
if (chanold) {
/* WARNING: this creates a new posechannel, but there will not be an attached bone
* yet as the new bones created here are still 'EditBones' not 'Bones'.
*/
- channew= verify_pose_channel(dst_ob->pose, eBone->name);
+ channew= BKE_pose_channel_verify(dst_ob->pose, eBone->name);
if (channew) {
- duplicate_pose_channel_data(channew, chanold);
+ BKE_pose_channel_copy_data(channew, chanold);
}
}
}
@@ -4611,7 +4611,7 @@ static int bone_skinnable_cb(Object *ob, Bone *bone, void *datap)
if (!(ob->mode & OB_MODE_WEIGHT_PAINT) || !(bone->flag & BONE_HIDDEN_P)) {
if (!(bone->flag & BONE_NO_DEFORM)) {
- if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
+ if (data->heat && data->armob->pose && BKE_pose_channel_find_name(data->armob->pose, bone->name))
segments = bone->segments;
else
segments = 1;
@@ -4678,7 +4678,7 @@ static int dgroup_skinnable_cb(Object *ob, Bone *bone, void *datap)
if (!wpmode || !(bone->flag & BONE_HIDDEN_P)) {
if (!(bone->flag & BONE_NO_DEFORM)) {
- if (data->heat && data->armob->pose && get_pose_channel(data->armob->pose, bone->name))
+ if (data->heat && data->armob->pose && BKE_pose_channel_find_name(data->armob->pose, bone->name))
segments = bone->segments;
else
segments = 1;
@@ -4821,7 +4821,7 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
segments = 1;
bbone = NULL;
- if ((par->pose) && (pchan=get_pose_channel(par->pose, bone->name))) {
+ if ((par->pose) && (pchan=BKE_pose_channel_find_name(par->pose, bone->name))) {
if (bone->segments > 1) {
segments = bone->segments;
bbone = b_bone_spline_setup(pchan, 1);
@@ -5447,7 +5447,7 @@ void POSE_OT_reveal(wmOperatorType *ot)
static int bone_unique_check(void *arg, const char *name)
{
- return get_named_bone((bArmature *)arg, name) != NULL;
+ return BKE_armature_find_bone_name((bArmature *)arg, name) != NULL;
}
static void unique_bone_name(bArmature *arm, char *name)
@@ -5509,7 +5509,7 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
else return;
}
else {
- Bone *bone= get_named_bone(arm, oldname);
+ Bone *bone= BKE_armature_find_bone_name(arm, oldname);
if (bone) {
unique_bone_name(arm, newname);
@@ -5528,7 +5528,7 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
/* Rename the pose channel, if it exists */
if (ob->pose) {
- bPoseChannel *pchan = get_pose_channel(ob->pose, oldname);
+ bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, oldname);
if (pchan) {
BLI_strncpy(pchan->name, newname, MAXBONENAME);
diff --git a/source/blender/editors/armature/poseUtils.c b/source/blender/editors/armature/poseUtils.c
index 3c855ff96e6..3b613a6d25c 100644
--- a/source/blender/editors/armature/poseUtils.c
+++ b/source/blender/editors/armature/poseUtils.c
@@ -189,7 +189,7 @@ void poseAnim_mapping_refresh(bContext *C, Scene *scene, Object *ob)
if ((arm->flag & ARM_DELAYDEFORM)==0)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA); /* sets recalc flags */
else
- where_is_pose(scene, ob);
+ BKE_pose_where_is(scene, ob);
/* note, notifier might evolve */
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob);
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index 3b01ba20dd5..f180f735294 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -786,7 +786,7 @@ static void poselib_backup_posecopy (tPoseLib_PreviewData *pld)
/* for each posechannel that has an actionchannel in */
for (agrp= pld->act->groups.first; agrp; agrp= agrp->next) {
/* try to find posechannel */
- pchan= get_pose_channel(pld->pose, agrp->name);
+ pchan= BKE_pose_channel_find_name(pld->pose, agrp->name);
/* backup data if available */
if (pchan) {
@@ -885,7 +885,7 @@ static void poselib_apply_pose (tPoseLib_PreviewData *pld)
/* check if group has any keyframes */
if (ANIM_animchanneldata_keyframes_loop(&ked, NULL, agrp, ALE_GROUP, NULL, group_ok_cb, NULL)) {
/* has keyframe on this frame, so try to get a PoseChannel with this name */
- pchan= get_pose_channel(pose, agrp->name);
+ pchan= BKE_pose_channel_find_name(pose, agrp->name);
if (pchan) {
short ok= 0;
@@ -927,7 +927,7 @@ static void poselib_keytag_pose (bContext *C, Scene *scene, tPoseLib_PreviewData
/* start tagging/keying */
for (agrp= act->groups.first; agrp; agrp= agrp->next) {
/* only for selected bones unless there aren't any selected, in which case all are included */
- pchan= get_pose_channel(pose, agrp->name);
+ pchan= BKE_pose_channel_find_name(pose, agrp->name);
if (pchan) {
if ( (pld->selcount == 0) || ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) ) {
@@ -987,7 +987,7 @@ static void poselib_preview_apply (bContext *C, wmOperator *op)
if ((pld->arm->flag & ARM_DELAYDEFORM)==0)
DAG_id_tag_update(&pld->ob->id, OB_RECALC_DATA); /* sets recalc flags */
else
- where_is_pose(pld->scene, pld->ob);
+ BKE_pose_where_is(pld->scene, pld->ob);
}
/* do header print - if interactively previewing */
@@ -1495,7 +1495,7 @@ static void poselib_preview_cleanup (bContext *C, wmOperator *op)
if ((arm->flag & ARM_DELAYDEFORM)==0)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA); /* sets recalc flags */
else
- where_is_pose(scene, ob);
+ BKE_pose_where_is(scene, ob);
}
else if (pld->state == PL_PREVIEW_CONFIRM) {
@@ -1514,7 +1514,7 @@ static void poselib_preview_cleanup (bContext *C, wmOperator *op)
//remake_action_ipos(ob->action);
}
else
- where_is_pose(scene, ob);
+ BKE_pose_where_is(scene, ob);
}
/* free memory used for backups and searching */
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index 95e7a845a78..15d2d32c073 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -164,7 +164,7 @@ static int pose_channel_in_IK_chain(Object *ob, bPoseChannel *pchan, int level)
}
}
for (bone= pchan->bone->childbase.first; bone; bone= bone->next) {
- pchan= get_pose_channel(ob->pose, bone->name);
+ pchan= BKE_pose_channel_find_name(ob->pose, bone->name);
if (pchan && pose_channel_in_IK_chain(ob, pchan, level + 1))
return 1;
}
@@ -371,7 +371,7 @@ static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op
for (ct= targets.first; ct; ct= ct->next) {
if ((ct->tar == ob) && (ct->subtarget[0])) {
- bPoseChannel *pchanc= get_pose_channel(ob->pose, ct->subtarget);
+ bPoseChannel *pchanc= BKE_pose_channel_find_name(ob->pose, ct->subtarget);
if ((pchanc) && !(pchanc->bone->flag & BONE_UNSELECTABLE)) {
pchanc->bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL;
found= 1;
@@ -650,7 +650,7 @@ static int pose_select_same_keyingset(bContext *C, Object *ob, short extend)
char *boneName = BLI_getQuotedStr(ksp->rna_path, "bones[");
if (boneName) {
- bPoseChannel *pchan = get_pose_channel(pose, boneName);
+ bPoseChannel *pchan = BKE_pose_channel_find_name(pose, boneName);
if (pchan) {
/* select if bone is visible and can be affected */
@@ -751,7 +751,7 @@ static int pose_bone_flip_active_exec (bContext *C, wmOperator *UNUSED(op))
char name[MAXBONENAME];
flip_side_name(name, arm->act_bone->name, TRUE);
- pchanf= get_pose_channel(ob->pose, name);
+ pchanf= BKE_pose_channel_find_name(ob->pose, name);
if (pchanf && pchanf->bone != arm->act_bone) {
arm->act_bone->flag &= ~BONE_SELECTED;
pchanf->bone->flag |= BONE_SELECTED;
@@ -805,7 +805,7 @@ static void pose_copy_menu(Scene *scene)
if (ELEM(NULL, ob, ob->pose)) return;
if ((ob==obedit) || (ob->mode & OB_MODE_POSE)==0) return;
- pchan= get_active_posechannel(ob);
+ pchan= BKE_pose_channel_active(ob);
if (pchan==NULL) return;
pchanact= pchan;
@@ -891,13 +891,13 @@ static void pose_copy_menu(Scene *scene)
pchan->custom = pchanact->custom;
break;
case 9: /* Visual Location */
- armature_loc_pose_to_bone(pchan, pchanact->pose_mat[3], pchan->loc);
+ BKE_armature_loc_pose_to_bone(pchan, pchanact->pose_mat[3], pchan->loc);
break;
case 10: /* Visual Rotation */
{
float delta_mat[4][4];
- armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
+ BKE_armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
if (pchan->rotmode == ROT_MODE_AXISANGLE) {
float tmp_quat[4];
@@ -916,7 +916,7 @@ static void pose_copy_menu(Scene *scene)
{
float delta_mat[4][4], size[4];
- armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
+ BKE_armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
mat4_to_size(size, delta_mat);
copy_v3_v3(pchan->size, size);
}
@@ -978,7 +978,7 @@ static void pose_copy_menu(Scene *scene)
}
}
BLI_freelistN(&const_copy);
- update_pose_constraint_flags(ob->pose); /* we could work out the flags but its simpler to do this */
+ BKE_pose_update_constraint_flags(ob->pose); /* we could work out the flags but its simpler to do this */
if (ob->pose)
ob->pose->flag |= POSE_RECALC;
@@ -1059,7 +1059,7 @@ static bPoseChannel *pose_bone_do_paste (Object *ob, bPoseChannel *chan, short s
* 1) channel exists - poses are not meant to add random channels to anymore
* 2) if selection-masking is on, channel is selected - only selected bones get pasted on, allowing making both sides symmetrical
*/
- pchan= get_pose_channel(ob->pose, name);
+ pchan= BKE_pose_channel_find_name(ob->pose, name);
if (selOnly)
paste_ok= ((pchan) && (pchan->bone->flag & BONE_SELECTED));
@@ -1176,7 +1176,7 @@ static int pose_copy_exec (bContext *C, wmOperator *op)
/* sets chan->flag to POSE_KEY if bone selected, then copy those bones to the buffer */
set_pose_keys(ob);
- copy_pose(&g_posebuf, ob->pose, 0);
+ BKE_pose_copy_data(&g_posebuf, ob->pose, 0);
return OPERATOR_FINISHED;
@@ -1291,7 +1291,7 @@ static int pose_group_add_exec (bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
/* for now, just call the API function for this */
- pose_add_group(ob);
+ BKE_pose_add_group(ob);
/* notifiers for updates */
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob);
@@ -1331,7 +1331,7 @@ static int pose_group_remove_exec (bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
/* for now, just call the API function for this */
- pose_remove_group(ob);
+ BKE_pose_remove_group(ob);
/* notifiers for updates */
WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob);
@@ -1434,7 +1434,7 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op)
*/
pose->active_group= RNA_int_get(op->ptr, "type");
if (pose->active_group == 0)
- pose_add_group(ob);
+ BKE_pose_add_group(ob);
/* add selected bones to group then */
CTX_DATA_BEGIN (C, bPoseChannel*, pchan, selected_pose_bones)
@@ -2281,7 +2281,7 @@ static int pose_clear_user_transforms_exec (bContext *C, wmOperator *UNUSED(op))
bPoseChannel *pchan;
/* execute animation step for current frame using a dummy copy of the pose */
- copy_pose(&dummyPose, ob->pose, 0);
+ BKE_pose_copy_data(&dummyPose, ob->pose, 0);
BLI_strncpy(workob.id.name, "OB<ClearTfmWorkOb>", sizeof(workob.id.name));
workob.type = OB_ARMATURE;
@@ -2314,7 +2314,7 @@ static int pose_clear_user_transforms_exec (bContext *C, wmOperator *UNUSED(op))
/* no animation, so just reset whole pose to rest pose
* (cannot just restore for selected though)
*/
- rest_pose(ob->pose);
+ BKE_pose_rest(ob->pose);
}
/* notifiers and updates */
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index 3795de7469c..490a8830d3a 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -190,7 +190,7 @@ int ANIM_apply_keyingset(struct bContext *C, ListBase *dsources, struct bAction
struct KeyingSet *ANIM_builtin_keyingset_get_named(struct KeyingSet *prevKS, const char name[]);
/* Find KeyingSet type info given a name */
-KeyingSetInfo *ANIM_keyingset_info_find_named(const char name[]);
+KeyingSetInfo *ANIM_keyingset_info_find_name(const char name[]);
/* for RNA type registrations... */
void ANIM_keyingset_info_register(KeyingSetInfo *ksi);
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 149921c94b2..1c0a98eda6e 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -953,7 +953,7 @@ static void do_constraint_panels(bContext *C, void *ob_pt, int event)
// if there are problems because of this, then rna needs changed update functions.
//
// object_test_constraints(ob);
- // if (ob->pose) update_pose_constraint_flags(ob->pose);
+ // if (ob->pose) BKE_pose_update_constraint_flags(ob->pose);
if (ob->type == OB_ARMATURE) DAG_id_tag_update(&ob->id, OB_RECALC_DATA | OB_RECALC_OB);
else DAG_id_tag_update(&ob->id, OB_RECALC_OB);
@@ -969,7 +969,7 @@ static void constraint_active_func(bContext *UNUSED(C), void *ob_v, void *con_v)
/* draw panel showing settings for a constraint */
static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
{
- bPoseChannel *pchan = get_active_posechannel(ob);
+ bPoseChannel *pchan = BKE_pose_channel_active(ob);
bConstraintTypeInfo *cti;
uiBlock *block;
uiLayout *result = NULL, *col, *box, *row;
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index cfc9e11879e..5f6384d6b24 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -67,7 +67,7 @@
* use in object mode when selecting faces (while painting) */
void paintface_flush_flags(Object *ob)
{
- Mesh *me = get_mesh(ob);
+ Mesh *me = BKE_mesh_from_object(ob);
DerivedMesh *dm = ob->derivedFinal;
MPoly *polys, *mp_orig;
MFace *faces;
@@ -166,7 +166,7 @@ void paintface_hide(Object *ob, const int unselected)
MPoly *mpoly;
int a;
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (me == NULL || me->totpoly == 0) return;
mpoly = me->mpoly;
@@ -195,7 +195,7 @@ void paintface_reveal(Object *ob)
MPoly *mpoly;
int a;
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (me == NULL || me->totpoly == 0) return;
mpoly = me->mpoly;
@@ -325,7 +325,7 @@ void paintface_select_linked(bContext *UNUSED(C), Object *ob, int UNUSED(mval[2]
Mesh *me;
unsigned int index = 0;
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (me == NULL || me->totpoly == 0) return;
if (mode == 0 || mode == 1) {
@@ -347,7 +347,7 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags)
MPoly *mpoly;
int a;
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (me == NULL) return;
if (action == SEL_INVERT) {
@@ -410,7 +410,7 @@ int paintface_minmax(Object *ob, float r_min[3], float r_max[3])
int a, b, ok = FALSE;
float vec[3], bmat[3][3];
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (!me || !me->mtpoly) return ok;
copy_m3_m4(bmat, ob->obmat);
@@ -459,7 +459,7 @@ void seam_mark_clear_tface(Scene *scene, short mode)
MEdge *med;
int a, b;
- me = get_mesh(OBACT);
+ me = BKE_mesh_from_object(OBACT);
if (me == 0 || me->totpoly == 0) return;
if (mode == 0)
@@ -516,7 +516,7 @@ int paintface_mouse_select(struct bContext *C, Object *ob, const int mval[2], in
unsigned int a, index;
/* Get the face under the cursor */
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (!facesel_face_pick(C, me, ob, mval, &index, 1))
return 0;
@@ -567,7 +567,7 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
int sx = rect->xmax - rect->xmin + 1;
int sy = rect->ymax - rect->ymin + 1;
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (me == NULL || me->totpoly == 0 || sx * sy <= 0)
return OPERATOR_CANCELLED;
@@ -629,7 +629,7 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, int select, int extend)
* use in object mode when selecting vertices (while painting) */
void paintvert_flush_flags(Object *ob)
{
- Mesh *me = get_mesh(ob);
+ Mesh *me = BKE_mesh_from_object(ob);
DerivedMesh *dm = ob->derivedFinal;
MVert *dm_mvert, *dm_mv;
int *index_array = NULL;
@@ -668,7 +668,7 @@ void paintvert_deselect_all_visible(Object *ob, int action, short flush_flags)
MVert *mvert;
int a;
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (me == NULL) return;
if (action == SEL_INVERT) {
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 042deb3def7..49e472fada4 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -560,7 +560,7 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
else {
RNA_string_get(op->ptr, "name", name);
- ima = (Image *)find_id("IM", name);
+ ima = (Image *)BKE_libblock_find_name("IM", name);
}
if (!ima) {
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 3c19871aac6..40bca557169 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1499,7 +1499,7 @@ static int convert_exec(bContext *C, wmOperator *op)
mb = newob->data;
mb->id.us--;
- newob->data = add_mesh("Mesh");
+ newob->data = BKE_mesh_add("Mesh");
newob->type = OB_MESH;
me = newob->data;
@@ -1761,7 +1761,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base
ID_NEW_US2(obn->data)
else {
obn->data = BKE_armature_copy(obn->data);
- armature_rebuild_pose(obn, obn->data);
+ BKE_pose_rebuild(obn, obn->data);
didit = 1;
}
id->us--;
@@ -1954,7 +1954,7 @@ static int add_named_exec(bContext *C, wmOperator *op)
/* find object, create fake base */
RNA_string_get(op->ptr, "name", name);
- ob = (Object *)find_id("OB", name);
+ ob = (Object *)BKE_libblock_find_name("OB", name);
if (ob == NULL)
return OPERATOR_CANCELLED;
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 60ca674bb8a..ec3360f236b 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -89,7 +89,7 @@ ListBase *get_active_constraints(Object *ob)
if (ob->mode & OB_MODE_POSE) {
bPoseChannel *pchan;
- pchan = get_active_posechannel(ob);
+ pchan = BKE_pose_channel_active(ob);
if (pchan)
return &pchan->constraints;
}
@@ -314,7 +314,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
curcon->flag |= CONSTRAINT_DISABLE;
}
else if (data->tar == owner) {
- if (!get_named_bone(get_armature(owner), data->subtarget)) {
+ if (!BKE_armature_find_bone_name(BKE_armature_from_object(owner), data->subtarget)) {
curcon->flag |= CONSTRAINT_DISABLE;
}
}
@@ -325,7 +325,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
curcon->flag |= CONSTRAINT_DISABLE;
}
else if (data->poletar == owner) {
- if (!get_named_bone(get_armature(owner), data->polesubtarget)) {
+ if (!BKE_armature_find_bone_name(BKE_armature_from_object(owner), data->polesubtarget)) {
curcon->flag |= CONSTRAINT_DISABLE;
}
}
@@ -344,7 +344,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
curcon->flag |= CONSTRAINT_DISABLE;
}
else if (data->tar == owner) {
- if (!get_named_bone(get_armature(owner), data->subtarget)) {
+ if (!BKE_armature_find_bone_name(BKE_armature_from_object(owner), data->subtarget)) {
curcon->flag |= CONSTRAINT_DISABLE;
}
}
@@ -453,7 +453,7 @@ static void test_constraints(Object *owner, bPoseChannel *pchan)
}
else if (ct->tar == owner) {
if (type == CONSTRAINT_OBTYPE_BONE) {
- if (!get_named_bone(get_armature(owner), ct->subtarget)) {
+ if (!BKE_armature_find_bone_name(BKE_armature_from_object(owner), ct->subtarget)) {
/* bone must exist in armature... */
// TODO: clear subtarget?
curcon->flag |= CONSTRAINT_DISABLE;
@@ -585,7 +585,7 @@ static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, int
list = &ob->constraints;
}
else if (owner == EDIT_CONSTRAINT_OWNER_BONE) {
- bPoseChannel *pchan = get_active_posechannel(ob);
+ bPoseChannel *pchan = BKE_pose_channel_active(ob);
if (pchan)
list = &pchan->constraints;
else {
@@ -713,7 +713,7 @@ static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con,
/* try to find a pose channel - assume that this is the constraint owner */
// TODO: get from context instead?
if (ob && ob->pose)
- pchan = get_active_posechannel(ob);
+ pchan = BKE_pose_channel_active(ob);
/* calculate/set inverse matrix:
* We just calculate all transform-stack eval up to but not including this constraint.
@@ -729,7 +729,7 @@ static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con,
* to use as baseline ("pmat") to derive delta from. This extra calc saves users
* from having pressing "Clear Inverse" first
*/
- where_is_pose(scene, ob);
+ BKE_pose_where_is(scene, ob);
copy_m4_m4(pmat, pchan->pose_mat);
/* 2. knock out constraints starting from this one */
@@ -746,7 +746,7 @@ static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con,
}
/* 3. solve pose without disabled constraints */
- where_is_pose(scene, ob);
+ BKE_pose_where_is(scene, ob);
/* 4. determine effect of constraint by removing the newly calculated
* pchan->pose_mat from the original pchan->pose_mat, thus determining
@@ -769,7 +769,7 @@ static void child_get_inverse_matrix(Scene *scene, Object *ob, bConstraint *con,
}
/* 6. recalculate pose with new inv-mat applied */
- where_is_pose(scene, ob);
+ BKE_pose_where_is(scene, ob);
}
else if (ob) {
Object workob;
@@ -977,7 +977,7 @@ void ED_object_constraint_set_active(Object *ob, bConstraint *con)
void ED_object_constraint_update(Object *ob)
{
- if (ob->pose) update_pose_constraint_flags(ob->pose);
+ if (ob->pose) BKE_pose_update_constraint_flags(ob->pose);
object_test_constraints(ob);
@@ -1312,7 +1312,7 @@ void OBJECT_OT_constraints_copy(wmOperatorType *ot)
static short get_new_constraint_target(bContext *C, int con_type, Object **tar_ob, bPoseChannel **tar_pchan, short add)
{
Object *obact = ED_object_active_context(C);
- bPoseChannel *pchanact = get_active_posechannel(obact);
+ bPoseChannel *pchanact = BKE_pose_channel_active(obact);
short only_curve = 0, only_mesh = 0, only_ob = 0;
short found = 0;
@@ -1459,7 +1459,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
pchan = NULL;
}
else {
- pchan = get_active_posechannel(ob);
+ pchan = BKE_pose_channel_active(ob);
/* ensure not to confuse object/pose adding */
if (pchan == NULL) {
@@ -1541,7 +1541,7 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
object_test_constraints(ob);
if (pchan)
- update_pose_constraint_flags(ob->pose);
+ BKE_pose_update_constraint_flags(ob->pose);
/* force depsgraph to get recalculated since new relationships added */
@@ -1690,7 +1690,7 @@ void POSE_OT_constraint_add_with_targets(wmOperatorType *ot)
static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt))
{
Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
- bPoseChannel *pchan = get_active_posechannel(ob);
+ bPoseChannel *pchan = BKE_pose_channel_active(ob);
bConstraint *con = NULL;
uiPopupMenu *pup;
diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c
index 6ec844e39b2..e9341d90e86 100644
--- a/source/blender/editors/object/object_hook.c
+++ b/source/blender/editors/object/object_hook.c
@@ -648,7 +648,7 @@ static int object_hook_reset_exec(bContext *C, wmOperator *op)
/* reset functionality */
if (hmd->object) {
- bPoseChannel *pchan = get_pose_channel(hmd->object->pose, hmd->subtarget);
+ bPoseChannel *pchan = BKE_pose_channel_find_name(hmd->object->pose, hmd->subtarget);
if (hmd->subtarget[0] && pchan) {
float imat[4][4], mat[4][4];
diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c
index 648f530881a..7b37ca8ab95 100644
--- a/source/blender/editors/object/object_lattice.c
+++ b/source/blender/editors/object/object_lattice.c
@@ -271,12 +271,12 @@ static int make_regular_exec(bContext *C, wmOperator *UNUSED(op))
if (ob) {
lt = ob->data;
- resizelattice(lt->editlatt->latt, lt->pntsu, lt->pntsv, lt->pntsw, NULL);
+ BKE_lattice_resize(lt->editlatt->latt, lt->pntsu, lt->pntsv, lt->pntsw, NULL);
}
else {
ob = CTX_data_active_object(C);
lt = ob->data;
- resizelattice(lt, lt->pntsu, lt->pntsv, lt->pntsw, NULL);
+ BKE_lattice_resize(lt, lt->pntsu, lt->pntsv, lt->pntsw, NULL);
}
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index b4207efc21f..f6bf9ba2f15 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1369,7 +1369,7 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op)
dm->release(dm);
}
else if (ob->type == OB_LATTICE) {
- lattice_calc_modifiers(scene, ob);
+ BKE_lattice_modifiers_calc(scene, ob);
}
else if (ob->type == OB_MBALL) {
makeDispListMBall(scene, ob);
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 666bccaf67e..8cb7c1fdcb5 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -554,7 +554,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
}
}
else if (partype == PAR_BONE) {
- pchan = get_active_posechannel(par);
+ pchan = BKE_pose_channel_active(par);
if (pchan == NULL) {
BKE_report(reports, RPT_ERROR, "No active Bone");
@@ -1510,7 +1510,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, int flag)
case OB_ARMATURE:
ob->recalc |= OB_RECALC_DATA;
ob->data = BKE_armature_copy(ob->data);
- armature_rebuild_pose(ob, ob->data);
+ BKE_pose_rebuild(ob, ob->data);
break;
case OB_SPEAKER:
ob->data = BKE_speaker_copy(ob->data);
@@ -1911,7 +1911,7 @@ static int drop_named_material_invoke(bContext *C, wmOperator *op, wmEvent *even
char name[MAX_ID_NAME - 2];
RNA_string_get(op->ptr, "name", name);
- ma = (Material *)find_id("MA", name);
+ ma = (Material *)BKE_libblock_find_name("MA", name);
if (base == NULL || ma == NULL)
return OPERATOR_CANCELLED;
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index 0ef4bb503cf..3e06db4bc6f 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -884,7 +884,7 @@ static int object_select_mirror_exec(bContext *C, wmOperator *op)
flip_side_name(tmpname, primbase->object->id.name + 2, TRUE);
if (strcmp(tmpname, primbase->object->id.name + 2) != 0) { /* names differ */
- Object *ob = (Object *)find_id("OB", tmpname);
+ Object *ob = (Object *)BKE_libblock_find_name("OB", tmpname);
if (ob) {
Base *secbase = BKE_scene_base_find(scene, ob);
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 92dc9b9bd4a..785b9c0a9b7 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -548,7 +548,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
BKE_object_where_is_calc(scene, ob);
if (ob->type == OB_ARMATURE) {
- where_is_pose(scene, ob); /* needed for bone parents */
+ BKE_pose_where_is(scene, ob); /* needed for bone parents */
}
ignore_parent_tx(bmain, scene, ob);
@@ -855,7 +855,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
/* do_inverse_offset= TRUE; */ /* docenter_armature() handles this */
BKE_object_where_is_calc(scene, ob);
- where_is_pose(scene, ob); /* needed for bone parents */
+ BKE_pose_where_is(scene, ob); /* needed for bone parents */
ignore_parent_tx(bmain, scene, ob);
@@ -895,7 +895,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
BKE_object_where_is_calc(scene, ob);
if (ob->type == OB_ARMATURE) {
- where_is_pose(scene, ob); /* needed for bone parents */
+ BKE_pose_where_is(scene, ob); /* needed for bone parents */
}
ignore_parent_tx(bmain, scene, ob);
@@ -917,7 +917,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
BKE_object_where_is_calc(scene, ob_other);
if (ob_other->type == OB_ARMATURE) {
- where_is_pose(scene, ob_other); /* needed for bone parents */
+ BKE_pose_where_is(scene, ob_other); /* needed for bone parents */
}
ignore_parent_tx(bmain, scene, ob_other);
}
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 57588c0e33a..b106bd8754a 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -271,7 +271,7 @@ static void screen_opengl_render_apply(OGLRender *oglrender)
}
BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, scene->r.im_format.imtype, scene->r.scemode & R_EXTENSION, FALSE);
- ok = BKE_write_ibuf_as(ibuf, name, &scene->r.im_format, TRUE); /* no need to stamp here */
+ ok = BKE_imbuf_write_as(ibuf, name, &scene->r.im_format, TRUE); /* no need to stamp here */
if (ok) printf("OpenGL Render written to '%s'\n", name);
else printf("OpenGL Render failed to write '%s'\n", name);
}
@@ -546,7 +546,7 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
}
else {
BKE_makepicstring(name, scene->r.pic, oglrender->bmain->name, scene->r.cfra, scene->r.im_format.imtype, scene->r.scemode & R_EXTENSION, TRUE);
- ok = BKE_write_ibuf_stamp(scene, camera, ibuf, name, &scene->r.im_format);
+ ok = BKE_imbuf_write_stamp(scene, camera, ibuf, name, &scene->r.im_format);
if (ok == 0) {
printf("Write error: cannot save %s\n", name);
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index c8fd8d0c93f..ca4683b864c 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -375,7 +375,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
ma = BKE_material_copy(ma);
}
else {
- ma = add_material("Material");
+ ma = BKE_material_add("Material");
if (BKE_scene_use_new_shading_nodes(scene)) {
ED_node_shader_default(scene, &ma->id);
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c
index 69ea428b2ba..6c5991422e5 100644
--- a/source/blender/editors/screen/screen_context.c
+++ b/source/blender/editors/screen/screen_context.c
@@ -295,7 +295,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
bPoseChannel *pchan;
Object *obpose= BKE_object_pose_armature_get(obact);
- pchan= get_active_posechannel(obpose);
+ pchan= BKE_pose_channel_active(obpose);
if (pchan) {
CTX_data_pointer_set(result, &obpose->id, &RNA_PoseBone, pchan);
return 1;
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 22a1770412f..4f2433977e0 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -190,7 +190,7 @@ static int screenshot_exec(bContext *C, wmOperator *op)
/* bw screenshot? - users will notice if it fails! */
IMB_color_to_bw(ibuf);
}
- BKE_write_ibuf(ibuf, path, &scd->im_format);
+ BKE_imbuf_write(ibuf, path, &scd->im_format);
IMB_freeImBuf(ibuf);
}
@@ -357,7 +357,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float
BKE_makepicstring(name, rd.pic, sj->bmain->name, rd.cfra, rd.im_format.imtype, rd.scemode & R_EXTENSION, TRUE);
ibuf->rect= sj->dumprect;
- ok= BKE_write_ibuf(ibuf, name, &rd.im_format);
+ ok= BKE_imbuf_write(ibuf, name, &rd.im_format);
if (ok==0) {
printf("Write error: cannot save %s\n", name);
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 8bac74e0899..397bfadbd68 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -4858,7 +4858,7 @@ static int texture_paint_init(bContext *C, wmOperator *op)
if (pop->mode != PAINT_MODE_2D) {
Object *ob = OBACT;
- Mesh *me = get_mesh(ob);
+ Mesh *me = BKE_mesh_from_object(ob);
if (!me) {
return 0;
@@ -5451,7 +5451,7 @@ static int image_paint_sample_color_poll(bContext *C)
if (CTX_wm_view3d(C)) {
Object *obact = CTX_data_active_object(C);
if (obact && obact->mode & OB_MODE_TEXTURE_PAINT) {
- Mesh *me = get_mesh(obact);
+ Mesh *me = BKE_mesh_from_object(obact);
if (me) {
return !(me->editflag & ME_EDIT_PAINT_MASK);
}
@@ -5559,7 +5559,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (!(ob->mode & OB_MODE_TEXTURE_PAINT) && !me) {
BKE_report(op->reports, RPT_ERROR, "Can only enter texture paint mode for mesh objects");
@@ -5794,7 +5794,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- image = BKE_add_image_imbuf(ibuf);
+ image = BKE_image_add_from_imbuf(ibuf);
if (image) {
/* now for the trickyness. store the view projection here!
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 8f8c4ae13d3..bfd8f869e66 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -93,7 +93,7 @@ static int vertex_paint_use_fast_update_check(Object *ob)
DerivedMesh *dm = ob->derivedFinal;
if (dm) {
- Mesh *me = get_mesh(ob);
+ Mesh *me = BKE_mesh_from_object(ob);
if (me && me->mcol) {
return (me->mcol == CustomData_get_layer(&dm->faceData, CD_MCOL));
}
@@ -110,7 +110,7 @@ static int vertex_paint_use_tessface_check(Object *ob)
DerivedMesh *dm = ob->derivedFinal;
if (dm) {
- Mesh *me = get_mesh(ob);
+ Mesh *me = BKE_mesh_from_object(ob);
return (me->mpoly == CustomData_get_layer(&dm->faceData, CD_MPOLY));
}
@@ -317,7 +317,7 @@ static void make_vertexcol(Object *ob) /* single ob */
{
Mesh *me;
if (!ob || ob->id.lib) return;
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (me == NULL) return;
if (me->edit_btmesh) return;
@@ -433,7 +433,7 @@ void vpaint_fill(Object *ob, unsigned int paintcol)
MLoopCol *lcol;
int i, j, selected;
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (me == NULL || me->totpoly == 0) return;
if (!me->mloopcol) make_vertexcol(ob);
@@ -551,7 +551,7 @@ void vpaint_dogamma(Scene *scene)
unsigned char *cp, gamtab[256];
ob = OBACT;
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (!(ob->mode & OB_MODE_VERTEX_PAINT)) return;
if (me == 0 || me->mcol == 0 || me->totface == 0) return;
@@ -1007,7 +1007,7 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, wmEvent *event)
short change = FALSE;
view3d_set_viewcontext(C, &vc);
- me = get_mesh(vc.obact);
+ me = BKE_mesh_from_object(vc.obact);
if (me && me->dvert && vc.v3d && vc.rv3d) {
int index;
@@ -1094,7 +1094,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA
Mesh *me;
view3d_set_viewcontext(C, &vc);
- me = get_mesh(vc.obact);
+ me = BKE_mesh_from_object(vc.obact);
if (me && me->dvert && vc.v3d && vc.rv3d) {
int index;
@@ -1975,7 +1975,7 @@ static int set_wpaint(bContext *C, wmOperator *UNUSED(op)) /* toggle */
VPaint *wp = scene->toolsettings->wpaint;
Mesh *me;
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (ob->id.lib || me == NULL) return OPERATOR_PASS_THROUGH;
if (ob->mode & OB_MODE_WEIGHT_PAINT) ob->mode &= ~OB_MODE_WEIGHT_PAINT;
@@ -2139,7 +2139,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
return FALSE;
}
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (me == NULL || me->totpoly == 0) return OPERATOR_PASS_THROUGH;
/* if nothing was added yet, we make dverts and a vertex deform group */
@@ -2154,7 +2154,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED
if ((modob = modifiers_isDeformedByArmature(ob))) {
Bone *actbone = ((bArmature *)modob->data)->act_bone;
if (actbone) {
- bPoseChannel *pchan = get_pose_channel(modob->pose, actbone->name);
+ bPoseChannel *pchan = BKE_pose_channel_find_name(modob->pose, actbone->name);
if (pchan) {
bDeformGroup *dg = defgroup_find_name(ob, pchan->name);
@@ -2541,7 +2541,7 @@ static int set_vpaint(bContext *C, wmOperator *op) /* toggle */
VPaint *vp = scene->toolsettings->vpaint;
Mesh *me;
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (me == NULL || BKE_object_obdata_is_libdata(ob)) {
ob->mode &= ~OB_MODE_VERTEX_PAINT;
@@ -2678,7 +2678,7 @@ static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent
float mat[4][4], imat[4][4];
/* context checks could be a poll() */
- me = get_mesh(ob);
+ me = BKE_mesh_from_object(ob);
if (me == NULL || me->totpoly == 0)
return OPERATOR_PASS_THROUGH;
@@ -2726,7 +2726,7 @@ static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob,
{
ViewContext *vc = &vpd->vc;
Brush *brush = paint_brush(&vp->paint);
- Mesh *me = get_mesh(ob);
+ Mesh *me = BKE_mesh_from_object(ob);
MFace *mface = &me->mface[index];
unsigned int *mcol = ((unsigned int *)me->mcol) + 4 * index;
unsigned int *mcolorig = ((unsigned int *)vp->vpaint_prev) + 4 * index;
@@ -2771,7 +2771,7 @@ static void vpaint_paint_poly(VPaint *vp, VPaintData *vpd, Object *ob,
{
ViewContext *vc = &vpd->vc;
Brush *brush = paint_brush(&vp->paint);
- Mesh *me = get_mesh(ob);
+ Mesh *me = BKE_mesh_from_object(ob);
MPoly *mpoly = &me->mpoly[index];
MFace *mf;
MCol *mc;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index fa560dc138c..a49a9f02c60 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2756,7 +2756,7 @@ void sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, int need_
ss->face_normals = NULL;
}
else {
- Mesh *me = get_mesh(ob);
+ Mesh *me = BKE_mesh_from_object(ob);
ss->totvert = me->totvert;
ss->totpoly = me->totpoly;
ss->mvert = me->mvert;
@@ -2945,7 +2945,7 @@ static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSessio
BLI_strncpy(cache->saved_active_brush_name, brush->id.name + 2, sizeof(cache->saved_active_brush_name));
- br = (Brush *)find_id("BR", "Smooth");
+ br = (Brush *)BKE_libblock_find_name("BR", "Smooth");
if (br) {
paint_brush_set(p, br);
brush = br;
@@ -3508,7 +3508,7 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str
/* Alt-Smooth */
if (ss->cache->alt_smooth) {
Paint *p = &sd->paint;
- brush = (Brush *)find_id("BR", ss->cache->saved_active_brush_name);
+ brush = (Brush *)BKE_libblock_find_name("BR", ss->cache->saved_active_brush_name);
if (brush) {
paint_brush_set(p, brush);
}
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 20d5257a62f..ff466c23953 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -294,7 +294,7 @@ static int buttons_context_path_pose_bone(ButsContextPath *path)
}
else {
if (arm->act_bone) {
- bPoseChannel *pchan= get_pose_channel(ob->pose, arm->act_bone->name);
+ bPoseChannel *pchan= BKE_pose_channel_find_name(ob->pose, arm->act_bone->name);
if (pchan) {
RNA_pointer_create(&ob->id, &RNA_PoseBone, pchan, &path->ptr[path->len]);
path->len++;
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index ecbd9a4033a..de171bc45f8 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -146,7 +146,7 @@ static void image_info(Scene *scene, ImageUser *iuser, Image *ima, ImBuf *ibuf,
/* the frame number, even if we cant */
if (ima->source == IMA_SRC_SEQUENCE) {
/* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */
- const int framenr = BKE_image_user_get_frame(iuser, CFRA, 0);
+ const int framenr = BKE_image_user_frame_get(iuser, CFRA, 0);
ofs += sprintf(str + ofs, ", Frame: %d", framenr);
}
@@ -430,7 +430,7 @@ static void set_frames_cb(bContext *C, void *ima_v, void *iuser_v)
if (ima->anim) {
iuser->frames = IMB_anim_get_duration(ima->anim, IMB_TC_RECORD_RUN);
- BKE_image_user_calc_frame(iuser, scene->r.cfra, 0);
+ BKE_image_user_frame_calc(iuser, scene->r.cfra, 0);
}
}
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 66070bf54b0..51741b8972a 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1150,7 +1150,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
/* TODO, better solution, if a 24bit image is painted onto it may contain alpha */
if (ibuf->userflags & IB_BITMAPDIRTY) { /* it has been painted onto */
/* checks each pixel, not ideal */
- ibuf->planes = BKE_alphatest_ibuf(ibuf) ? 32 : 24;
+ ibuf->planes = BKE_imbuf_alpha_test(ibuf) ? 32 : 24;
}
}
@@ -1167,7 +1167,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
BKE_image_release_renderresult(scene, ima);
}
else {
- if (BKE_write_ibuf_as(ibuf, simopts->filepath, &simopts->im_format, save_copy)) {
+ if (BKE_imbuf_write_as(ibuf, simopts->filepath, &simopts->im_format, save_copy)) {
ok = TRUE;
}
}
@@ -1528,7 +1528,7 @@ static int image_new_exec(bContext *C, wmOperator *op)
if (!alpha)
color[3] = 1.0f;
- ima = BKE_add_image_size(width, height, name, alpha ? 32 : 24, floatbuf, uvtestgrid, color);
+ ima = BKE_image_add_generated(width, height, name, alpha ? 32 : 24, floatbuf, uvtestgrid, color);
if (!ima)
return OPERATOR_CANCELLED;
@@ -2408,7 +2408,7 @@ void ED_image_update_frame(const Main *mainp, int cfra)
if (tex->type == TEX_IMAGE && tex->ima) {
if (ELEM(tex->ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
if (tex->iuser.flag & IMA_ANIM_ALWAYS)
- BKE_image_user_calc_frame(&tex->iuser, cfra, 0);
+ BKE_image_user_frame_calc(&tex->iuser, cfra, 0);
}
}
}
@@ -2423,12 +2423,12 @@ void ED_image_update_frame(const Main *mainp, int cfra)
BGpic *bgpic;
for (bgpic = v3d->bgpicbase.first; bgpic; bgpic = bgpic->next)
if (bgpic->iuser.flag & IMA_ANIM_ALWAYS)
- BKE_image_user_calc_frame(&bgpic->iuser, cfra, 0);
+ BKE_image_user_frame_calc(&bgpic->iuser, cfra, 0);
}
else if (sa->spacetype == SPACE_IMAGE) {
SpaceImage *sima = sa->spacedata.first;
if (sima->iuser.flag & IMA_ANIM_ALWAYS)
- BKE_image_user_calc_frame(&sima->iuser, cfra, 0);
+ BKE_image_user_frame_calc(&sima->iuser, cfra, 0);
}
else if (sa->spacetype == SPACE_NODE) {
SpaceNode *snode = sa->spacedata.first;
@@ -2440,7 +2440,7 @@ void ED_image_update_frame(const Main *mainp, int cfra)
ImageUser *iuser = node->storage;
if (ELEM(ima->source, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE))
if (iuser->flag & IMA_ANIM_ALWAYS)
- BKE_image_user_calc_frame(iuser, cfra, 0);
+ BKE_image_user_frame_calc(iuser, cfra, 0);
}
}
}
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 426cc3207e4..9e0f538056c 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -590,7 +590,7 @@ static void image_refresh(const bContext *C, ScrArea *UNUSED(sa))
ima = ED_space_image(sima);
if (sima->iuser.flag & IMA_ANIM_ALWAYS)
- BKE_image_user_calc_frame(&sima->iuser, scene->r.cfra, 0);
+ BKE_image_user_frame_calc(&sima->iuser, scene->r.cfra, 0);
/* check if we have to set the image from the editmesh */
if (ima && (ima->source == IMA_SRC_VIEWER || sima->pin)) ;
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 891236d6d21..97b6c32d81d 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -1084,7 +1084,7 @@ static void get_armature_bone_constraint(Object *ob, const char *posechannel, co
{
/* check that bone exist in the active object */
if (ob->type == OB_ARMATURE && ob->pose) {
- bPoseChannel *pchan= get_pose_channel(ob->pose, posechannel);
+ bPoseChannel *pchan= BKE_pose_channel_find_name(ob->pose, posechannel);
if (pchan) {
bConstraint *con= BLI_findstring(&pchan->constraints, constraint_name, offsetof(bConstraint, name));
if (con) {
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index bfa8111af3e..c2b7a1d6a7f 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -1247,7 +1247,7 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA *
Scene *scene= CTX_data_scene(C);
ImageUser *iuser= node->storage;
char numstr[32];
- const int framenr= BKE_image_user_get_frame(iuser, CFRA, 0);
+ const int framenr= BKE_image_user_frame_get(iuser, CFRA, 0);
BLI_snprintf(numstr, sizeof(numstr), "Frame: %d", framenr);
uiItemL(layout, numstr, ICON_NONE);
}
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index d47a1d557ab..be9b495619c 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -3418,7 +3418,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
else if (RNA_struct_property_is_set(op->ptr, "name")) {
char name[MAX_ID_NAME-2];
RNA_string_get(op->ptr, "name", name);
- ima= (Image *)find_id("IM", name);
+ ima= (Image *)BKE_libblock_find_name("IM", name);
if (!ima) {
BKE_reportf(op->reports, RPT_ERROR, "Image named \"%s\", not found", name);
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 9bc87a27ba3..47eecbc0d77 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -674,7 +674,7 @@ static void outliner_set_coordinates(ARegion *ar, SpaceOops *soops)
}
/* find next element that has this name */
-static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound)
+static TreeElement *outliner_find_name(SpaceOops *soops, ListBase *lb, char *name, int flags, TreeElement *prev, int *prevFound)
{
TreeElement *te, *tes;
@@ -694,7 +694,7 @@ static TreeElement *outliner_find_named(SpaceOops *soops, ListBase *lb, char *na
return te;
}
- tes= outliner_find_named(soops, &te->subtree, name, flags, prev, prevFound);
+ tes= outliner_find_name(soops, &te->subtree, name, flags, prev, prevFound);
if (tes) return tes;
}
@@ -721,18 +721,18 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *so
flags= soops->search_flags;
/* try to find matching element */
- te= outliner_find_named(soops, &soops->tree, name, flags, last_find, &prevFound);
+ te= outliner_find_name(soops, &soops->tree, name, flags, last_find, &prevFound);
if (te==NULL) {
/* no more matches after previous, start from beginning again */
prevFound= 1;
- te= outliner_find_named(soops, &soops->tree, name, flags, last_find, &prevFound);
+ te= outliner_find_name(soops, &soops->tree, name, flags, last_find, &prevFound);
}
}
else {
/* pop up panel - no previous, or user didn't want search after previous */
name[0]= '\0';
// XXX if (sbutton(name, 0, sizeof(name)-1, "Find: ") && name[0]) {
-// te= outliner_find_named(soops, &soops->tree, name, flags, NULL, &prevFound);
+// te= outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound);
// }
// else return; /* XXX RETURN! XXX */
}
@@ -1402,9 +1402,9 @@ static int parent_drop_exec(bContext *C, wmOperator *op)
partype= RNA_enum_get(op->ptr, "type");
RNA_string_get(op->ptr, "parent", parname);
- par= (Object *)find_id("OB", parname);
+ par= (Object *)BKE_libblock_find_name("OB", parname);
RNA_string_get(op->ptr, "child", childname);
- ob= (Object *)find_id("OB", childname);
+ ob= (Object *)BKE_libblock_find_name("OB", childname);
ED_object_parent_set(op->reports, bmain, scene, ob, par, partype);
@@ -1473,9 +1473,9 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, wmEvent *event)
RNA_string_set(op->ptr, "parent", te_found->name);
/* Identify parent and child */
RNA_string_get(op->ptr, "child", childname);
- ob= (Object *)find_id("OB", childname);
+ ob= (Object *)BKE_libblock_find_name("OB", childname);
RNA_string_get(op->ptr, "parent", parname);
- par= (Object *)find_id("OB", parname);
+ par= (Object *)BKE_libblock_find_name("OB", parname);
if (ELEM(NULL, ob, par)) {
if (par == NULL) printf("par==NULL\n");
@@ -1659,7 +1659,7 @@ static int parent_clear_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
char obname[MAX_ID_NAME];
RNA_string_get(op->ptr, "dragged_obj", obname);
- ob= (Object *)find_id("OB", obname);
+ ob= (Object *)BKE_libblock_find_name("OB", obname);
/* check dragged object (child) is active */
if (ob != CTX_data_active_object(C))
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c
index ca5b21012aa..a9801012d67 100644
--- a/source/blender/editors/space_view3d/drawanimviz.c
+++ b/source/blender/editors/space_view3d/drawanimviz.c
@@ -258,7 +258,7 @@ void draw_motion_path_instance(Scene *scene,
* unless an option is set to always use the whole action
*/
if ((pchan) && (avs->path_viewflag & MOTIONPATH_VIEW_KFACT) == 0) {
- bActionGroup *agrp = action_groups_find_named(adt->action, pchan->name);
+ bActionGroup *agrp = BKE_action_group_find_name(adt->action, pchan->name);
if (agrp) {
agroup_to_keylist(adt, agrp, &keys, NULL);
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 15e6994dfe4..2211b1ddb62 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -2338,9 +2338,9 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base
/* copy the pose */
poseo = ob->pose;
- copy_pose(&posen, ob->pose, 1);
+ BKE_pose_copy_data(&posen, ob->pose, 1);
ob->pose = posen;
- armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
+ BKE_pose_rebuild(ob, ob->data); /* child pointers for IK */
ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
glEnable(GL_BLEND);
@@ -2352,20 +2352,20 @@ static void draw_ghost_poses_range(Scene *scene, View3D *v3d, ARegion *ar, Base
UI_ThemeColorShadeAlpha(TH_WIRE, 0, -128 - (int)(120.0 * sqrt(colfac)));
BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
- where_is_pose(scene, ob);
+ BKE_pose_where_is(scene, ob);
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
}
glDisable(GL_BLEND);
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
- free_pose(posen);
+ BKE_pose_free(posen);
/* restore */
CFRA = cfrao;
ob->pose = poseo;
arm->flag = flago;
- armature_rebuild_pose(ob, ob->data);
+ BKE_pose_rebuild(ob, ob->data);
ob->mode |= OB_MODE_POSE;
ob->ipoflag = ipoflago;
}
@@ -2415,9 +2415,9 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
/* copy the pose */
poseo = ob->pose;
- copy_pose(&posen, ob->pose, 1);
+ BKE_pose_copy_data(&posen, ob->pose, 1);
ob->pose = posen;
- armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
+ BKE_pose_rebuild(ob, ob->data); /* child pointers for IK */
ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
glEnable(GL_BLEND);
@@ -2431,7 +2431,7 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
CFRA = (int)ak->cfra;
BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
- where_is_pose(scene, ob);
+ BKE_pose_where_is(scene, ob);
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
}
glDisable(GL_BLEND);
@@ -2439,13 +2439,13 @@ static void draw_ghost_poses_keys(Scene *scene, View3D *v3d, ARegion *ar, Base *
ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
BLI_dlrbTree_free(&keys);
- free_pose(posen);
+ BKE_pose_free(posen);
/* restore */
CFRA = cfrao;
ob->pose = poseo;
arm->flag = flago;
- armature_rebuild_pose(ob, ob->data);
+ BKE_pose_rebuild(ob, ob->data);
ob->mode |= OB_MODE_POSE;
}
@@ -2481,9 +2481,9 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
/* copy the pose */
poseo = ob->pose;
- copy_pose(&posen, ob->pose, 1);
+ BKE_pose_copy_data(&posen, ob->pose, 1);
ob->pose = posen;
- armature_rebuild_pose(ob, ob->data); /* child pointers for IK */
+ BKE_pose_rebuild(ob, ob->data); /* child pointers for IK */
ghost_poses_tag_unselected(ob, 0); /* hide unselected bones if need be */
glEnable(GL_BLEND);
@@ -2501,7 +2501,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
if (CFRA != cfrao) {
BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
- where_is_pose(scene, ob);
+ BKE_pose_where_is(scene, ob);
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
}
}
@@ -2516,7 +2516,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
if (CFRA != cfrao) {
BKE_animsys_evaluate_animdata(scene, &ob->id, adt, (float)CFRA, ADT_RECALC_ALL);
- where_is_pose(scene, ob);
+ BKE_pose_where_is(scene, ob);
draw_pose_bones(scene, v3d, ar, base, OB_WIRE, TRUE, FALSE);
}
}
@@ -2525,13 +2525,13 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
ghost_poses_tag_unselected(ob, 1); /* unhide unselected bones if need be */
- free_pose(posen);
+ BKE_pose_free(posen);
/* restore */
CFRA = cfrao;
ob->pose = poseo;
arm->flag = flago;
- armature_rebuild_pose(ob, ob->data);
+ BKE_pose_rebuild(ob, ob->data);
ob->mode |= OB_MODE_POSE;
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 79dce3e6bcd..6c941765a57 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -1971,7 +1971,7 @@ static void drawlattice(Scene *scene, View3D *v3d, Object *ob)
/* now we default make displist, this will modifiers work for non animated case */
if (ob->disp.first == NULL)
- lattice_calc_modifiers(scene, ob);
+ BKE_lattice_modifiers_calc(scene, ob);
dl = find_displist(&ob->disp, DL_VERTS);
if (is_edit) {
@@ -6168,7 +6168,7 @@ static void draw_bounding_volume(Scene *scene, Object *ob, char type)
}
}
else if (ob->type == OB_ARMATURE) {
- bb = BKE_armature_get_bb(ob);
+ bb = BKE_armature_boundbox_get(ob);
}
else {
drawcube();
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index f9b8f9228b9..28fd2c8bc74 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -1016,7 +1016,7 @@ static void space_view3d_listener(struct ScrArea *sa, struct wmNotifier *wmn)
break;
}
- // removed since BKE_image_user_calc_frame is now called in draw_bgpic because screen_ops doesnt call the notifier.
+ // removed since BKE_image_user_frame_calc is now called in draw_bgpic because screen_ops doesnt call the notifier.
#if 0
if (wmn->category == NC_SCENE && wmn->data == ND_FRAME) {
View3D *v3d = area->spacedata.first;
@@ -1025,7 +1025,7 @@ static void space_view3d_listener(struct ScrArea *sa, struct wmNotifier *wmn)
for (; bgpic; bgpic = bgpic->next) {
if (bgpic->ima) {
Scene *scene = wmn->reference;
- BKE_image_user_calc_frame(&bgpic->iuser, scene->r.cfra, 0);
+ BKE_image_user_frame_calc(&bgpic->iuser, scene->r.cfra, 0);
}
}
}
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 13129616843..723dc9d5fc8 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -939,7 +939,7 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
PointerRNA pchanptr;
uiLayout *col;
- pchan = get_active_posechannel(ob);
+ pchan = BKE_pose_channel_active(ob);
if (!pchan) {
uiItemL(layout, IFACE_("No Bone Active"), ICON_NONE);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index fe7511c70cc..dd90ef57307 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1544,7 +1544,7 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, int foreground)
ima = bgpic->ima;
if (ima == NULL)
continue;
- BKE_image_user_calc_frame(&bgpic->iuser, CFRA, 0);
+ BKE_image_user_frame_calc(&bgpic->iuser, CFRA, 0);
ibuf = BKE_image_get_ibuf(ima, &bgpic->iuser);
}
else {
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index de17f0af1e8..b5933310a06 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -3098,7 +3098,7 @@ static int background_image_add_invoke(bContext *C, wmOperator *op, wmEvent *UNU
}
else if (RNA_struct_property_is_set(op->ptr, "name")) {
RNA_string_get(op->ptr, "name", name);
- ima = (Image *)find_id("IM", name);
+ ima = (Image *)BKE_libblock_find_name("IM", name);
}
bgpic = background_image_add(C);
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 2fe0a30c71b..367b36db583 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -582,7 +582,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
mul_m4_v3(ob->imat, vec);
/* Get location of grid point in pose space. */
- armature_loc_pose_to_bone(pchan, vec, vec);
+ BKE_armature_loc_pose_to_bone(pchan, vec, vec);
/* adjust location */
if ((pchan->protectflag & OB_LOCK_LOCX) == 0)
@@ -707,7 +707,7 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
if (pchan->bone->layer & arm->layer) {
if ((pchan->bone->flag & BONE_CONNECTED) == 0) {
/* Get position in pchan (pose) space. */
- armature_loc_pose_to_bone(pchan, vec, vec);
+ BKE_armature_loc_pose_to_bone(pchan, vec, vec);
/* copy new position */
if ((pchan->protectflag & OB_LOCK_LOCX) == 0)
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 1509242cf58..e1be274663a 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -1176,7 +1176,7 @@ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d)
copy_v3_v3(vec, ob->obmat[3]);
if (ob->type == OB_ARMATURE && v3d->ob_centre_bone[0]) {
- bPoseChannel *pchan = get_pose_channel(ob->pose, v3d->ob_centre_bone);
+ bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, v3d->ob_centre_bone);
if (pchan) {
copy_v3_v3(vec, pchan->pose_mat[3]);
mul_m4_v3(ob->obmat, vec);
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index d7ad0c0c9ea..3cd41edacf5 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -424,7 +424,7 @@ static short apply_targetless_ik(Object *ob)
bone= parchan->bone;
bone->flag |= BONE_TRANSFORM; /* ensures it gets an auto key inserted */
- armature_mat_pose_to_bone(parchan, parchan->pose_mat, rmat);
+ BKE_armature_mat_pose_to_bone(parchan, parchan->pose_mat, rmat);
/* apply and decompose, doesn't work for constraints or non-uniform scale well */
{
@@ -535,11 +535,11 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
/* proper way to get parent transform + own transform + constraints transform */
copy_m3_m4(omat, ob->obmat);
- /* New code, using "generic" pchan_to_pose_mat(). */
+ /* New code, using "generic" BKE_pchan_to_pose_mat(). */
{
float rotscale_mat[4][4], loc_mat[4][4];
- pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
+ BKE_pchan_to_pose_mat(pchan, rotscale_mat, loc_mat);
if (t->mode == TFM_TRANSLATION)
copy_m3_m4(pmat, loc_mat);
else
@@ -884,7 +884,7 @@ static short pose_grab_with_ik_children(bPose *pose, Bone *bone)
}
}
if (wentdeeper==0) {
- bPoseChannel *pchan= get_pose_channel(pose, bone->name);
+ bPoseChannel *pchan= BKE_pose_channel_find_name(pose, bone->name);
if (pchan)
added+= pose_grab_with_ik_add(pchan);
}
@@ -953,7 +953,7 @@ static void createTransPose(TransInfo *t, Object *ob)
t->total= 0;
/* check validity of state */
- arm= get_armature(ob);
+ arm= BKE_armature_from_object(ob);
if ((arm==NULL) || (ob->pose==NULL)) return;
if (arm->flag & ARM_RESTPOS) {
@@ -5046,7 +5046,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
* we need to update the pose otherwise no updates get called during
* transform and the auto-ik is not applied. see [#26164] */
struct Object *pose_ob=t->poseobj;
- where_is_pose(t->scene, pose_ob);
+ BKE_pose_where_is(t->scene, pose_ob);
}
/* set BONE_TRANSFORM flags for autokey, manipulator draw might have changed them */
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index bea1002b5c6..b986bda4c13 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -833,7 +833,7 @@ static void recalcData_view3d(TransInfo *t)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA); /* sets recalc flags */
}
else
- where_is_pose(t->scene, ob);
+ BKE_pose_where_is(t->scene, ob);
}
else if (base && (base->object->mode & OB_MODE_PARTICLE_EDIT) && PE_get_current(t->scene, base->object)) {
if (t->state != TRANS_CANCEL) {
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 093c81c8d37..94f6640ca5b 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -203,7 +203,7 @@ int gimbal_axis(Object *ob, float gmat[][3])
{
if (ob) {
if (ob->mode & OB_MODE_POSE) {
- bPoseChannel *pchan= get_active_posechannel(ob);
+ bPoseChannel *pchan= BKE_pose_channel_active(ob);
if (pchan) {
float mat[3][3], tmat[3][3], obmat[3][3];