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-23 19:41:38 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-11-23 20:13:14 +0300
commit9be5b2d23fb46a7da22d16decd044324ed8d4e78 (patch)
treec486399ce5c7c2b46cd9aceca7dfba272d8eb598 /source/blender/makesdna/DNA_scene_types.h
parent0d0c79e879fe0c7bf1f1d47968c11578a05db7cf (diff)
Pass viewport to BASE_ related tests, for viewport view/select restrictions
Note: functions like select all are still not respecting that. I will fix this as part of the local view commit though.
Diffstat (limited to 'source/blender/makesdna/DNA_scene_types.h')
-rw-r--r--source/blender/makesdna/DNA_scene_types.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 029e8765c8d..cb72d83e10b 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1805,24 +1805,31 @@ extern const char *RE_engine_id_CYCLES;
#define MINAFRAMEF -1048574.0f
/* deprecate this! */
-#define TESTBASE(base) ( \
+#define TESTBASE(v3d, base) ( \
+ (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0) && \
(((base)->flag & BASE_SELECTED) != 0) && \
(((base)->flag & BASE_VISIBLE) != 0))
-#define TESTBASELIB(base) ( \
+#define TESTBASELIB(v3d, base) ( \
+ (((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(base) ( \
+#define TESTBASELIB_BGMODE(v3d, base) ( \
+ ((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(base) ( \
+#define BASE_EDITABLE_BGMODE(v3d, base) ( \
+ ((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(base) \
- (((base)->flag & BASE_SELECTABLE) != 0)
-#define BASE_VISIBLE(base) ( \
- ((base)->flag & BASE_VISIBLE) != 0)
+#define BASE_SELECTABLE(v3d, base) ( \
+ (((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) ( \
+ (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0) && \
+ (((base)->flag & BASE_VISIBLE) != 0))
#define FIRSTBASE(_view_layer) ((_view_layer)->object_bases.first)
#define LASTBASE(_view_layer) ((_view_layer)->object_bases.last)