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/editors/armature | |
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/editors/armature')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 48 | ||||
-rw-r--r-- | source/blender/editors/armature/poseUtils.c | 2 | ||||
-rw-r--r-- | source/blender/editors/armature/poselib.c | 12 | ||||
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 32 |
4 files changed, 47 insertions, 47 deletions
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 */ |