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-25 14:50:34 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-11-25 14:50:34 +0300
commit4c3ed98ca27667c3403361199096e31eaa93cce2 (patch)
tree653c568d9d0547f7ac4beb847a590912d97102c0 /source/blender/makesdna
parente60c49ecf06815039137c98f86a7198d6ee81e14 (diff)
Local View
Bring back per-viewport localview. This is based on Blender 2.79. We have a limit of 16 different local view viewports. We are using both the numpad /, as well as the regular /. Missing features: * Hack to make sure lights are always visible. * Make rendered mode with external engines to support this as well (probably just need to support this in the RNA iterators). * Support over 16 viewports by taking existing viewports out of local view. The code can use a cleanup pass in the future to unify the test to see if an object is visible (or we can use TESTBASE in more places).
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_layer_types.h2
-rw-r--r--source/blender/makesdna/DNA_object_types.h2
-rw-r--r--source/blender/makesdna/DNA_scene_types.h6
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h3
4 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_layer_types.h b/source/blender/makesdna/DNA_layer_types.h
index e363c0c54b2..c3e819c5538 100644
--- a/source/blender/makesdna/DNA_layer_types.h
+++ b/source/blender/makesdna/DNA_layer_types.h
@@ -37,7 +37,7 @@ extern "C" {
typedef struct Base {
struct Base *next, *prev;
short flag;
- short pad;
+ unsigned short local_view_bits;
short sx, sy;
struct Object *object;
unsigned int lay DNA_DEPRECATED;
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 22b878ebac6..631bb26feec 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -245,7 +245,7 @@ typedef struct Object {
/* Depsgraph */
short base_flag; /* used by depsgraph, flushed from base */
- short pad8;
+ unsigned short base_local_view_bits; /* used by viewport, synced from base */
/** Collision mask settings */
unsigned short col_group, col_mask;
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index cb72d83e10b..92a1d6309ea 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1806,28 +1806,34 @@ extern const char *RE_engine_id_CYCLES;
/* deprecate this! */
#define TESTBASE(v3d, base) ( \
+ (((v3d)->localvd == NULL) || ((v3d)->local_view_uuid & (base)->local_view_bits)) && \
(((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0) && \
(((base)->flag & BASE_SELECTED) != 0) && \
(((base)->flag & BASE_VISIBLE) != 0))
#define TESTBASELIB(v3d, base) ( \
+ (((v3d)->localvd == NULL) || ((v3d)->local_view_uuid & (base)->local_view_bits)) && \
(((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0) && \
(((base)->flag & BASE_SELECTED) != 0) && \
((base)->object->id.lib == NULL) && \
(((base)->flag & BASE_VISIBLE) != 0))
#define TESTBASELIB_BGMODE(v3d, base) ( \
+ ((v3d == NULL) || ((v3d)->localvd == NULL) || ((v3d)->local_view_uuid & (base)->local_view_bits)) && \
((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0)) && \
(((base)->flag & BASE_SELECTED) != 0) && \
((base)->object->id.lib == NULL) && \
(((base)->flag & BASE_VISIBLE) != 0))
#define BASE_EDITABLE_BGMODE(v3d, base) ( \
+ ((v3d == NULL) || ((v3d)->localvd == NULL) || ((v3d)->local_view_uuid & (base)->local_view_bits)) && \
((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0)) && \
((base)->object->id.lib == NULL) && \
(((base)->flag & BASE_VISIBLE) != 0))
#define BASE_SELECTABLE(v3d, base) ( \
+ (((v3d)->localvd == NULL) || ((v3d)->local_view_uuid & (base)->local_view_bits)) && \
(((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0) && \
(((1 << (base)->object->type) & (v3d)->object_type_exclude_select) == 0) && \
(((base)->flag & BASE_SELECTABLE) != 0))
#define BASE_VISIBLE(v3d, base) ( \
+ (((v3d)->localvd == NULL) || ((v3d)->local_view_uuid & (base)->local_view_bits)) && \
(((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 e778edff52e..b6d7fde7dfc 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -232,7 +232,8 @@ typedef struct View3D {
char ob_centre_bone[64]; /* optional string for armature bone to define center, MAXBONENAME */
- unsigned int lay DNA_DEPRECATED;
+ unsigned short local_view_uuid;
+ short _pad6;
int layact DNA_DEPRECATED;
short ob_centre_cursor; /* optional bool for 3d cursor to define center */