diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-12-21 18:29:14 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-12-21 18:43:24 +0300 |
commit | b89f2276e502da6480b4ceeb414b0e6b79e4edfe (patch) | |
tree | 77d5756979af9137e645fcdfc3fff5dc36702b4a /source/blender/depsgraph/DEG_depsgraph_query.h | |
parent | 103dd660573bb77b8917387bb2773a96de56fb38 (diff) |
Implement duplicator viewport/render visibility options
This allows a duplicator (as known as dupli parent) to be in a visible
collection so its duplicated objects are visible, however while being
invisible for the final render.
An object that is a particle emitter is also considered a duplicator.
Many thanks for the reviewers for the extense feedback.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D2966
Diffstat (limited to 'source/blender/depsgraph/DEG_depsgraph_query.h')
-rw-r--r-- | source/blender/depsgraph/DEG_depsgraph_query.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph_query.h b/source/blender/depsgraph/DEG_depsgraph_query.h index c782a91f76e..83fb100436c 100644 --- a/source/blender/depsgraph/DEG_depsgraph_query.h +++ b/source/blender/depsgraph/DEG_depsgraph_query.h @@ -77,12 +77,18 @@ enum { DEG_ITER_OBJECT_FLAG_DUPLI = (1 << 4), }; +typedef enum eDepsObjectIteratorMode { + DEG_ITER_OBJECT_MODE_VIEWPORT = 0, + DEG_ITER_OBJECT_MODE_RENDER = 1, +} eDepsObjectIteratorMode; + typedef struct DEGObjectIterData { struct Depsgraph *graph; struct Scene *scene; struct EvaluationContext eval_ctx; int flag; + eDepsObjectIteratorMode mode; /* **** Iteration over dupli-list. *** */ @@ -115,10 +121,11 @@ void DEG_iterator_objects_end(struct BLI_Iterator *iter); * Although they are available they have no overrides (collection_properties) * and will crash if you try to access it. */ -#define DEG_OBJECT_ITER(graph_, instance_, flag_) \ +#define DEG_OBJECT_ITER(graph_, instance_, mode_, flag_) \ { \ DEGObjectIterData data_ = { \ .graph = (graph_), \ + .mode = (mode_), \ .flag = (flag_), \ }; \ \ @@ -134,8 +141,8 @@ void DEG_iterator_objects_end(struct BLI_Iterator *iter); /** * Depsgraph objects iterator for draw manager and final render */ -#define DEG_OBJECT_ITER_FOR_RENDER_ENGINE(graph_, instance_) \ - DEG_OBJECT_ITER(graph_, instance_, \ +#define DEG_OBJECT_ITER_FOR_RENDER_ENGINE(graph_, instance_, mode_) \ + DEG_OBJECT_ITER(graph_, instance_, mode_, \ DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | \ DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET | \ DEG_ITER_OBJECT_FLAG_VISIBLE | \ |