[Bf-blender-cvs] [ad53f65] temp_localview_split: Add/use utility macro for removing object from local view

Julian Eisel noreply at git.blender.org
Wed Jul 27 19:09:47 CEST 2016


Commit: ad53f65b21720ccca80bc51cc440aa7376845c19
Author: Julian Eisel
Date:   Wed Jul 27 19:08:35 2016 +0200
Branches: temp_localview_split
https://developer.blender.org/rBad53f65b21720ccca80bc51cc440aa7376845c19

Add/use utility macro for removing object from local view

And correct existing macro.

===================================================================

M	source/blender/blenkernel/BKE_utildefines.h
M	source/blender/editors/object/object_relations.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h
index 7ef515d..0b261e3 100644
--- a/source/blender/blenkernel/BKE_utildefines.h
+++ b/source/blender/blenkernel/BKE_utildefines.h
@@ -52,7 +52,12 @@ extern "C" {
 /* Adjust local view info of ob to be visible if v3d is in local view */
 #define BKE_LOCALVIEW_OBJECT_ASSIGN(v3d, ob) \
 	if ((v3d)->localviewd) { \
-		(ob)->localview.viewbits = (v3d)->localviewd->viewbits; \
+		(ob)->localview.viewbits |= (v3d)->localviewd->viewbits; \
+	} (void)0
+/* Remove object from local view */
+#define BKE_LOCALVIEW_OBJECT_UNASSIGN(v3d, ob) \
+	if ((v3d)->localviewd) { \
+		(ob)->localview.viewbits &= ~(v3d)->localviewd->viewbits; \
 	} (void)0
 
 #ifdef __cplusplus
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 8cd1a9b..1dc79d4 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -87,6 +87,7 @@
 #include "BKE_speaker.h"
 #include "BKE_texture.h"
 #include "BKE_editmesh.h"
+#include "BKE_utildefines.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -1361,10 +1362,10 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
 	/* note: layers are set in bases, library objects work for this */
 	CTX_DATA_BEGIN (C, Base *, base, selected_bases)
 	{
-		/* Move out of local view and deselect */
+		/* Move object out of local view and deselect */
 		/* TODO maybe this can be done a bit nicer? */
 		if (v3d && v3d->localviewd) {
-			base->object->localview.viewbits &= ~v3d->localviewd->viewbits;
+			BKE_LOCALVIEW_OBJECT_UNASSIGN(v3d, base->object);
 			base->object->flag &= ~SELECT;
 			base->flag &= ~SELECT;
 		}




More information about the Bf-blender-cvs mailing list