From 0fd100edd4a7c9b85a4db237f713eb45e8d2d013 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 6 Sep 2013 12:11:15 +0000 Subject: 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. --- source/blender/editors/space_outliner/outliner_draw.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 6200b98350f..349d644310b 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -363,6 +363,9 @@ void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag) 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 @@ void restrictbutton_gr_restrict_flag(void *poin, void *poin2, int flag) } 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 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar } 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 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar (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); } -- cgit v1.2.3