[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45588] trunk/blender/source/blender/ editors/uvedit/uvedit_ops.c: fix [#30923] Hide Unselected in the UV/ Image editor does nothing
Campbell Barton
ideasman42 at gmail.com
Fri Apr 13 09:18:27 CEST 2012
Revision: 45588
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45588
Author: campbellbarton
Date: 2012-04-13 07:18:26 +0000 (Fri, 13 Apr 2012)
Log Message:
-----------
fix [#30923] Hide Unselected in the UV/Image editor does nothing
Modified Paths:
--------------
trunk/blender/source/blender/editors/uvedit/uvedit_ops.c
Modified: trunk/blender/source/blender/editors/uvedit/uvedit_ops.c
===================================================================
--- trunk/blender/source/blender/editors/uvedit/uvedit_ops.c 2012-04-13 06:54:37 UTC (rev 45587)
+++ trunk/blender/source/blender/editors/uvedit/uvedit_ops.c 2012-04-13 07:18:26 UTC (rev 45588)
@@ -3001,7 +3001,9 @@
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 @@
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 @@
/*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);
More information about the Bf-blender-cvs
mailing list