Blender V5.3
collection.cc File Reference
#include "CLG_log.h"
#include <fmt/format.h>
#include <cstring>
#include <optional>
#include "BLI_iterator.hh"
#include "BLI_listbase.hh"
#include "BLI_math_base_c.hh"
#include "BLI_mutex.hh"
#include "BLI_string.hh"
#include "BLI_string_utf8.hh"
#include "BLI_string_utils.hh"
#include "BLT_translation.hh"
#include "BKE_anim_data.hh"
#include "BKE_collection.hh"
#include "BKE_file_handler.hh"
#include "BKE_idprop.hh"
#include "BKE_idtype.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_lib_remap.hh"
#include "BKE_library.hh"
#include "BKE_main.hh"
#include "BKE_object.hh"
#include "BKE_preview_image.hh"
#include "BKE_rigidbody.h"
#include "BKE_scene.hh"
#include "DNA_ID.h"
#include "DNA_collection_types.h"
#include "DNA_layer_types.h"
#include "DNA_listBase.h"
#include "DNA_object_types.h"
#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_query.hh"
#include "MEM_guardedalloc.h"
#include "BLO_read_write.hh"

Go to the source code of this file.

Classes

struct  blender::CollectionsIteratorData
struct  blender::SceneObjectsIteratorData

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define DNA_DEPRECATED_ALLOW

Functions

