diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-11-15 23:25:45 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-11-16 02:01:01 +0300 |
commit | 98765e370093e088022145e841421f7a7e1da368 (patch) | |
tree | 721ec20a7c0543dbdcb29f3494806ad9e50b1a21 /source/blender/makesrna/intern/rna_layer.c | |
parent | bf7af31e9f7c0177c1d390ab77804f8d556e0e56 (diff) |
RNA: LayerCollection.has_hidden_objects
With this we have a way to tell that a collection has visible objects
but not all of its objects are visible.
Diffstat (limited to 'source/blender/makesrna/intern/rna_layer.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_layer.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index ffa48df010d..46d1f5bef7d 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -232,6 +232,16 @@ static bool rna_LayerCollection_has_visible_objects(LayerCollection *lc, ViewLay return true; } +static bool rna_LayerCollection_has_hidden_objects(LayerCollection *lc, ViewLayer *view_layer) +{ + if ((view_layer->runtime_flag & VIEW_LAYER_HAS_HIDE) && + (lc->runtime_flag & LAYER_COLLECTION_HAS_HIDDEN_OBJECTS)) + { + return true; + } + return false; +} + static bool rna_LayerCollection_has_selected_objects(LayerCollection *lc, ViewLayer *view_layer) { return BKE_layer_collection_has_selected_objects(view_layer, lc); @@ -297,6 +307,12 @@ static void rna_def_layer_collection(BlenderRNA *brna) RNA_def_parameter_flags(prop, 0, PARM_REQUIRED); RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", "")); + func = RNA_def_function(srna, "has_hidden_objects", "rna_LayerCollection_has_hidden_objects"); + RNA_def_function_ui_description(func, ""); + prop = RNA_def_pointer(func, "view_layer", "ViewLayer", "", "ViewLayer the layer collection belongs to"); + RNA_def_parameter_flags(prop, 0, PARM_REQUIRED); + RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", "")); + func = RNA_def_function(srna, "has_selected_objects", "rna_LayerCollection_has_selected_objects"); RNA_def_function_ui_description(func, ""); prop = RNA_def_pointer(func, "view_layer", "ViewLayer", "", "ViewLayer the layer collection belongs to"); |