10#define DNA_DEPRECATED_ALLOW
14#include <fmt/format.h>
76 Collection *collection,
77 const CollectionLightLinking *light_linking,
78 const int id_create_flag,
83 Collection *collection,
84 const int id_create_flag);
87 Collection *collection,
89 CollectionLightLinking *light_linking,
90 const int id_create_flag,
95 Collection *collection,
96 CollectionObject *cob,
97 const int id_create_flag,
101 Main *bmain, Collection *collection,
Object *ob,
const int id_create_flag,
const bool free_us);
106 const Collection *collection);
110 Collection *collection,
111 const int id_create_flag,
112 const uint id_recalc_flag);
117 CollectionObject *cob);
129 Collection *collection = id_cast<Collection *>(
id);
131 collection->
runtime = MEM_new<bke::CollectionRuntime>(__func__);
145 std::optional<Library *> ,
150 Collection *collection_dst = id_cast<Collection *>(id_dst);
151 const Collection *collection_src = id_cast<const Collection *>(id_src);
153 collection_dst->
runtime = MEM_new<bke::CollectionRuntime>(__func__);
162 collection_dst->
preview =
nullptr;
167 collection_dst->
gobject.clear_no_delete();
168 collection_dst->
children.clear_no_delete();
169 collection_dst->
exporters.clear_no_delete();
189 Collection *collection = id_cast<Collection *>(
id);
194 collection->
gobject.free_no_destruct();
200 collection->
children.free_no_destruct();
206 collection->
exporters.free_no_destruct();
217 MEM_delete(collection->
runtime);
222 Collection *collection = id_cast<Collection *>(
id);
242 else if (cob_ob_old != cob.
ob || cob.
ob ==
nullptr) {
281 Collection *master_collection = id_cast<Collection *>(
id);
283 if (debug_relationship_assert) {
289 return &master_collection->
owner_id;
316 struct_writer.shallow_data.runtime = nullptr;
324 if (
data.export_properties) {
336 Collection *collection = id_cast<Collection *>(
id);
366 "Fixing root node tree '%s' owned by '%s' missing EMBEDDED tag, please consider "
367 "re-saving your (startup) file",
374 collection->
runtime = MEM_new<bke::CollectionRuntime>(__func__);
385 "CollectionImportRuntime");
407 Collection *collection = id_cast<Collection *>(
id);
418 if (cob.ob ==
nullptr) {
431 if (!collection->
gobject.is_empty()) {
442 .id_code = Collection::id_type,
447 .name =
"Collection",
448 .name_plural =
N_(
"collections"),
451 .asset_type_info =
nullptr,
456 .make_local =
nullptr,
458 .foreach_cache =
nullptr,
459 .foreach_path =
nullptr,
460 .foreach_working_space_color =
nullptr,
461 .foreach_asset_weak_reference =
nullptr,
468 .blend_read_undo_preserve =
nullptr,
470 .lib_override_apply_post =
nullptr,
482 const char *name_custom)
501 if (collection_parent) {
521 bool is_instantiated =
false;
528 is_instantiated =
true;
533 if (!is_instantiated) {
545 bool is_instantiated =
false;
552 is_instantiated =
true;
557 is_instantiated =
true;
562 if (!is_instantiated) {
586 if (newname && newname[0] !=
'\0') {
597 if (
data->import_properties) {
601 MEM_delete(
data->runtime);
606 if (
data->export_properties) {
610 MEM_delete(
state.idname);
635 while (cob !=
nullptr) {
638 cob = collection->
gobject.first();
643 while (child !=
nullptr) {
645 child = collection->
children.first();
658 while (cob !=
nullptr) {
668 cob = collection->
gobject.first();
689 const int id_create_flag,
694 bool do_full_process =
false;
699 if (is_collection_master) {
703 collection_new = collection_old;
704 do_full_process =
true;
706 else if (collection_old->
id.
newid ==
nullptr) {
708 bmain, id_cast<ID *>(collection_old), duplicate_flags, id_create_flag));
710 if (collection_new == collection_old) {
711 return collection_new;
714 do_full_process =
true;
717 collection_new = id_cast<Collection *>(collection_old->
id.
newid);
722 if (parent !=
nullptr) {
736 if (child && child_new) {
746 if (!do_full_process) {
747 return collection_new;
758 if (ob_old->
id.
newid ==
nullptr) {
772 if (
ELEM(ob_new, ob_old,
nullptr)) {
777 bmain, collection_new, ob_new, &cob.
light_linking, id_create_flag,
true);
785 Collection *child_collection_old = child_iter.collection;
789 child_collection_old,
794 if (child_collection_new != child_collection_old) {
799 return collection_new;
807 uint duplicate_options)
813 if (!is_subprocess) {
834 if (!is_subprocess) {
866 return collection_new;
878 if (!collection_parent) {
883 r_name, name_maxncpy,
DATA_(
"Collection %d"), collection_parent->
children.count() + 1);
886 const int number = collection_parent->
children.count() + 1;
888 const size_t name_part_maxncpy = name_maxncpy - (1 + digits);
890 r_name, collection_parent->
id.
name + 2, name_part_maxncpy);
891 BLI_snprintf(r_name + name_part_len, name_maxncpy - name_part_len,
" %d", number);
898 return IFACE_(
"Scene Collection");
901 return collection->
id.
name + 2;
915 int child_restrict = collection->
flag | parent_restrict;
920 if (base ==
nullptr) {
921 base = MEM_new<Base>(
"Object Base");
949 static Mutex cache_lock;
951 std::scoped_lock
lock(cache_lock);
964 static Mutex cache_lock;
966 std::scoped_lock
lock(cache_lock);
979 const int id_create_flag,
980 const uint id_recalc_flag)
1005 const int id_create_flag,
1006 const uint id_recalc_flag)
1019 bmain, parent.
collection, id_create_flag, id_recalc_flag);
1025 const int id_create_flag)
1034 for (
Scene *scene = bmain->
scenes.first(); scene !=
nullptr;
1035 scene =
static_cast<Scene *
>(scene->id.next))
1042 collection =
static_cast<Collection *
>(collection->id.next))
1079 master_collection->
runtime = MEM_new<bke::CollectionRuntime>(__func__);
1081 return master_collection;
1092 if (
object->instance_collection) {
1093 Collection *dup_collection =
object->instance_collection;
1101 if (dup_collection == collection) {
1135 if (
ELEM(
nullptr, collection, ob)) {
1144 if (
ELEM(
nullptr, collection, ob)) {
1154 if (
ELEM(
nullptr, collection, ob)) {
1168 for (
Base &base : objects) {
1223 while (collection) {
1234 return collection->
gobject.is_empty() && collection->
children.is_empty();
1244 const bool do_extensive_check);
1248 auto *gobject_hash = MEM_new<CollectionObjectMap>(__func__);
1249 gobject_hash->reserve(collection->
gobject.count());
1250 return gobject_hash;
1257 if (cob.
ob ==
nullptr) [[unlikely]] {
1262 if (!gobject_hash->
add(cob.
ob, &cob)) {
1272#ifdef USE_DEBUG_EXTRA_GOBJECT_ASSERT
1289 bool changed =
false;
1292#ifdef USE_DEBUG_EXTRA_GOBJECT_ASSERT
1307 if (cob.ob ==
nullptr) {
1313 if (!gobject_hash->
add(cob.ob, &cob)) {
1346 if (ob_old == cob->
ob) {
1352 if (cob_old != cob) {
1384 const bool do_extensive_check)
1387 if (!do_extensive_check) {
1417 bool &r_is_in_viewlayer)
1421 view_layer, collection) :
1423 r_is_in_viewlayer = layer_collection !=
nullptr;
1432 if (!layer_collection) {
1444 bool is_in_viewlayer =
false;
1448 if (view_layer && !is_in_viewlayer) {
1461 if (editable_collection) {
1462 return editable_collection;
1480 if (cob !=
nullptr) {
1491 if (cob !=
nullptr) {
1493 if (ob.
parent !=
nullptr) {
1494 for (
Object *parent_iter = ob.
parent; parent_iter !=
nullptr;
1495 parent_iter = parent_iter->
parent)
1511 const int id_create_flag,
1525 bool newly_added =
false;
1528 return MEM_new<CollectionObject>(
"collection_object_add");
1535 if (light_linking) {
1559 const int id_create_flag,
1579 if (cob ==
nullptr) {
1590 *r_reason = fmt::format(fmt::runtime(
RPT_(
"Collection '{}' is overridden.")),
1591 collection->
id.
name + 2);
1598 *r_reason = fmt::format(fmt::runtime(
RPT_(
"Collection '{}' is linked.")),
1599 collection->
id.
name + 2);
1604 if (collection->
importer !=
nullptr) {
1606 *r_reason = fmt::format(
1607 fmt::runtime(
RPT_(
"Collection '{}' belongs to a collection importer.")),
1608 collection->
id.
name + 2);
1627 data->runtime = MEM_new<bke::CollectionImportRuntime>(
"CollectionImportRuntime");
1655 ListBaseT<CollectionExport> *exporters = &collection->
exporters;
1661 const int count = exporters->count();
1677 CollectionImport *new_data = MEM_new<CollectionImport>(
"CollectionImport");
1681 new_data->
runtime = MEM_new<bke::CollectionImportRuntime>(
"CollectionImportRuntime");
1688 CollectionExport *new_data = MEM_new<CollectionExport>(
"CollectionExport");
1708 if (ob ==
nullptr) {
1715 if (collection ==
nullptr) {
1741 if (collection ==
nullptr) {
1747 if (collection ==
nullptr) {
1756 bool is_instantiated =
false;
1763 is_instantiated =
true;
1768 if (!is_instantiated) {
1782 if (
ELEM(
nullptr, collection, ob)) {
1806 if (cob ==
nullptr) {
1835 bool removed =
false;
1840 if (collection_skip ==
nullptr) {
1848 if (collection == collection_skip) {
1880 if (child.collection ==
nullptr) {
1889 if ((parent.collection ==
nullptr) ||
1901 if (child_collection ==
nullptr) {
1902 if (parent_collection !=
nullptr) {
1941 if (collection_src !=
nullptr) {
1993 if (collection_object.
ob !=
nullptr &&
2002 if (collection_child.
collection !=
nullptr &&
2014 if (collection == new_ancestor) {
2018 if (collection ==
nullptr) {
2019 collection = new_ancestor;
2036 bool cycles_found =
false;
2043 cycles_found =
true;
2049 cycles_found =
true;
2053 return cycles_found;
2060 bool cycles_found =
false;
2065 cycles_found =
true;
2068 cycles_found =
true;
2072 return cycles_found;
2117 const int id_create_flag,
2128 child = MEM_new<CollectionChild>(
"CollectionChild");
2130 if (light_linking) {
2154 const int id_create_flag)
2157 if (child ==
nullptr) {
2202 if (other_child != &child) {
2222 BLI_addtail(&child.collection->runtime->parents, cparent);
2302 processed_collections.
clear();
2327 if (nested !=
nullptr) {
2367 bool relative_after,
2389 if (relative_child) {
2392 if (relative_after) {
2427 callback(collection,
data);
2436 int *tot =
static_cast<int *
>(
data);
2443 **
array = collection;
2449 int *r_collections_array_len)
2451 *r_collections_array =
nullptr;
2452 *r_collections_array_len = 0;
2454 if (scene ==
nullptr) {
2466 *r_collections_array =
array;
2472 Scene *scene =
static_cast<Scene *
>(data_in);
2475 data->scene = scene;
2495 iter->
valid =
false;
2505 MEM_delete(
data->array);
2509 iter->
valid =
false;
2530 if (visited_objects !=
nullptr) {
2531 data->visited = visited_objects;
2534 data->visited = MEM_new<Set<Object *>>(__func__);
2548 Scene *scene =
static_cast<Scene *
>(data_in);
2564 if (ob && (ob->
flag &
data->flag) == 0) {
2581 iter->
data = data_in;
2619 for (; cob !=
nullptr; cob = cob->
next) {
2620 if (gs.
add(cob->
ob)) {
2642 collection =
static_cast<Collection *
>(
data->scene_collection_iter.current);
2651 }
while (
data->scene_collection_iter.valid);
2653 if (!
data->scene_collection_iter.valid) {
2654 iter->
valid =
false;
2664 if (
data->visited !=
nullptr) {
2665 MEM_delete(
data->visited);
2675 while (iter.
valid) {
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_SCENE_COLLECTION_END
#define FOREACH_SCENE_COLLECTION_BEGIN(scene, _instance)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
#define BKE_SCENE_COLLECTION_NAME
#define IDP_BlendDataRead(reader, prop)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
#define BKE_LIB_FOREACHID_PROCESS_ID(data_, id_, cb_flag_)
#define FOREACH_MAIN_ID_END
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
General operations, lookup, etc. for blender objects.
API for Blender-side Rigid Body stuff.
#define BLI_ITERATOR_INIT(iter)
#define STRNCPY_UTF8(dst, src)
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define BLT_I18NCONTEXT_ID_COLLECTION
#define CLOG_WARN(clg_ref,...)
ID and Library types, which are fundamental for SDNA.
#define ID_IS_OVERRIDABLE_LIBRARY(_id)
#define ID_IS_LINKED(_id)
#define ID_IS_EDITABLE(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object groups, one object can be in many groups at once.
#define COLLECTION_FLAG_ALL_RUNTIME
These structs are the foundation for all linked lists in the library system.
Object is a sort of wrapper for general info.
Types and defines for representing Rigid Body entities.
Read Blender memory allocation and freeing.
#define INIT_DEFAULT_STRUCT_AFTER(struct_dst, member)
#define BLI_assert_msg(a, msg)
bool add(const Key &key, const Value &value)
Value lookup_default(const Key &key, const Value &default_value) const
void clear_and_keep_capacity()
Value & lookup_or_add_cb(const Key &key, const CreateValueF &create_value)
bool contains(const Key &key) const
Value pop_default(const Key &key, const Value &default_value)
@ COLLECTION_TAG_RELATION_REBUILD
@ COLLECTION_TAG_COLLECTION_OBJECT_DIRTY
void * BLI_findptr(const ListBase *listbase, const void *ptr, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
static bool scene_collections_object_remove(Main *bmain, Scene *scene, Object *ob, const bool free_us, Collection *collection_skip)
bool BKE_collection_delete(Main *bmain, Collection *collection, bool hierarchy)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
size_t size_t size_t BLI_snprintf_utf8(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
unsigned __int64 uint64_t
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
static bool collection_cycle_fix_recursive(Main *bmain, Collection *parent_collection, Collection *collection)
void BKE_previewimg_id_free(ID *id)
static void collection_parents_rebuild_recursive(Collection *collection)
void BKE_scene_objects_iterator_end(BLI_Iterator *iter)
static void collection_object_cache_fill(ListBaseT< Base > *lb, Collection *collection, int parent_restrict, bool with_instances)
char * STRNCPY(char(&dst)[N], const char *src)
void BKE_scene_objects_iterator_begin(BLI_Iterator *iter, void *data_in)
static void collection_gobject_hash_ensure(Collection *collection)
void BKE_id_delete(Main *bmain, void *idv, const BKEIDDeleteOptions &options={}) ATTR_NONNULL()
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)
void * BKE_libblock_alloc_in_lib(Main *bmain, std::optional< Library * > owner_library, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
bool BKE_collection_has_object_recursive_instanced_orig_id(Collection *collection_eval, Object *object_eval)
static void collection_init_data(ID *id)
void BKE_previewimg_blend_read(BlendDataReader *reader, PreviewImage *prv)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void BKE_id_free_us(Main *bmain, void *idv) ATTR_NONNULL()
void BKE_libblock_relink_to_newid(Main *bmain, ID *id, int remap_flag) ATTR_NONNULL()
const char * BKE_collection_ui_name_get(Collection *collection)
void BKE_collections_child_remove_nulls(Main *bmain, Collection *parent_collection, Collection *child_collection)
static void collection_object_cache_free_parent_recursive(const Main *bmain, Collection *collection, const int id_create_flag, const uint id_recalc_flag)
static void collection_gobject_hash_create(Collection *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)
static CollectionParent * collection_find_parent(Collection *child, Collection *collection)
char size_t BLI_strncpy_utf8_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
@ IDWALK_NO_ORIG_POINTERS_ACCESS
bool BKE_collection_child_add(Main *bmain, Collection *parent, Collection *child)
void BKE_previewimg_blend_write(BlendWriter *writer, const PreviewImage *prv)
IDProperty * IDP_CopyProperty(const IDProperty *prop) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BKE_scene_remove_rigidbody_object(Main *bmain, Scene *scene, Object *ob, bool free_us)
IDProperty * IDP_GetPropertyFromGroup(const IDProperty *prop, StringRef name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void IDP_BlendWrite(BlendWriter *writer, const IDProperty *prop)
CollectionObject * BKE_collection_object_find_in(const Collection &collection, const Object &ob)
void BKE_main_collections_parent_relations_rebuild(Main *bmain)
MINLINE int integer_digits_i(int i)
static void scene_collections_build_array(Collection *collection, void *data)
static bool collection_object_cyclic_check_internal(Object *object, Collection *collection)
void BKE_main_collections_object_cache_free(const Main *bmain)
static void collection_object_remove_no_gobject_hash(Main *bmain, Collection *collection, CollectionObject *cob, const int id_create_flag, const bool free_us)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
bool BKE_scene_collections_object_remove(Main *bmain, Scene *scene, Object *ob, bool free_us)
void BKE_scene_collections_iterator_next(BLI_Iterator *iter)
ID * BKE_id_copy_for_duplicate(Main *bmain, ID *id, eDupli_ID_Flags duplicate_flags, int copy_flags)
static void collection_free_data(ID *id)
static Collection * collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)
void BKE_collection_importer_free_data(CollectionImport *data)
@ ID_REMAP_SKIP_USER_CLEAR
@ ID_REMAP_FORCE_OBDATA_IN_EDITMODE
void BKE_collection_object_parent_clear_sort_index_reset(Main &bmain, Object &ob)
LibraryForeachIDFlag BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
void BKE_id_blend_write(BlendWriter *writer, ID *id)
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)
static void collection_gobject_hash_update_object(Collection *collection, Object *ob_old, CollectionObject *cob)
static void collection_exporter_copy(Collection *collection, CollectionExport *data)
static void collection_blend_write(BlendWriter *writer, ID *id, const void *id_address)
bool BKE_collection_cycles_fix(Main *bmain, Collection *collection)
@ LIB_ID_CREATE_NO_USER_REFCOUNT
@ LIB_ID_CREATE_NO_DEG_TAG
static bool collection_instance_fix_recursive(Collection *parent_collection, 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)
void BKE_libblock_free_data(ID *id, bool do_id_user) ATTR_NONNULL()
bool BKE_collection_object_add_notest(Main *bmain, Collection *collection, Object *ob)
@ LIB_ID_DUPLICATE_IS_SUBPROCESS
@ LIB_ID_DUPLICATE_IS_ROOT_ID
Collection * BKE_collection_object_find(Main *bmain, Scene *scene, Collection *collection, Object *ob)
bool BLI_listbase_validate(ListBase *lb)
void BKE_collection_free_data(Collection *collection)
bool BKE_collection_validate(Collection *collection)
static void collection_object_cache_free(const Main *bmain, Collection *collection, const int id_create_flag, const uint id_recalc_flag)
void BLI_uniquename(const ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
static ID ** collection_owner_pointer_get(ID *id, const bool debug_relationship_assert)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
static void scene_collections_array(Scene *scene, Collection ***r_collections_array, int *r_collections_array_len)
static void scene_objects_iterator_skip_invalid_flag(BLI_Iterator *iter)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void BKE_collection_object_parented_sort_index_reset(Main &bmain, Object &ob)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
static bool collection_find_child_recursive(const Collection *parent, const Collection *collection)
BMesh const char void * data
void BLI_insertlinkafter(ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
@ LAYER_COLLECTION_EXCLUDE
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)
Object * BKE_object_duplicate(Main *bmain, Object *ob, eDupli_ID_Flags dupflag, uint duplicate_options)
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 BLI_listbase_move_index(ListBase *listbase, int from, int to) ATTR_NONNULL()
bool BKE_collection_is_in_scene(Collection *collection)
bool BKE_collection_is_empty(const Collection *collection)
static bool collection_is_editable_in_viewlayer(const ViewLayer *view_layer, Collection *collection, bool &r_is_in_viewlayer)
bool BKE_collection_object_cyclic_check(Main *bmain, Object *object, Collection *collection)
static void collection_gobject_hash_ensure_fix(Main *bmain, Collection *collection)
void IDP_AssignString(IDProperty *prop, const char *st) ATTR_NONNULL()
CollectionChild * BKE_collection_child_find(Collection *parent, Collection *collection)
static void collection_missing_parents_remove(Collection *collection)
static Collection * collection_next_find(Main *bmain, Scene *scene, Collection *collection)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
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_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
LayerCollection * BKE_layer_collection_first_from_scene_collection(const ViewLayer *view_layer, const 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)
static void collection_blend_read_after_liblink(BlendLibReader *, ID *id)
@ LIBRARY_FLAG_IS_ARCHIVE
@ LIBRARY_FLAG_IS_EXTERNAL
static void scene_collection_callback(Collection *collection, BKE_scene_collections_Cb callback, void *data)
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 BLI_insertlinkbefore(ListBase *listbase, void *vnextlink, void *vnewlink) ATTR_NONNULL(1)
void(*)(Collection *ob, void *data) BKE_scene_collections_Cb
static void collection_null_children_remove(Collection *collection)
void BKE_rigidbody_main_collection_object_add(struct Main *bmain, struct Collection *collection, struct Object *object)
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)
static void collection_blend_read_data(BlendDataReader *reader, ID *id)
void BKE_main_id_newptr_and_tag_clear(Main *bmain)
Set< Object * > * BKE_scene_objects_as_set(Scene *scene, Set< Object * > *objects_set)
void BKE_collection_parent_relations_rebuild(Collection *collection)
void BKE_previewimg_id_copy(ID *new_id, const ID *old_id)
bool BKE_collection_is_content_editable(const Collection *collection, std::string *reason=nullptr)
static void scene_collections_count(Collection *, void *data)
void BKE_scene_objects_iterator_next_ex(BLI_Iterator *iter)
T * DEG_get_original(T *id)
bool BKE_collection_object_remove(Main *bmain, Collection *collection, Object *ob, bool free_us)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
@ COLLECTION_HAS_OBJECT_CACHE_INSTANCED
@ COLLECTION_HAS_OBJECT_CACHE
@ COLLECTION_HIDE_VIEWPORT
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
void IDP_FreeProperty(IDProperty *prop)
void BKE_collection_exporter_remove(Collection *collection, CollectionExport *data)
int BLO_read_fileversion_get(BlendDataReader *reader)
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)
static void collection_copy_data(Main *bmain, std::optional< Library * >, ID *id_dst, const ID *id_src, const int flag)
ID_Type GS(const char *name)
static CollectionObjectMap * collection_gobject_hash_alloc(const Collection *collection)
void BKE_collection_exporter_free_data(CollectionExport *data)
static void collection_importer_copy(Collection *collection, const CollectionImport *data)
static bool collection_instance_find_recursive(Collection *collection, Collection *instance_collection)
void BKE_main_id_tag_listbase(ListBaseT< ID > *lb, int tag, bool value)
bool DEG_object_has_geometry_component(Object *object)
void BKE_scene_objects_iterator_begin_ex(BLI_Iterator *iter, void *data_in)
IDProperty * IDP_New(char type, const IDPropertyTemplate *val, StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
static Collection * collection_duplicate_recursive(Main *bmain, Collection *parent, Collection *collection_old, CollectionChild *child_old, const int id_create_flag, const eDupli_ID_Flags duplicate_flags, const eLibIDDuplicateFlags duplicate_options)
static bool collection_child_add(Main *bmain, Collection *parent, Collection *collection, const CollectionLightLinking *light_linking, const int id_create_flag, const bool add_us)
bool BKE_collection_has_object_recursive(Collection *collection, Object *ob)
static void collection_gobject_assert_internal_consistency(Collection *collection, const bool do_extensive_check)
LibraryForeachIDCallbackFlag
@ IDWALK_CB_WRITEFILE_IGNORE
@ IDWALK_CB_EMBEDDED_NOT_OWNING
@ IDWALK_CB_OVERRIDE_LIBRARY_HIERARCHY_DEFAULT
@ IDWALK_CB_READFILE_IGNORE
static bool collection_object_add(Main *bmain, Collection *collection, Object *ob, CollectionLightLinking *light_linking, const int id_create_flag, const bool add_us)
Map< const Object *, CollectionObject * > CollectionObjectMap
static void scene_objects_iterator_begin(BLI_Iterator *iter, Scene *scene, Set< Object * > *visited_objects)
void BKE_collection_new_name_get(Collection *collection_parent, char r_name[256])
bool BKE_main_collection_sync(const Main *bmain)
static CollectionObject * object_base_unique(Set< Object * > &gs, CollectionObject *cob)
ListBase BLI_listbase_from_link(Link *some_link)
void * BKE_id_new(Main *bmain, short type, const char *name)
ListBaseT< Base > * BKE_view_layer_object_bases_get(ViewLayer *view_layer)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
void BKE_collection_blend_read_data(BlendDataReader *reader, Collection *collection, ID *owner_id)
static bool collection_object_remove(Main *bmain, Collection *collection, Object *ob, const int id_create_flag, const bool free_us)
static void collection_foreach_id(ID *id, LibraryForeachIDData *data)
static Collection * collection_from_session_uid_recursive(Collection *collection, uint64_t session_uid)
Collection * BKE_collection_add(Main *bmain, Collection *collection_parent, const char *name_custom)
@ IDTYPE_FLAGS_NO_ANIMDATA
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
static bool collection_child_remove(Main *bmain, Collection *parent, Collection *collection, const int id_create_flag)
void write_string(const char *data)
void write_id_struct(const void *id_address, const T *id, BlendStructWriterTypedFn< T > fn=nullptr)
void write_struct_list(const ListBaseT< T > *list, BlendStructWriterTypedFn< T > fn=nullptr)
void write_struct(const T *data, BlendStructWriterTypedFn< T > fn=nullptr)
struct Collection * collection
CollectionLightLinking light_linking
ListBaseT< LayoutPanelState > layout_panel_states
IDProperty * export_properties
IDProperty * import_properties
bke::CollectionImportRuntime * runtime
CollectionLightLinking light_linking
struct CollectionObject * next
struct Collection * collection
bke::CollectionRuntime * runtime
ListBaseT< CollectionExport > exporters
ListBaseT< CollectionChild > children
ListBaseT< CollectionObject > gobject
int active_exporter_index
struct PreviewImage * preview
CollectionColorTag color_tag
CollectionImport * importer
eLayerCollection_Flag flag
ListBaseT< Collection > collections
ListBaseT< Scene > scenes
eObject_VisibilityFlag visibility_flag
struct Collection * instance_collection
Set< Object * > * visited
BLI_Iterator scene_collection_iter
CollectionObject * cob_next
struct Collection * master_collection
Library * archive_library
ListBaseT< Base > object_cache_instanced
ListBaseT< CollectionParent > parents
ListBaseT< Base > object_cache
CollectionObjectMap * gobject_hash