Prototypes
static bool blender::collection_child_add (Main *bmain, Collection *parent, Collection *collection, const CollectionLightLinking *light_linking, const int id_create_flag, const bool add_us)
static bool blender::collection_child_remove (Main *bmain, Collection *parent, Collection *collection, const int id_create_flag)
static bool blender::collection_object_add (Main *bmain, Collection *collection, Object *ob, CollectionLightLinking *light_linking, const int id_create_flag, const bool add_us)
static void blender::collection_object_remove_no_gobject_hash (Main *bmain, Collection *collection, CollectionObject *cob, const int id_create_flag, const bool free_us)
static bool blender::collection_object_remove (Main *bmain, Collection *collection, Object *ob, const int id_create_flag, const bool free_us)
static CollectionParent * blender::collection_find_parent (Collection *child, Collection *collection)
static bool blender::collection_find_child_recursive (const Collection *parent, const Collection *collection)
static void blender::collection_object_cache_free (const Main *bmain, Collection *collection, const int id_create_flag, const uint id_recalc_flag)
static void blender::collection_gobject_hash_ensure (Collection *collection)
static void blender::collection_gobject_hash_update_object (Collection *collection, Object *ob_old, CollectionObject *cob)
static void blender::collection_importer_copy (Collection *collection, const CollectionImport *data)
static void blender::collection_exporter_copy (Collection *collection, CollectionExport *data)
Collection Data-Block
static void blender::collection_init_data (ID *id)
static void blender::collection_copy_data (Main *bmain, std::optional< Library * >, ID *id_dst, const ID *id_src, const int flag)
static void blender::collection_free_data (ID *id)
static void blender::collection_foreach_id (ID *id, LibraryForeachIDData *data)
static ID ** blender::collection_owner_pointer_get (ID *id, const bool debug_relationship_assert)
void blender::BKE_collection_blend_write_prepare_nolib (BlendWriter *writer, Collection *collection)
void blender::BKE_collection_blend_write_nolib (BlendWriter *writer, Collection *collection)
static void blender::collection_blend_write (BlendWriter *writer, ID *id, const void *id_address)
void blender::BKE_collection_blend_read_data (BlendDataReader *reader, Collection *collection, ID *owner_id)
static void blender::collection_blend_read_data (BlendDataReader *reader, ID *id)
static void blender::collection_blend_read_after_liblink (BlendLibReader *, ID *id)
Add Collection
static Collection * blender::collection_add (Main *bmain, Collection *collection_parent, const char *name_custom)
Collection * blender::BKE_collection_add (Main *bmain, Collection *collection_parent, const char *name_custom)
void blender::BKE_collection_add_from_object (Main *bmain, Scene *scene, const Object *ob_src, Collection *collection_dst)
void blender::BKE_collection_add_from_collection (Main *bmain, Scene *scene, Collection *collection_src, Collection *collection_dst)
Free and Delete Collection
void blender::BKE_collection_free_data (Collection *collection)
void blender::BKE_collection_exporter_name_set (const ListBaseT< CollectionExport > *exporters, CollectionExport *data, const char *newname)
void blender::BKE_collection_importer_free_data (CollectionImport *data)
void blender::BKE_collection_exporter_free_data (CollectionExport *data)
bool blender::BKE_collection_delete (Main *bmain, Collection *collection, bool hierarchy)
Collection Copy
static Collection * blender::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)
Collection * blender::BKE_collection_duplicate (Main *bmain, Collection *parent, CollectionChild *child_old, Collection *collection, eDupli_ID_Flags duplicate_flags, uint duplicate_options)
Collection Naming
void blender::BKE_collection_new_name_get (Collection *collection_parent, char r_name[MAX_ID_NAME - 2])
const char * blender::BKE_collection_ui_name_get (Collection *collection)
Object List Cache
static void blender::collection_object_cache_fill (ListBaseT< Base > *lb, Collection *collection, int parent_restrict, bool with_instances)
ListBaseT< Base > blender::BKE_collection_object_cache_get (Collection *collection)
ListBaseT< Base > blender::BKE_collection_object_cache_instanced_get (Collection *collection)
static void blender::collection_object_cache_free_parent_recursive (const Main *bmain, Collection *collection, const int id_create_flag, const uint id_recalc_flag)
void blender::BKE_collection_object_cache_free (const Main *bmain, Collection *collection, const int id_create_flag)
void blender::BKE_main_collections_object_cache_free (const Main *bmain)
Base * blender::BKE_collection_or_layer_objects (const Main &bmain, const Scene *scene, ViewLayer *view_layer, Collection *collection)
Scene Master Collection
Collection * blender::BKE_collection_master_add (Scene *scene)
Cyclic Checks
static bool blender::collection_object_cyclic_check_internal (Object *object, Collection *collection)
bool blender::BKE_collection_object_cyclic_check (Main *bmain, Object *object, Collection *collection)
Collection Object Membership
bool blender::BKE_collection_has_object (Collection *collection, const Object *ob)
bool blender::BKE_collection_has_object_recursive (Collection *collection, Object *ob)
bool blender::BKE_collection_has_object_recursive_instanced (Collection *collection, Object *ob)
bool blender::BKE_collection_has_object_recursive_instanced_orig_id (Collection *collection_eval, Object *object_eval)
bool blender::BKE_collection_contains_geometry_recursive (const Collection *collection)
static Collection * blender::collection_next_find (Main *bmain, Scene *scene, Collection *collection)
Collection * blender::BKE_collection_object_find (Main *bmain, Scene *scene, Collection *collection, Object *ob)
bool blender::BKE_collection_is_empty (const Collection *collection)
Collection Objects
static void blender::collection_gobject_assert_internal_consistency (Collection *collection, const bool do_extensive_check)
static CollectionObjectMap * blender::collection_gobject_hash_alloc (const Collection *collection)
static void blender::collection_gobject_hash_create (Collection *collection)
static void blender::collection_gobject_hash_ensure_fix (Main *bmain, Collection *collection)
static bool blender::collection_is_editable_in_viewlayer (const ViewLayer *view_layer, Collection *collection, bool &r_is_in_viewlayer)
Collection * blender::BKE_collection_parent_editable_find_recursive (const ViewLayer *view_layer, Collection *collection)
CollectionObject * blender::BKE_collection_object_find_in (const Collection &collection, const Object &ob)
void blender::BKE_collection_object_parented_sort_index_reset (Main &bmain, Object &ob)
void blender::BKE_collection_object_parent_clear_sort_index_reset (Main &bmain, Object &ob)
bool blender::BKE_collection_is_content_editable (const Collection *collection, std::string *reason=nullptr)
CollectionImport * blender::BKE_collection_importer_add (Collection *collection, const char *idname)
CollectionExport * blender::BKE_collection_exporter_add (Collection *collection, char *idname, char *label)
void blender::BKE_collection_exporter_remove (Collection *collection, CollectionExport *data)
bool blender::BKE_collection_exporter_move (Collection *collection, const int from, const int to)
bool blender::BKE_collection_object_add_notest (Main *bmain, Collection *collection, Object *ob)
bool blender::BKE_collection_object_add (Main *bmain, Collection *collection, Object *ob)
bool blender::BKE_collection_viewlayer_object_add (Main *bmain, const ViewLayer *view_layer, Collection *collection, Object *ob)
void blender::BKE_collection_object_add_from (Main *bmain, Scene *scene, Object *ob_src, Object *ob_dst)
bool blender::BKE_collection_object_remove (Main *bmain, Collection *collection, Object *ob, bool free_us)
bool blender::BKE_collection_object_replace (Main *bmain, Collection *collection, Object *ob_old, Object *ob_new)
static bool blender::scene_collections_object_remove (Main *bmain, Scene *scene, Object *ob, const bool free_us, Collection *collection_skip)
bool blender::BKE_scene_collections_object_remove (Main *bmain, Scene *scene, Object *ob, bool free_us)
void blender::BKE_collections_object_remove_invalids (Main *bmain)
static void blender::collection_null_children_remove (Collection *collection)
static void blender::collection_missing_parents_remove (Collection *collection)
void blender::BKE_collections_child_remove_nulls (Main *bmain, Collection *parent_collection, Collection *child_collection)
void blender::BKE_collection_object_move (Main *bmain, Scene *scene, Collection *collection_dst, Collection *collection_src, Object *ob)
Collection Scene Membership
bool blender::BKE_collection_is_in_scene (Collection *collection)
void blender::BKE_collections_after_lib_link (Main *bmain)
Collection Children
static bool blender::collection_instance_find_recursive (Collection *collection, Collection *instance_collection)
bool blender::BKE_collection_cycle_find (Collection *new_ancestor, Collection *collection)
static bool blender::collection_instance_fix_recursive (Collection *parent_collection, Collection *collection)
static bool blender::collection_cycle_fix_recursive (Main *bmain, Collection *parent_collection, Collection *collection)
bool blender::BKE_collection_cycles_fix (Main *bmain, Collection *collection)
CollectionChild * blender::BKE_collection_child_find (Collection *parent, Collection *collection)
bool blender::BKE_collection_has_collection (const Collection *parent, const Collection *collection)
bool blender::BKE_collection_child_add (Main *bmain, Collection *parent, Collection *child)
bool blender::BKE_collection_child_add_no_sync (Main *bmain, Collection *parent, Collection *child)
bool blender::BKE_collection_child_remove (Main *bmain, Collection *parent, Collection *child)
void blender::BKE_collection_parent_relations_rebuild (Collection *collection)
static void blender::collection_parents_rebuild_recursive (Collection *collection)
void blender::BKE_main_collections_parent_relations_rebuild (Main *bmain)
bool blender::BKE_collection_validate (Collection *collection)
Collection Index
static Collection * blender::collection_from_session_uid_recursive (Collection *collection, uint64_t session_uid)
Collection * blender::BKE_collection_from_session_uid (Scene *scene, uint64_t session_uid)
Collection * blender::BKE_collection_from_session_uid (Main *bmain, uint64_t session_uid, Scene **r_scene=nullptr)
Collection move (outliner drag & drop)
bool blender::BKE_collection_move (Main *bmain, Collection *to_parent, Collection *from_parent, Collection *relative, bool relative_after, Collection *collection)
Iterators
static void blender::scene_collection_callback (Collection *collection, BKE_scene_collections_Cb callback, void *data)
static void blender::scene_collections_count (Collection *, void *data)
static void blender::scene_collections_build_array (Collection *collection, void *data)
static void blender::scene_collections_array (Scene *scene, Collection ***r_collections_array, int *r_collections_array_len)
void blender::BKE_scene_collections_iterator_begin (BLI_Iterator *iter, void *data_in)
void blender::BKE_scene_collections_iterator_next (BLI_Iterator *iter)
void blender::BKE_scene_collections_iterator_end (BLI_Iterator *iter)
static void blender::scene_objects_iterator_begin (BLI_Iterator *iter, Scene *scene, Set< Object * > *visited_objects)
void blender::BKE_scene_objects_iterator_begin (BLI_Iterator *iter, void *data_in)
static void blender::scene_objects_iterator_skip_invalid_flag (BLI_Iterator *iter)
void blender::BKE_scene_objects_iterator_begin_ex (BLI_Iterator *iter, void *data_in)
void blender::BKE_scene_objects_iterator_next_ex (BLI_Iterator *iter)
void blender::BKE_scene_objects_iterator_end_ex (BLI_Iterator *iter)
static CollectionObject * blender::object_base_unique (Set< Object * > &gs, CollectionObject *cob)
void blender::BKE_scene_objects_iterator_next (BLI_Iterator *iter)
void blender::BKE_scene_objects_iterator_end (BLI_Iterator *iter)
Set< Object * > * blender::BKE_scene_objects_as_set (Scene *scene, Set< Object * > *objects_set)

Variables

static CLG_LogRef blender::LOG = {"object.collection"}

Macro Definition Documentation

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 10 of file collection.cc.