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>2020-04-03 07:45:57 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-04-03 07:52:26 +0300
commitb18608f3e9066407b1d8a837161ad295d7719937 (patch)
treeec62ed5d98221a3c99500b50986514c762d5706a /source/blender/editors/armature/pose_select.c
parent09071e27993a6a113ea08376e361230d99e7690d (diff)
Cleanup: bone cursor picking API
There was one function to access both pose/edit bones, which returned a void pointer type. Split these into 3 functions which return EditBone, bPoseChannel or Bone types. Internally the logic is still shared, this just makes it clearer to callers which type is expected. Also use more conventional prefix for picking API: - ED_armature_pick_(ebone/pchan/bone) - ED_armature_pick_(ebone/pchan/bone)_from_selectbuffer
Diffstat (limited to 'source/blender/editors/armature/pose_select.c')
-rw-r--r--source/blender/editors/armature/pose_select.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c
index 475640fa37c..824cb50d5f1 100644
--- a/source/blender/editors/armature/pose_select.c
+++ b/source/blender/editors/armature/pose_select.c
@@ -156,12 +156,12 @@ bool ED_armature_pose_select_pick_with_buffer(ViewLayer *view_layer,
}
Object *ob_act = OBACT(view_layer);
- Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
+ BLI_assert(OBEDIT_FROM_VIEW_LAYER(view_layer) == NULL);
/* Callers happen to already get the active base */
Base *base_dummy = NULL;
- nearBone = get_bone_from_selectbuffer(
- &base, 1, obedit != NULL, buffer, hits, 1, do_nearest, &base_dummy);
+ nearBone = ED_armature_pick_bone_from_selectbuffer(
+ &base, 1, buffer, hits, 1, do_nearest, &base_dummy);
/* if the bone cannot be affected, don't do anything */
if ((nearBone) && !(nearBone->flag & BONE_UNSELECTABLE)) {
@@ -413,7 +413,7 @@ static int pose_select_connected_invoke(bContext *C, wmOperator *op, const wmEve
view3d_operator_needs_opengl(C);
Base *base = NULL;
- bone = get_nearest_bone(C, event->mval, !extend, &base);
+ bone = ED_armature_pick_bone(C, event->mval, !extend, &base);
if (!bone) {
return OPERATOR_CANCELLED;