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>2018-04-15 13:48:39 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-15 13:48:39 +0300
commitebe336118181ffe6834a2bfd9f6a6c9ac459588a (patch)
tree6e5e37530e0df9963eab780fbffee2a5b2808252 /source/blender/editors
parent9e2ea6c500a3a5774a1aa174b6801d3a9edadd9a (diff)
parent7bccd21afa68d49daa7c3ed3586b64e0a95d660a (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/armature/armature_select.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index 7149fb15f45..b147f94747c 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -294,8 +294,8 @@ static int selectbuffer_ret_hits_5(unsigned int *buffer, const int hits12, const
/* does bones and points */
/* note that BONE ROOT only gets drawn for root bones (or without IK) */
static EditBone *get_nearest_editbonepoint(
- const EvaluationContext *eval_ctx, ViewContext *vc, const int mval[2],
- ListBase *edbo, bool findunsel, bool use_cycle, int *r_selmask)
+ const EvaluationContext *eval_ctx, ViewContext *vc,
+ bool findunsel, bool use_cycle, int *r_selmask)
{
bArmature *arm = (bArmature *)vc->obedit->data;
EditBone *ebone_next_act = arm->act_edbone;
@@ -327,11 +327,11 @@ static EditBone *get_nearest_editbonepoint(
if (use_cycle) {
if (vc->v3d->drawtype > OB_WIRE) {
do_nearest = true;
- if (len_manhattan_v2v2_int(mval, last_mval) < 3) {
+ if (len_manhattan_v2v2_int(vc->mval, last_mval) < 3) {
do_nearest = false;
}
}
- copy_v2_v2_int(last_mval, mval);
+ copy_v2_v2_int(last_mval, vc->mval);
}
else {
if (vc->v3d->drawtype > OB_WIRE) {
@@ -346,7 +346,7 @@ static EditBone *get_nearest_editbonepoint(
/* we _must_ end cache before return, use 'goto cache_end' */
view3d_opengl_select_cache_begin();
- BLI_rcti_init_pt_radius(&rect, mval, 12);
+ BLI_rcti_init_pt_radius(&rect, vc->mval, 12);
hits12 = view3d_opengl_select(eval_ctx, vc, buffer, MAXPICKBUF, &rect, select_mode);
if (hits12 == 1) {
hits = selectbuffer_ret_hits_12(buffer, hits12);
@@ -356,7 +356,7 @@ static EditBone *get_nearest_editbonepoint(
int offs;
offs = 4 * hits12;
- BLI_rcti_init_pt_radius(&rect, mval, 5);
+ BLI_rcti_init_pt_radius(&rect, vc->mval, 5);
hits5 = view3d_opengl_select(eval_ctx, vc, buffer + offs, MAXPICKBUF - offs, &rect, select_mode);
if (hits5 == 1) {
@@ -384,7 +384,7 @@ cache_end:
if (!(hitresult & BONESEL_NOSEL)) {
int dep;
- ebone = BLI_findlink(edbo, hitresult & ~BONESEL_ANY);
+ ebone = BLI_findlink(arm->edbo, hitresult & ~BONESEL_ANY);
/* clicks on bone points get advantage */
if (hitresult & (BONESEL_ROOT | BONESEL_TIP)) {
@@ -428,7 +428,7 @@ cache_end:
if (!(besthitresult & BONESEL_NOSEL)) {
- ebone = BLI_findlink(edbo, besthitresult & ~BONESEL_ANY);
+ ebone = BLI_findlink(arm->edbo, besthitresult & ~BONESEL_ANY);
*r_selmask = 0;
if (besthitresult & BONESEL_ROOT)
@@ -484,7 +484,6 @@ static int ebone_select_flag(EditBone *ebone)
bool ED_armature_edit_select_pick(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
{
Object *obedit = CTX_data_edit_object(C);
- bArmature *arm = obedit->data;
EvaluationContext eval_ctx;
ViewContext vc;
EditBone *nearBone = NULL;
@@ -497,8 +496,9 @@ bool ED_armature_edit_select_pick(bContext *C, const int mval[2], bool extend, b
return true;
}
- nearBone = get_nearest_editbonepoint(&eval_ctx, &vc, mval, arm->edbo, true, true, &selmask);
+ nearBone = get_nearest_editbonepoint(&eval_ctx, &vc, true, true, &selmask);
if (nearBone) {
+ bArmature *arm = obedit->data;
if (!extend && !deselect && !toggle) {
ED_armature_edit_deselect_all(obedit);