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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-04-13 11:18:26 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-13 11:18:26 +0400
commit05bdc4664129dd714b623664d43f7b85e0a6519c (patch)
tree0ce490d0fee05f32be566ddc749b5357c2016b03 /source
parent58993c3f37a876a858075053de1276c8b6aedc2e (diff)
fix [#30923] Hide Unselected in the UV/Image editor does nothing
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index aa98e17df24..de8671fd575 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -3001,7 +3001,9 @@ static int hide_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-
+
+#define BOOL_CMP(test, bool_test) ((!!(test)) == bool_test)
+
BM_ITER(efa, &iter, em->bm, BM_FACES_OF_MESH, NULL) {
int hide = 0;
@@ -3022,17 +3024,18 @@ static int hide_exec(bContext *C, wmOperator *op)
if (swap)
hide = !hide;
-
+
if (hide) {
if (facemode) {
- /*check that every UV is selected*/
+ /* check that every UV is selected */
luv = NULL;
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if (!(luv->flag & MLOOPUV_VERTSEL))
+ if (!BOOL_CMP((luv->flag & MLOOPUV_VERTSEL), !swap)) {
break;
+ }
}
-
+
if (!luv) {
BM_elem_select_set(em->bm, efa, FALSE);
uvedit_face_deselect(scene, em, efa);
@@ -3042,24 +3045,26 @@ static int hide_exec(bContext *C, wmOperator *op)
/*check if a UV is selected*/
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if (luv->flag & MLOOPUV_VERTSEL) {
+ if (BOOL_CMP((luv->flag & MLOOPUV_VERTSEL), !swap)) {
BM_elem_select_set(em->bm, efa, FALSE);
}
- luv->flag &= ~MLOOPUV_VERTSEL;
+ if (!swap) luv->flag &= ~MLOOPUV_VERTSEL;
}
}
else {
BM_ITER(l, &liter, em->bm, BM_LOOPS_OF_FACE, efa) {
luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
- if (luv->flag & MLOOPUV_VERTSEL) {
+ if (BOOL_CMP((luv->flag & MLOOPUV_VERTSEL), !swap)) {
BM_elem_select_set(em->bm, l->v, FALSE);
- luv->flag &= ~MLOOPUV_VERTSEL;
+ if (!swap) luv->flag &= ~MLOOPUV_VERTSEL;
}
}
}
}
}
+#undef BOOL_CMP
+
/* flush vertex selection changes */
if (!facemode && em->selectmode != SCE_SELECT_FACE)
EDBM_selectmode_flush(em);