From b18608f3e9066407b1d8a837161ad295d7719937 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Apr 2020 15:45:57 +1100 Subject: 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 --- source/blender/editors/armature/pose_select.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/armature/pose_select.c') 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; -- cgit v1.2.3