88 const char *name_custom);
134 const char *newname);
171 uint duplicate_options);
175#define BKE_SCENE_COLLECTION_NAME "Scene Collection"
306 const int id_create_flag);
328 Scene **r_scene =
nullptr);
422#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(_collection, _object, _mode) \
424 int _base_flag = (_mode == DAG_EVAL_VIEWPORT) ? BASE_ENABLED_VIEWPORT : BASE_ENABLED_RENDER; \
425 int _object_visibility_flag = (_mode == DAG_EVAL_VIEWPORT) ? OB_HIDE_VIEWPORT : \
428 for (Base *_base = static_cast<Base *>(BKE_collection_object_cache_get(_collection).first); \
430 _base = _base->next, _base_id++) \
432 Object *_object = _base->object; \
433 if ((_base->flag & _base_flag) && \
434 (_object->visibility_flag & _object_visibility_flag) == 0) {
436#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END \
442#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object) \
443 for (Base *_base = static_cast<Base *>(BKE_collection_object_cache_get(_collection).first); \
445 _base = _base->next) \
447 Object *_object = _base->object; \
448 BLI_assert(_object != NULL);
450#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END \
492#define FOREACH_SCENE_COLLECTION_BEGIN(scene, _instance) \
493 ITER_BEGIN (BKE_scene_collections_iterator_begin, \
494 BKE_scene_collections_iterator_next, \
495 BKE_scene_collections_iterator_end, \
500#define FOREACH_SCENE_COLLECTION_END ITER_END
502#define FOREACH_COLLECTION_BEGIN(_bmain, _scene, Type, _instance) \
505 Collection *_instance_next; \
506 bool is_scene_collection = (_scene) != NULL; \
509 _instance_next = (_scene)->master_collection; \
512 _instance_next = static_cast<Collection *>((_bmain)->collections.first); \
515 while ((_instance = _instance_next)) { \
516 if (is_scene_collection) { \
517 _instance_next = static_cast<Collection *>((_bmain)->collections.first); \
518 is_scene_collection = false; \
521 _instance_next = static_cast<Collection *>(_instance->id.next); \
524#define FOREACH_COLLECTION_END \
529#define FOREACH_SCENE_OBJECT_BEGIN(scene, _instance) \
530 ITER_BEGIN (BKE_scene_objects_iterator_begin, \
531 BKE_scene_objects_iterator_next, \
532 BKE_scene_objects_iterator_end, \
537#define FOREACH_SCENE_OBJECT_END ITER_END
bool BKE_collection_object_remove(Main *bmain, Collection *collection, Object *ob, bool free_us)
bool BKE_collection_has_object_recursive_instanced(Collection *collection, Object *ob)
void BKE_scene_objects_iterator_begin_ex(BLI_Iterator *iter, void *data_in)
void BKE_scene_objects_iterator_next_ex(BLI_Iterator *iter)
Collection * BKE_collection_master_add(Scene *scene)
void BKE_collection_exporter_remove(Collection *collection, CollectionExport *data)
void BKE_collection_object_cache_free(const Main *bmain, Collection *collection, const int id_create_flag)
bool BKE_collection_has_object_recursive(Collection *collection, Object *ob)
CollectionChild * BKE_collection_child_find(Collection *parent, Collection *collection)
void(*)(Collection *ob, void *data) BKE_scene_collections_Cb
void BKE_collection_add_from_collection(Main *bmain, Scene *scene, Collection *collection_src, Collection *collection_dst)
const char * BKE_collection_ui_name_get(Collection *collection)
void BKE_collection_exporter_free_data(CollectionExport *data)
bool BKE_scene_collections_object_remove(Main *bmain, Scene *scene, Object *ob, bool free_us)
bool BKE_collection_has_object_recursive_instanced_orig_id(Collection *collection_eval, Object *object_eval)
void BKE_collection_blend_write_nolib(BlendWriter *writer, Collection *collection)
bool BKE_collection_child_remove(Main *bmain, Collection *parent, Collection *child)
bool BKE_collection_viewlayer_object_add(Main *bmain, const ViewLayer *view_layer, Collection *collection, Object *ob)
void BKE_scene_collections_iterator_next(BLI_Iterator *iter)
Collection * BKE_collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)
bool BKE_collection_has_object(Collection *collection, const Object *ob)
ListBase BKE_collection_object_cache_instanced_get(Collection *collection)
void BKE_collections_object_remove_invalids(Main *bmain)
Base * BKE_collection_or_layer_objects(const Scene *scene, ViewLayer *view_layer, Collection *collection)
void BKE_scene_objects_iterator_end(BLI_Iterator *iter)
bool BKE_collection_object_replace(Main *bmain, Collection *collection, Object *ob_old, Object *ob_new)
bool BKE_collection_is_empty(const Collection *collection)
Collection * BKE_collection_duplicate(Main *bmain, Collection *parent, CollectionChild *child_old, Collection *collection, eDupli_ID_Flags duplicate_flags, uint duplicate_options)
bool BKE_collection_move(Main *bmain, Collection *to_parent, Collection *from_parent, Collection *relative, bool relative_after, Collection *collection)
bool BKE_collection_is_in_scene(Collection *collection)
bool BKE_collection_child_add(Main *bmain, Collection *parent, Collection *child)
void BKE_collection_object_move(Main *bmain, Scene *scene, Collection *collection_dst, Collection *collection_src, Object *ob)
void BKE_collection_blend_write_prepare_nolib(BlendWriter *writer, Collection *collection)
Collection * BKE_collection_from_session_uid(Scene *scene, uint64_t session_uid)
void BKE_collection_add_from_object(Main *bmain, Scene *scene, const Object *ob_src, Collection *collection_dst)
bool BKE_collection_exporter_move(Collection *collection, const int from, const int to)
void BKE_collections_child_remove_nulls(Main *bmain, Collection *parent_collection, Collection *child_collection)
void BKE_collection_exporter_name_set(const ListBase *exporters, CollectionExport *data, const char *newname)
GSet * BKE_scene_objects_as_gset(Scene *scene, GSet *objects_gset)
bool BKE_collection_validate(Collection *collection)
CollectionExport * BKE_collection_exporter_add(Collection *collection, char *idname, char *label)
bool BKE_collection_child_add_no_sync(Main *bmain, Collection *parent, Collection *child)
void BKE_scene_collections_iterator_begin(BLI_Iterator *iter, void *data_in)
void BKE_collection_free_data(Collection *collection)
void(*)(Object *ob, void *data) BKE_scene_objects_Cb
bool BKE_collection_contains_geometry_recursive(const Collection *collection)
void BKE_main_collections_object_cache_free(const Main *bmain)
Collection * BKE_collection_object_find(Main *bmain, Scene *scene, Collection *collection, Object *ob)
void BKE_scene_collections_iterator_end(BLI_Iterator *iter)
bool BKE_collection_cycles_fix(Main *bmain, Collection *collection)
bool BKE_collection_object_add_notest(Main *bmain, Collection *collection, Object *ob)
void BKE_scene_objects_iterator_end_ex(BLI_Iterator *iter)
void BKE_collection_object_add_from(Main *bmain, Scene *scene, Object *ob_src, Object *ob_dst)
Collection * BKE_collection_parent_editable_find_recursive(const ViewLayer *view_layer, Collection *collection)
bool BKE_collection_delete(Main *bmain, Collection *collection, bool hierarchy)
bool BKE_collection_cycle_find(Collection *new_ancestor, Collection *collection)
bool BKE_collection_object_cyclic_check(Main *bmain, Object *object, Collection *collection)
void BKE_collections_after_lib_link(Main *bmain)
bool BKE_collection_has_collection(const Collection *parent, const Collection *collection)
ListBase BKE_collection_object_cache_get(Collection *collection)
void BKE_collection_blend_read_data(BlendDataReader *reader, Collection *collection, ID *owner_id)
void BKE_scene_objects_iterator_begin(BLI_Iterator *iter, void *data_in)
void BKE_collection_parent_relations_rebuild(Collection *collection)
bool BKE_collection_objects_select(const Scene *scene, ViewLayer *view_layer, Collection *collection, bool deselect)
void BKE_scene_objects_iterator_next(BLI_Iterator *iter)
void BKE_collection_new_name_get(Collection *collection_parent, char r_name[256])
void BKE_main_collections_parent_relations_rebuild(Main *bmain)
@ COLLECTION_TAG_COLLECTION_OBJECT_DIRTY
@ COLLECTION_TAG_RELATION_REBUILD
bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob)
These structs are the foundation for all linked lists in the library system.
BMesh const char void * data
unsigned long long int uint64_t
struct CollectionParent * prev
struct Collection * collection
struct CollectionParent * next
ListBase object_cache_instanced