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-08-19 20:25:29 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-09-13 18:37:35 +0300
commit92736a7b75920ffe4b8016a2d097ff8e36687c70 (patch)
tree33594ff97ce96124481ce9d898ea31158f91236c /source/blender/makesdna
parentce34a6b0d727bbde6ae373afa8ec6c42bc8980ce (diff)
Per-Viewport Collection Visibility
Support per-viewport collection visibility options. Note 1: There is no way to show a collection that was not visible before due to depsgraph. Otherwise we would risk having all the collections in the depsgraph and I believe this is not the idea. An alternative would be to have a new depsgraph for viewports that are not local. Something to keep in mind if we do per-viewport current frame in the future. So for now what we do is to only allow collections visibility to be disabled/hidden in this mode. Note 2: hide_viewport (the eye icon) doesn't really matter for depsgraph. So after the merge we can still ignore it to show the collections locally in a viewport with no problems for the depsgraph. Reviewers: brecht, sergey Subscribers: billreynish Related task: T61327 Differential Revision: https://developer.blender.org/D5611
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_layer_types.h6
-rw-r--r--source/blender/makesdna/DNA_object_types.h3
-rw-r--r--source/blender/makesdna/DNA_scene_types.h2
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h4
4 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_layer_types.h b/source/blender/makesdna/DNA_layer_types.h
index 5f64e3220b7..3af1da46f80 100644
--- a/source/blender/makesdna/DNA_layer_types.h
+++ b/source/blender/makesdna/DNA_layer_types.h
@@ -45,6 +45,8 @@ typedef struct Base {
struct Object *object;
unsigned int lay DNA_DEPRECATED;
int flag_legacy;
+ unsigned short local_collections_bits;
+ short _pad2[3];
/* Pointer to an original base. Is initialized for evaluated view layer.
* NOTE: Only allowed to be accessed from within active dependency graph. */
@@ -66,8 +68,12 @@ typedef struct LayerCollection {
short flag;
short runtime_flag;
char _pad[4];
+
/** Synced with collection->children. */
ListBase layer_collections;
+
+ unsigned short local_collections_bits;
+ short _pad2[3];
} LayerCollection;
typedef struct ViewLayer {
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index b4d65aa7ea9..82a90dfe7a2 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -183,7 +183,8 @@ typedef struct Object_Runtime {
/** Runtime grease pencil evaluated data created by modifiers */
struct bGPDframe *gpencil_evaluated_frames;
- void *_pad2; /* Padding is here for win32s unconventional struct alignment rules. */
+ unsigned short local_collections_bits;
+ short _pad2[3];
} Object_Runtime;
typedef struct Object {
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 3334b1eafe8..ca572f1ddf1 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1979,6 +1979,8 @@ extern const char *RE_engine_id_CYCLES;
#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))
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 106bf1252b2..10c61446d9d 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -266,6 +266,8 @@ typedef struct View3D {
unsigned short local_view_uuid;
char _pad6[2];
int layact DNA_DEPRECATED;
+ unsigned short local_collections_uuid;
+ short _pad7[3];
/** Optional bool for 3d cursor to define center. */
short ob_centre_cursor;
@@ -329,7 +331,7 @@ typedef struct View3D {
#define V3D_S3D_DISPVOLUME (1 << 2)
/** #View3D.flag */
-#define V3D_FLAG_UNUSED_0 (1 << 0) /* cleared */
+#define V3D_LOCAL_COLLECTIONS (1 << 0)
#define V3D_FLAG_UNUSED_1 (1 << 1) /* cleared */
#define V3D_HIDE_HELPLINES (1 << 2)
#define V3D_INVALID_BACKBUF (1 << 3)