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-10-04 01:22:36 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-10-09 01:16:05 +0300
commit0812949bbc3d7acfd1f20a47087ff973110aa177 (patch)
tree0ec8a52ea73790d85f4b14993de3c252e9fa6de5 /source/blender/makesdna
parent6d3c34fe9d1eabc7765275ff68600734be0e3acb (diff)
Local Collections: Allow users to show hidden collections
Users now can turn on in a viewport collections that are temporarily hidden (eye) in the view layer. Design task: T61327 As for the implementation, I had to decouple the visibility in the depsgraph from the visibility in the view layer. Also there is a "bug" that in a way was there before which is some operators (e.g., writing a text inside of a text object, tab into edit mode) run regardless of the visibility of the active object. The bug was present already (with object type visibility restriction) in 2.80 so if we decide to tackle it, can be done separately (I have a patch for it though P1132). Reviewed by: brecht (thank you) Differential Revision: D5992
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_layer_types.h21
-rw-r--r--source/blender/makesdna/DNA_scene_types.h9
2 files changed, 13 insertions, 17 deletions
diff --git a/source/blender/makesdna/DNA_layer_types.h b/source/blender/makesdna/DNA_layer_types.h
index 3af1da46f80..4de98e0b684 100644
--- a/source/blender/makesdna/DNA_layer_types.h
+++ b/source/blender/makesdna/DNA_layer_types.h
@@ -118,13 +118,13 @@ enum {
BASE_HIDDEN = (1 << 8), /* Object is hidden for editing. */
/* Runtime evaluated flags. */
- BASE_VISIBLE = (1 << 1), /* Object is enabled and visible. */
- BASE_SELECTABLE = (1 << 2), /* Object can be selected. */
- BASE_FROM_DUPLI = (1 << 3), /* Object comes from duplicator. */
- /* BASE_DEPRECATED = (1 << 4), */
- BASE_FROM_SET = (1 << 5), /* Object comes from set. */
- BASE_ENABLED_VIEWPORT = (1 << 6), /* Object is enabled in viewport. */
- BASE_ENABLED_RENDER = (1 << 7), /* Object is enabled in final render */
+ BASE_VISIBLE_DEPSGRAPH = (1 << 1), /* Object is enabled and visible for the depsgraph. */
+ BASE_SELECTABLE = (1 << 2), /* Object can be selected. */
+ BASE_FROM_DUPLI = (1 << 3), /* Object comes from duplicator. */
+ BASE_VISIBLE_VIEWLAYER = (1 << 4), /* Object is enabled and visible for the viewlayer. */
+ BASE_FROM_SET = (1 << 5), /* Object comes from set. */
+ BASE_ENABLED_VIEWPORT = (1 << 6), /* Object is enabled in viewport. */
+ BASE_ENABLED_RENDER = (1 << 7), /* Object is enabled in final render */
/* BASE_DEPRECATED = (1 << 9), */
BASE_HOLDOUT = (1 << 10), /* Object masked out from render */
BASE_INDIRECT_ONLY = (1 << 11), /* Object only contributes indirectly to render */
@@ -142,10 +142,13 @@ enum {
LAYER_COLLECTION_HIDE = (1 << 7),
};
-/* Layer Collection->runtime_flag */
+/* Layer Collection->runtime_flag
+ Keep it synced with base->flag based on g_base_collection_flags. */
enum {
LAYER_COLLECTION_HAS_OBJECTS = (1 << 0),
- LAYER_COLLECTION_VISIBLE = (1 << 1),
+ LAYER_COLLECTION_VISIBLE_DEPSGRAPH = (1 << 1),
+ LAYER_COLLECTION_RESTRICT_VIEWPORT = (1 << 2),
+ LAYER_COLLECTION_VISIBLE_VIEW_LAYER = (1 << 4),
};
/* ViewLayer->flag */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index ca572f1ddf1..8763f62b385 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1976,14 +1976,7 @@ extern const char *RE_engine_id_CYCLES;
#define MINAFRAME -1048574
#define MINAFRAMEF -1048574.0f
-#define BASE_VISIBLE(v3d, base) \
- (((v3d == NULL) || ((v3d)->localvd == NULL) || \
- ((v3d)->local_view_uuid & (base)->local_view_bits)) && \
- ((v3d == NULL) || (((v3d)->flag & V3D_LOCAL_COLLECTIONS) == 0) || \
- ((v3d)->local_collections_uuid & (base)->local_collections_bits)) && \
- ((v3d == NULL) || \
- (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0)) && \
- (((base)->flag & BASE_VISIBLE) != 0))
+#define BASE_VISIBLE(v3d, base) BKE_base_is_visible(v3d, base)
#define BASE_SELECTABLE(v3d, base) \
(BASE_VISIBLE(v3d, base) && \
((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_select) == 0)) && \