[Bf-blender-cvs] [880fb78a591] temp-select-axis: MESH_OT_select_axis: Make it work with world axis, not local ones
Dalai Felinto
noreply at git.blender.org
Fri Aug 24 00:41:05 CEST 2018
Commit: 880fb78a591b91080ccf0e096087797a1d0109c2
Author: Dalai Felinto
Date: Thu Aug 23 18:23:51 2018 -0300
Branches: temp-select-axis
https://developer.blender.org/rB880fb78a591b91080ccf0e096087797a1d0109c2
MESH_OT_select_axis: Make it work with world axis, not local ones
===================================================================
M source/blender/editors/mesh/editmesh_select.c
===================================================================
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index fdf6ac5685f..80fac887ac3 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -4360,7 +4360,12 @@ static int edbm_select_axis_exec(bContext *C, wmOperator *op)
BMVert *v;
BMIter iter;
const float limit = RNA_float_get(op->ptr, "threshold");
- float value = v_act->co[axis];
+
+ float value;
+ float vertex_world[3];
+
+ mul_v3_m4v3(vertex_world, obedit->obmat, v_act->co);
+ value = vertex_world[axis];
if (mode == SELECT_AXIS_NEGATIVE) {
value -= limit;
@@ -4371,18 +4376,23 @@ static int edbm_select_axis_exec(bContext *C, wmOperator *op)
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
if (!BM_elem_flag_test(v, BM_ELEM_HIDDEN)) {
+ float v_iter_world[3];
+ mul_v3_m4v3(v_iter_world, obedit->obmat, v->co);
switch (mode) {
case SELECT_AXIS_ALIGNED:
- if (fabsf(v->co[axis] - value) < limit)
+ if (fabsf(v_iter_world[axis] - value) < limit) {
BM_vert_select_set(bm, v, true);
+ }
break;
case SELECT_AXIS_NEGATIVE:
- if (v->co[axis] > value)
+ if (v_iter_world[axis] > value) {
BM_vert_select_set(bm, v, true);
+ }
break;
case SELECT_AXIS_POSITIVE:
- if (v->co[axis] < value)
+ if (v_iter_world[axis] < value) {
BM_vert_select_set(bm, v, true);
+ }
break;
}
}
More information about the Bf-blender-cvs
mailing list