Blender V5.3
BKE_collection.hh File Reference
#include <string>
#include "BLI_iterator.hh"
#include "BLI_map.hh"
#include "BLI_set.hh"
#include "BLI_sys_types.hh"
#include "DNA_collection_types.h"
#include "DNA_listBase.h"
#include "DNA_userdef_enums.h"

Go to the source code of this file.

Classes

struct  blender::CollectionParent
struct  blender::bke::CollectionRuntime
struct  blender::bke::CollectionImportRuntime
struct  blender::SceneObjectsIteratorExData

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::bke

Macros

#define BKE_SCENE_COLLECTION_NAME   "Scene Collection"
#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(_collection, _object, _mode)
#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_SCENE_COLLECTION_BEGIN(scene, _instance)
#define FOREACH_SCENE_COLLECTION_END   ITER_END
#define FOREACH_COLLECTION_BEGIN(_bmain, _scene, Type, _instance)
#define FOREACH_COLLECTION_END
#define FOREACH_SCENE_OBJECT_BEGIN(scene, _instance)
#define FOREACH_SCENE_OBJECT_END   ITER_END

Typedefs

using blender::CollectionObjectMap = Map<const Object *, CollectionObject *>
using blender::BKE_scene_objects_Cb = void (*)(Object *ob, void *data)
using blender::BKE_scene_collections_Cb = void (*)(Collection *ob, void *data)

Enumerations

enum  { blender::COLLECTION_TAG_RELATION_REBUILD = (1 << 0) , blender::COLLECTION_TAG_COLLECTION_OBJECT_DIRTY = (1 << 1) }

Functions

void blender::BKE_collection_new_name_get (Collection *collection_parent, char r_name[256])
Add Collection
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 Objects
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 (Main *bmain, Collection *collection, Object *ob)
bool blender::BKE_collection_viewlayer_object_add (Main *bmain, const ViewLayer *view_layer, Collection *collection, Object *ob)
bool blender::BKE_collection_object_add_notest (Main *bmain, 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)
void blender::BKE_collection_object_move (Main *bmain, Scene *scene, Collection *collection_dst, Collection *collection_src, Object *ob)
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_scene_collections_object_remove (Main *bmain, Scene *scene, Object *ob, bool free_us)
void blender::BKE_collections_object_remove_invalids (Main *bmain)
void blender::BKE_collections_child_remove_nulls (Main *bmain, Collection *parent_collection, Collection *child_collection)
Collection * blender::BKE_collection_parent_editable_find_recursive (const ViewLayer *view_layer, Collection *collection)
Collection Copy
Collection * blender::BKE_collection_duplicate (Main *bmain, Collection *parent, CollectionChild *child_old, Collection *collection, eDupli_ID_Flags duplicate_flags, uint duplicate_options)
Scene Master Collection
Collection * blender::BKE_collection_master_add (Scene *scene)
Collection Object Membership
bool blender::BKE_collection_contains_geometry_recursive (const Collection *collection)
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)
Collection * blender::BKE_collection_object_find (Main *bmain, Scene *scene, Collection *collection, Object *ob)
bool blender::BKE_collection_is_empty (const Collection *collection)
Collection Children
CollectionChild * blender::BKE_collection_child_find (Collection *parent, 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)
bool blender::BKE_collection_cycle_find (Collection *new_ancestor, Collection *collection)
bool blender::BKE_collection_cycles_fix (Main *bmain, Collection *collection)
bool blender::BKE_collection_has_collection (const Collection *parent, const Collection *collection)
void blender::BKE_collection_parent_relations_rebuild (Collection *collection)
void blender::BKE_main_collections_parent_relations_rebuild (Main *bmain)
bool blender::BKE_collection_validate (Collection *collection)
Collection Scene Membership
bool blender::BKE_collection_is_in_scene (Collection *collection)
void blender::BKE_collections_after_lib_link (Main *bmain)
Cyclic Checks
bool blender::BKE_collection_object_cyclic_check (Main *bmain, Object *object, Collection *collection)
Object List Cache
ListBaseT< Base > blender::BKE_collection_object_cache_get (Collection *collection)
ListBaseT< Base > blender::BKE_collection_object_cache_instanced_get (Collection *collection)
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)
Collection Index
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 Naming
const char * blender::BKE_collection_ui_name_get (Collection *collection)
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)
Collection Data-Block
void blender::BKE_collection_blend_write_prepare_nolib (BlendWriter *writer, Collection *collection)
void blender::BKE_collection_blend_write_nolib (BlendWriter *writer, Collection *collection)
void blender::BKE_collection_blend_read_data (BlendDataReader *reader, Collection *collection, ID *owner_id)
Iterators
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)
void blender::BKE_scene_objects_iterator_begin (BLI_Iterator *iter, void *data_in)
void blender::BKE_scene_objects_iterator_next (BLI_Iterator *iter)
void blender::BKE_scene_objects_iterator_end (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)
Set< Object * > * blender::BKE_scene_objects_as_set (Scene *scene, Set< Object * > *objects_set)

