Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_layer.c
| Context not available. | |||||
| static bool rna_LayerCollection_visible_get(LayerCollection *layer_collection, bContext *C) | static bool rna_LayerCollection_visible_get(LayerCollection *layer_collection, bContext *C) | ||||
| { | { | ||||
| View3D *v3d = CTX_wm_view3d(C); | View3D *v3d = CTX_wm_view3d(C); | ||||
| const bool runtime_visible = (layer_collection->runtime_flag & LAYER_COLLECTION_VISIBLE) != 0; | |||||
| if ((v3d == NULL) || ((v3d->flag & V3D_LOCAL_COLLECTIONS) == 0)) { | if (v3d == NULL) { | ||||
| return (layer_collection->runtime_flag & LAYER_COLLECTION_VISIBLE_VIEW_LAYER) != 0; | return runtime_visible; | ||||
| } | |||||
| if ((v3d->flag & V3D_LOCAL_COLLECTIONS) == 0) { | |||||
| return runtime_visible; | |||||
| } | } | ||||
| if (v3d->local_collections_uuid & layer_collection->local_collections_bits) { | if (v3d->local_collections_uuid & layer_collection->local_collections_bits) { | ||||
| return (layer_collection->runtime_flag & LAYER_COLLECTION_RESTRICT_VIEWPORT) == 0; | return true; | ||||
| } | } | ||||
| return false; | return false; | ||||
| Context not available. | |||||
| /* Run-time flags. */ | /* Run-time flags. */ | ||||
| prop = RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "runtime_flag", LAYER_COLLECTION_VISIBLE_VIEW_LAYER); | RNA_def_property_boolean_sdna(prop, NULL, "runtime_flag", LAYER_COLLECTION_VISIBLE); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, | RNA_def_property_ui_text( | ||||
| "Visible", | prop, | ||||
| "Whether this collection is visible for the viewlayer, take into " | "Visible", | ||||
| "account the collection parent"); | "Whether this collection is visible, take into account the collection parent"); | ||||
| func = RNA_def_function(srna, "has_objects", "rna_LayerCollection_has_objects"); | func = RNA_def_function(srna, "has_objects", "rna_LayerCollection_has_objects"); | ||||
| RNA_def_function_ui_description(func, ""); | RNA_def_function_ui_description(func, ""); | ||||
| Context not available. | |||||