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>2018-11-28 05:49:36 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-02-05 23:42:02 +0300
commit3d984aa15038f7a7bdf4ffacb93da83713353613 (patch)
tree12f209375e734dd31476221fb9ce04fa32c97326 /source/blender/makesrna/intern/rna_layer.c
parentd1ef6be4a770c8b2caacc70cb93d3cf9ab52e0d9 (diff)
Per view-layer collection visibility
[re-committing] We still control this in the viewport collections visibility menu. But now we are actually changing the visibility of the collections, not of the objects. If a collection is indirectly invisible (because one of its parents are invisible) we gray it out. Also if you click directly in the collection names, it "isolates" the collection by hiding all collections, and showing the direct parents and all the children of the selected collection. Development Note: Right now I'm excluding the hidden collections from the depsgraph. Thus the need for tagging relations to update. If this proves to be too slow, we can change.
Diffstat (limited to 'source/blender/makesrna/intern/rna_layer.c')
-rw-r--r--source/blender/makesrna/intern/rna_layer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c
index fbefeb4413f..82082ec6022 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -289,6 +289,19 @@ static void rna_def_layer_collection(BlenderRNA *brna)
"in the view layer");
RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_use_update");
+ prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", LAYER_COLLECTION_RESTRICT_VIEW);
+ RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC);
+ RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
+ RNA_def_property_ui_text(prop, "Disable Viewport", "Disable collection in viewport for this view layer");
+ RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollection_use_update");
+
+ prop = RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "runtime_flag", LAYER_COLLECTION_VISIBLE);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Visible",
+ "Whether this collection is visible, take into account the collection parent");
+
func = RNA_def_function(srna, "has_objects", "rna_LayerCollection_has_objects");
RNA_def_function_ui_description(func, "");
RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", ""));