[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59878] trunk/blender/source/blender/ editors/space_outliner/outliner_draw.c: Fix #36672: outliner allowed to toggle linked group visibility, which should not

Brecht Van Lommel brechtvanlommel at pandora.be
Fri Sep 6 14:11:16 CEST 2013


Revision: 59878
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59878
Author:   blendix
Date:     2013-09-06 12:11:15 +0000 (Fri, 06 Sep 2013)
Log Message:
-----------
Fix #36672: outliner allowed to toggle linked group visibility, which should not
be allowed because this is linked data, so any changes would not be saved.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_outliner/outliner_draw.c

Modified: trunk/blender/source/blender/editors/space_outliner/outliner_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_draw.c	2013-09-06 11:47:28 UTC (rev 59877)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_draw.c	2013-09-06 12:11:15 UTC (rev 59878)
@@ -363,6 +363,9 @@
 
 	if (group_restrict_flag(gr, flag)) {
 		for (gob = gr->gobject.first; gob; gob = gob->next) {
+			if (gob->ob->id.lib)
+				continue;
+
 			gob->ob->restrictflag &= ~flag;
 			
 			if (flag == OB_RESTRICT_VIEW)
@@ -372,6 +375,9 @@
 	}
 	else {
 		for (gob = gr->gobject.first; gob; gob = gob->next) {
+			if (gob->ob->id.lib)
+				continue;
+
 			/* not in editmode */
 			if (scene->obedit != gob->ob) {
 				gob->ob->restrictflag |= flag;
@@ -565,7 +571,11 @@
 			}
 			if (tselem->type == 0 && te->idcode == ID_GR) {
 				int restrict_bool;
+				int but_flag = UI_BUT_DRAG_LOCK;
 				gr = (Group *)tselem->id;
+
+				if(gr->id.lib)
+					but_flag |= UI_BUT_DISABLED;
 				
 				uiBlockSetEmboss(block, UI_EMBOSSN);
 
@@ -574,21 +584,21 @@
 				                  (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), te->ys, UI_UNIT_X, UI_UNIT_Y,
 				                  NULL, 0, 0, 0, 0, TIP_("Restrict/Allow visibility in the 3D View"));
 				uiButSetFunc(bt, restrictbutton_gr_restrict_view, scene, gr);
-				uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
+				uiButSetFlag(bt, but_flag);
 
 				restrict_bool = group_restrict_flag(gr, OB_RESTRICT_SELECT);
 				bt = uiDefIconBut(block, ICONTOG, 0, restrict_bool ? ICON_RESTRICT_SELECT_ON : ICON_RESTRICT_SELECT_OFF,
 				                  (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_SELECTX), te->ys, UI_UNIT_X, UI_UNIT_Y,
 				                  NULL, 0, 0, 0, 0, TIP_("Restrict/Allow selection in the 3D View"));
 				uiButSetFunc(bt, restrictbutton_gr_restrict_select, scene, gr);
-				uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
+				uiButSetFlag(bt, but_flag);
 
 				restrict_bool = group_restrict_flag(gr, OB_RESTRICT_RENDER);
 				bt = uiDefIconBut(block, ICONTOG, 0, restrict_bool ? ICON_RESTRICT_RENDER_ON : ICON_RESTRICT_RENDER_OFF,
 				                  (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_RENDERX), te->ys, UI_UNIT_X, UI_UNIT_Y,
 				                  NULL, 0, 0, 0, 0, TIP_("Restrict/Allow renderability"));
 				uiButSetFunc(bt, restrictbutton_gr_restrict_render, scene, gr);
-				uiButSetFlag(bt, UI_BUT_DRAG_LOCK);
+				uiButSetFlag(bt, but_flag);
 
 				uiBlockSetEmboss(block, UI_EMBOSS);
 			}




More information about the Bf-blender-cvs mailing list