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
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2019-02-09 01:09:37 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-02-09 01:09:37 +0300
commit191b8951f7afae26117cc5386b979557b84dc437 (patch)
treee2fbdb39117f77c1856df365a0ffcf0b9b2b3626 /source/blender/editors/space_outliner
parente04d6794d017b82f33a893bfc959cebd909d3176 (diff)
Outliner visibility: Prevent changing linked objects and collections
We still change their base/layer collection visibility, just not what would change the original ID datablock.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.c4
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c26
2 files changed, 21 insertions, 9 deletions
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index a07fe4b9e15..92c68681a54 100644
--- a/source/blender/editors/space_outliner/outliner_collections.c
+++ b/source/blender/editors/space_outliner/outliner_collections.c
@@ -1065,7 +1065,9 @@ static int collection_flag_exec(bContext *C, wmOperator *op)
GSET_ITER(collections_to_edit_iter, data.collections_to_edit) {
LayerCollection *layer_collection = BLI_gsetIterator_getKey(&collections_to_edit_iter);
Collection *collection = layer_collection->collection;
-
+ if (collection->id.lib != NULL) {
+ continue;
+ }
if (clear) {
collection->flag &= ~flag;
}
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 1b7ec4cb722..5ab06fabb89 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -276,13 +276,16 @@ static void hidebutton_base_flag_cb(bContext *C, void *poin, void *poin2)
bool do_isolate = (win->eventstate->ctrl != 0) && !do_disable;
bool extend = (win->eventstate->shift != 0);
bool depsgraph_changed = false;
+ const bool is_editable = BASE_EDITABLE((View3D *)NULL, base);
if (do_disable) {
- ob->restrictflag |= OB_RESTRICT_VIEW;
- depsgraph_changed = true;
+ if (is_editable) {
+ ob->restrictflag |= OB_RESTRICT_VIEW;
+ depsgraph_changed = true;
+ }
}
else if (do_isolate) {
- depsgraph_changed = (ob->restrictflag & OB_RESTRICT_VIEW) != 0;
+ depsgraph_changed = is_editable && ((ob->restrictflag & OB_RESTRICT_VIEW) != 0);
if (!extend) {
/* Make only one base visible. */
@@ -296,11 +299,16 @@ static void hidebutton_base_flag_cb(bContext *C, void *poin, void *poin2)
/* Toggle visibility of one base. */
base->flag ^= BASE_HIDDEN;
}
- ob->restrictflag &= ~OB_RESTRICT_VIEW;
+
+ if (is_editable) {
+ ob->restrictflag &= ~OB_RESTRICT_VIEW;
+ }
}
else if (ob->restrictflag & OB_RESTRICT_VIEW) {
- ob->restrictflag &= ~OB_RESTRICT_VIEW;
- base->flag &= ~BASE_HIDDEN;
+ if (is_editable) {
+ ob->restrictflag &= ~OB_RESTRICT_VIEW;
+ base->flag &= ~BASE_HIDDEN;
+ }
depsgraph_changed = true;
}
else {
@@ -334,8 +342,10 @@ static void hidebutton_layer_collection_flag_cb(bContext *C, void *poin, void *p
bool depsgraph_changed = false;
if (do_disable) {
- collection->flag |= COLLECTION_RESTRICT_VIEW;
- depsgraph_changed = true;
+ if (collection->id.lib == NULL) {
+ collection->flag |= COLLECTION_RESTRICT_VIEW;
+ depsgraph_changed = true;
+ }
}
else if (do_isolate) {
depsgraph_changed |= BKE_layer_collection_isolate(scene, view_layer, lc, extend);