Macro Definition Documentation

◆ BKE_SCENE_COLLECTION_NAME

#define BKE_SCENE_COLLECTION_NAME   "Scene Collection"

◆ FOREACH_COLLECTION_BEGIN

#define FOREACH_COLLECTION_BEGIN ( _bmain,
_scene,
Type,
_instance )
Value:
{ \
Type _instance; \
Collection *_instance_next; \
bool is_scene_collection = (_scene) != NULL; \
\
if (_scene) { \
_instance_next = (_scene)->master_collection; \
} \
else { \
_instance_next = (_bmain)->collections.first(); \
} \
\
while ((_instance = _instance_next)) { \
if (is_scene_collection) { \
_instance_next = (_bmain)->collections.first(); \
is_scene_collection = false; \
} \
else { \
_instance_next = static_cast<Collection *>(_instance->id.next); \
}

Definition at line 545 of file BKE_collection.hh.

Referenced by blender::ed::object::collection_objects_remove_exec(), blender::ed::object::find_collections_containing_object(), blender::ed::object::objects_add_active_exec(), and blender::ed::object::objects_remove_active_exec().

◆ FOREACH_COLLECTION_END

◆ FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN

◆ FOREACH_COLLECTION_OBJECT_RECURSIVE_END

◆ FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN

#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN ( _collection,
_object,
_mode )
Value:
{ \
int _base_flag = (_mode == DAG_EVAL_VIEWPORT) ? BASE_ENABLED_VIEWPORT : BASE_ENABLED_RENDER; \
int _object_visibility_flag = (_mode == DAG_EVAL_VIEWPORT) ? OB_HIDE_VIEWPORT : \
OB_HIDE_RENDER; \
[[maybe_unused]] int _base_id = 0; \
for (Base *_base = BKE_collection_object_cache_get(_collection).first(); _base; \
_base = _base->next, _base_id++) \
{ \
Object *_object = _base->object; \
if ((_base->flag & _base_flag) && \
(_object->visibility_flag & _object_visibility_flag) == 0) \
{

Definition at line 465 of file BKE_collection.hh.

Referenced by blender::deg::DepsgraphRelationBuilder::build_object_instance_collection(), blender::make_child_duplis(), blender::make_duplis_collection(), blender::make_duplis_geometry_set_impl(), and blender::make_duplis_particle_system().

◆ FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END

◆ FOREACH_SCENE_COLLECTION_BEGIN

#define FOREACH_SCENE_COLLECTION_BEGIN ( scene,
_instance )
Value:
ITER_BEGIN (BKE_scene_collections_iterator_begin, \
BKE_scene_collections_iterator_next, \
BKE_scene_collections_iterator_end, \
scene, \
Collection *, \
_instance)
#define ITER_BEGIN(callback_begin, callback_next, callback_end, _data_in, _type, _instance)

Definition at line 535 of file BKE_collection.hh.

Referenced by blender::BKE_collection_add_from_collection(), blender::BKE_collection_add_from_object(), blender::BKE_collection_object_add_from(), blender::scene_collections_object_remove(), and blender::ed::outliner::unlink_object_fn().

◆ FOREACH_SCENE_COLLECTION_END

◆ FOREACH_SCENE_OBJECT_BEGIN

◆ FOREACH_SCENE_OBJECT_END