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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-08 20:26:46 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-12 23:36:43 +0300
commit77879ac038e3576eeeeb651ce78706cb95399098 (patch)
treee3816728abb2e98b92c4c639f356afba0a8dd3b6 /source/blender/blenkernel/BKE_collection.h
parent6700c02e53ed02fbabc36cd6763f65f74e2ab304 (diff)
Fix T55376: instanced collection render visibility ignored.
For physics simulation it's still fuzzy though, but this needs bigger design for how it works with view layers and visibility.
Diffstat (limited to 'source/blender/blenkernel/BKE_collection.h')
-rw-r--r--source/blender/blenkernel/BKE_collection.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/source/blender/blenkernel/BKE_collection.h b/source/blender/blenkernel/BKE_collection.h
index fc5b19ccb4f..7dce3b2c703 100644
--- a/source/blender/blenkernel/BKE_collection.h
+++ b/source/blender/blenkernel/BKE_collection.h
@@ -90,14 +90,13 @@ void BKE_collections_child_remove_nulls(struct Main *bmain, struct Collection *o
bool BKE_collection_is_in_scene(struct Collection *collection);
void BKE_collections_after_lib_link(struct Main *bmain);
bool BKE_collection_object_cyclic_check(struct Main *bmain, struct Object *object, struct Collection *collection);
-bool BKE_collection_is_animated(struct Collection *collection, struct Object *parent);
/* Object list cache. */
struct ListBase BKE_collection_object_cache_get(struct Collection *collection);
void BKE_collection_object_cache_free(struct Collection *collection);
-struct Base *BKE_collection_or_layer_objects(struct Depsgraph *depsgraph,
+struct Base *BKE_collection_or_layer_objects(const struct Depsgraph *depsgraph,
const struct Scene *scene,
const struct ViewLayer *view_layer,
struct Collection *collection);
@@ -139,13 +138,21 @@ void BKE_scene_objects_callback(struct Scene *scene, BKE_scene_objects_Cb callba
/* Iteratorion over objects in collection. */
-#define FOREACH_COLLECTION_BASE_RECURSIVE_BEGIN(_collection, _base) \
- for (Base *_base = (Base*)BKE_collection_object_cache_get(_collection).first; \
- _base; \
- _base = _base->next) \
- {
-
-#define FOREACH_COLLECTION_BASE_RECURSIVE_END \
+#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(_collection, _object, _mode) \
+ { \
+ int _base_flag = (_mode == DAG_EVAL_VIEWPORT) ? \
+ BASE_VISIBLE_VIEWPORT : BASE_VISIBLE_RENDER; \
+ int _base_id = 0; \
+ for (Base *_base = (Base*)BKE_collection_object_cache_get(_collection).first; \
+ _base; \
+ _base = _base->next, _base_id++) \
+ { \
+ if (_base->flag & _base_flag) { \
+ Object *_object = _base->object; \
+
+#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END \
+ } \
+ } \
}
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object) \