103 const char *name_custom);
134 std::string *reason =
nullptr);
161 const char *newname);
199 uint duplicate_options);
203#define BKE_SCENE_COLLECTION_NAME "Scene Collection"
226 Collection *collection,
246 const ViewLayer *view_layer,
247 Collection *collection,
271 Collection *collection,
281 Main *bmain,
Scene *scene, Collection *collection_dst, Collection *collection_src,
Object *ob);
331 Collection *parent_collection,
332 Collection *child_collection);
354 Collection *collection,
355 const int id_create_flag);
364 ViewLayer *view_layer,
365 Collection *collection);
378 Scene **r_scene =
nullptr);
465#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(_collection, _object, _mode) \
467 int _base_flag = (_mode == DAG_EVAL_VIEWPORT) ? BASE_ENABLED_VIEWPORT : BASE_ENABLED_RENDER; \
468 int _object_visibility_flag = (_mode == DAG_EVAL_VIEWPORT) ? OB_HIDE_VIEWPORT : \
470 [[maybe_unused]] int _base_id = 0; \
471 for (Base *_base = BKE_collection_object_cache_get(_collection).first(); _base; \
472 _base = _base->next, _base_id++) \
474 Object *_object = _base->object; \
475 if ((_base->flag & _base_flag) && \
476 (_object->visibility_flag & _object_visibility_flag) == 0) \
479#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END \
485#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object) \
486 for (Base *_base = BKE_collection_object_cache_get(_collection).first(); _base; \
487 _base = _base->next) \
489 Object *_object = _base->object; \
490 BLI_assert(_object != NULL);
492#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END \
535#define FOREACH_SCENE_COLLECTION_BEGIN(scene, _instance) \
536 ITER_BEGIN (BKE_scene_collections_iterator_begin, \
537 BKE_scene_collections_iterator_next, \
538 BKE_scene_collections_iterator_end, \
543#define FOREACH_SCENE_COLLECTION_END ITER_END
545#define FOREACH_COLLECTION_BEGIN(_bmain, _scene, Type, _instance) \
548 Collection *_instance_next; \
549 bool is_scene_collection = (_scene) != NULL; \
552 _instance_next = (_scene)->master_collection; \
555 _instance_next = (_bmain)->collections.first(); \
558 while ((_instance = _instance_next)) { \
559 if (is_scene_collection) { \
560 _instance_next = (_bmain)->collections.first(); \
561 is_scene_collection = false; \
564 _instance_next = static_cast<Collection *>(_instance->id.next); \
567#define FOREACH_COLLECTION_END \
572#define FOREACH_SCENE_OBJECT_BEGIN(scene, _instance) \
573 ITER_BEGIN (BKE_scene_objects_iterator_begin, \
574 BKE_scene_objects_iterator_next, \
575 BKE_scene_objects_iterator_end, \
580#define FOREACH_SCENE_OBJECT_END ITER_END
Object groups, one object can be in many groups at once.
These structs are the foundation for all linked lists in the library system.
unsigned long long int uint64_t
@ COLLECTION_TAG_RELATION_REBUILD
@ COLLECTION_TAG_COLLECTION_OBJECT_DIRTY
bool BKE_collection_delete(Main *bmain, Collection *collection, bool hierarchy)
void BKE_scene_objects_iterator_end(BLI_Iterator *iter)
void BKE_scene_objects_iterator_begin(BLI_Iterator *iter, void *data_in)
bool BKE_collection_has_object_recursive_instanced(Collection *collection, Object *ob)
Collection * BKE_collection_duplicate(Main *bmain, Collection *parent, CollectionChild *child_old, Collection *collection, eDupli_ID_Flags duplicate_flags, uint duplicate_options)
bool BKE_collection_has_object_recursive_instanced_orig_id(Collection *collection_eval, Object *object_eval)
const char * BKE_collection_ui_name_get(Collection *collection)
void BKE_collections_child_remove_nulls(Main *bmain, Collection *parent_collection, Collection *child_collection)
Collection * BKE_collection_from_session_uid(Scene *scene, uint64_t session_uid)
void BKE_collection_blend_write_prepare_nolib(BlendWriter *writer, Collection *collection)
bool BKE_collection_viewlayer_object_add(Main *bmain, const ViewLayer *view_layer, Collection *collection, Object *ob)
bool BKE_collection_child_add(Main *bmain, Collection *parent, Collection *child)
void(*)(Object *ob, void *data) BKE_scene_objects_Cb
CollectionObject * BKE_collection_object_find_in(const Collection &collection, const Object &ob)
void BKE_main_collections_parent_relations_rebuild(Main *bmain)
void BKE_main_collections_object_cache_free(const Main *bmain)
bool BKE_scene_collections_object_remove(Main *bmain, Scene *scene, Object *ob, bool free_us)
void BKE_scene_collections_iterator_next(BLI_Iterator *iter)
void BKE_collection_importer_free_data(CollectionImport *data)
void BKE_collection_object_parent_clear_sort_index_reset(Main &bmain, Object &ob)
CollectionImport * BKE_collection_importer_add(Collection *collection, const char *idname)
void BKE_collection_object_cache_free(const Main *bmain, Collection *collection, const int id_create_flag)
bool BKE_collection_cycles_fix(Main *bmain, Collection *collection)
bool BKE_collection_exporter_move(Collection *collection, const int from, const int to)
bool BKE_collection_has_object(Collection *collection, const Object *ob)
bool BKE_collection_object_add_notest(Main *bmain, Collection *collection, Object *ob)
Collection * BKE_collection_object_find(Main *bmain, Scene *scene, Collection *collection, Object *ob)
void BKE_collection_free_data(Collection *collection)
bool BKE_collection_validate(Collection *collection)
void BKE_collection_object_parented_sort_index_reset(Main &bmain, Object &ob)
BMesh const char void * data
bool BKE_collection_contains_geometry_recursive(const Collection *collection)
void BKE_collection_add_from_object(Main *bmain, Scene *scene, const Object *ob_src, Collection *collection_dst)
bool BKE_collection_move(Main *bmain, Collection *to_parent, Collection *from_parent, Collection *relative, bool relative_after, Collection *collection)
void BKE_collections_object_remove_invalids(Main *bmain)
bool BKE_collection_is_in_scene(Collection *collection)
bool BKE_collection_is_empty(const Collection *collection)
bool BKE_collection_object_cyclic_check(Main *bmain, Object *object, Collection *collection)
CollectionChild * BKE_collection_child_find(Collection *parent, Collection *collection)
Base * BKE_collection_or_layer_objects(const Main &bmain, const Scene *scene, ViewLayer *view_layer, Collection *collection)
void BKE_collection_add_from_collection(Main *bmain, Scene *scene, Collection *collection_src, Collection *collection_dst)
CollectionExport * BKE_collection_exporter_add(Collection *collection, char *idname, char *label)
void BKE_collection_blend_write_nolib(BlendWriter *writer, Collection *collection)
Collection * BKE_collection_parent_editable_find_recursive(const ViewLayer *view_layer, Collection *collection)
bool BKE_collection_child_remove(Main *bmain, Collection *parent, Collection *child)
void BKE_collections_after_lib_link(Main *bmain)
void BKE_collection_object_add_from(Main *bmain, Scene *scene, Object *ob_src, Object *ob_dst)
void BKE_collection_object_move(Main *bmain, Scene *scene, Collection *collection_dst, Collection *collection_src, Object *ob)
bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob)
void BKE_scene_collections_iterator_begin(BLI_Iterator *iter, void *data_in)
bool BKE_collection_has_collection(const Collection *parent, const Collection *collection)
ListBaseT< Base > BKE_collection_object_cache_instanced_get(Collection *collection)
void BKE_scene_collections_iterator_end(BLI_Iterator *iter)
ListBaseT< Base > BKE_collection_object_cache_get(Collection *collection)
void(*)(Collection *ob, void *data) BKE_scene_collections_Cb
void BKE_scene_objects_iterator_next(BLI_Iterator *iter)
bool BKE_collection_cycle_find(Collection *new_ancestor, Collection *collection)
bool BKE_collection_child_add_no_sync(Main *bmain, Collection *parent, Collection *child)
Set< Object * > * BKE_scene_objects_as_set(Scene *scene, Set< Object * > *objects_set)
void BKE_collection_parent_relations_rebuild(Collection *collection)
bool BKE_collection_is_content_editable(const Collection *collection, std::string *reason=nullptr)
void BKE_scene_objects_iterator_next_ex(BLI_Iterator *iter)
bool BKE_collection_object_remove(Main *bmain, Collection *collection, Object *ob, bool free_us)
void BKE_collection_exporter_remove(Collection *collection, CollectionExport *data)
bool BKE_collection_object_replace(Main *bmain, Collection *collection, Object *ob_old, Object *ob_new)
Collection * BKE_collection_master_add(Scene *scene)
void BKE_collection_exporter_name_set(const ListBaseT< CollectionExport > *exporters, CollectionExport *data, const char *newname)
void BKE_scene_objects_iterator_end_ex(BLI_Iterator *iter)
void BKE_collection_exporter_free_data(CollectionExport *data)
void BKE_scene_objects_iterator_begin_ex(BLI_Iterator *iter, void *data_in)
bool BKE_collection_has_object_recursive(Collection *collection, Object *ob)
Map< const Object *, CollectionObject * > CollectionObjectMap
void BKE_collection_new_name_get(Collection *collection_parent, char r_name[256])
void BKE_collection_blend_read_data(BlendDataReader *reader, Collection *collection, ID *owner_id)
Collection * BKE_collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)
struct CollectionParent * next
struct CollectionParent * prev
struct Collection * collection
Library * archive_library
ListBaseT< Base > object_cache_instanced
ListBaseT< CollectionParent > parents
ListBaseT< Base > object_cache
CollectionObjectMap * gobject_hash