Blender
V3.3
|
#include "BLI_compiler_compat.h"
#include "BLI_ghash.h"
#include "BLI_iterator.h"
#include "BLI_sys_types.h"
#include "DNA_listBase.h"
Go to the source code of this file.
Classes | |
struct | CollectionParent |
struct | SceneObjectsIteratorExData |
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 | |
typedef struct CollectionParent | CollectionParent |
typedef void(* | BKE_scene_objects_Cb) (struct Object *ob, void *data) |
typedef void(* | BKE_scene_collections_Cb) (struct Collection *ob, void *data) |
typedef struct SceneObjectsIteratorExData | SceneObjectsIteratorExData |
#define BKE_SCENE_COLLECTION_NAME "Scene Collection" |
Definition at line 96 of file BKE_collection.h.
#define FOREACH_COLLECTION_BEGIN | ( | _bmain, | |
_scene, | |||
Type, | |||
_instance | |||
) |
Definition at line 399 of file BKE_collection.h.
#define FOREACH_COLLECTION_END |
Definition at line 421 of file BKE_collection.h.
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN | ( | _collection, | |
_object | |||
) |
Definition at line 342 of file BKE_collection.h.
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END |
Definition at line 348 of file BKE_collection.h.
#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN | ( | _collection, | |
_object, | |||
_mode | |||
) |
Definition at line 324 of file BKE_collection.h.
#define FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END |
Definition at line 336 of file BKE_collection.h.
Definition at line 389 of file BKE_collection.h.
Definition at line 397 of file BKE_collection.h.
Definition at line 426 of file BKE_collection.h.
Definition at line 434 of file BKE_collection.h.
typedef void(* BKE_scene_collections_Cb) (struct Collection *ob, void *data) |
Definition at line 320 of file BKE_collection.h.
Definition at line 319 of file BKE_collection.h.
typedef struct CollectionParent CollectionParent |
typedef struct SceneObjectsIteratorExData SceneObjectsIteratorExData |
Iterate over objects in the scene based on a flag.
struct Collection* BKE_collection_add | ( | struct Main * | bmain, |
struct Collection * | parent, | ||
const char * | name | ||
) |
Add a collection to a collection ListBase and synchronize all render layers The ListBase is NULL when the collection is to be added to the master collection
Definition at line 425 of file collection.c.
References BKE_main_collection_sync(), and collection_add().
Referenced by BKE_lib_override_library_main_resync(), collection_add_exec(), collection_create_exec(), collection_new_exec(), do_version_layers_to_collections(), do_versions_after_linking_280(), ED_rigidbody_constraint_add(), blender::io::usd::import_startjob(), loose_data_instantiate_ensure_active_collection(), and move_to_collection_exec().
void BKE_collection_add_from_collection | ( | struct Main * | bmain, |
struct Scene * | scene, | ||
struct Collection * | collection_src, | ||
struct Collection * | collection_dst | ||
) |
Add collection_dst to all scene collections that reference collection collection_src is in.
Logic is very similar to BKE_collection_object_add_from().
Definition at line 455 of file collection.c.
References BKE_main_collection_sync(), collection_child_add(), collection_find_child(), FOREACH_SCENE_COLLECTION_BEGIN, FOREACH_SCENE_COLLECTION_END, ID_IS_LINKED, ID_IS_OVERRIDABLE_LIBRARY, Scene::master_collection, and scene.
Referenced by lib_override_library_create_post_process().
void BKE_collection_add_from_object | ( | struct Main * | bmain, |
struct Scene * | scene, | ||
const struct Object * | ob_src, | ||
struct Collection * | collection_dst | ||
) |
Add collection_dst to all scene collections that reference object ob_src is in. Used to replace an instance object with a collection (library override operator).
Logic is very similar to BKE_collection_object_add_from().
Referenced by lib_override_library_create_post_process().
void BKE_collection_blend_read_data | ( | struct BlendDataReader * | reader, |
struct Collection * | collection | ||
) |
Definition at line 236 of file collection.c.
References BKE_collection_compat_blend_read_data(), BKE_previewimg_blend_read(), BKE_view_layer_blend_read_data(), BLI_listbase_clear(), BLO_read_data_address, BLO_read_list(), Collection::children, COLLECTION_HAS_OBJECT_CACHE, COLLECTION_HAS_OBJECT_CACHE_INSTANCED, Collection::flag, Collection::gobject, NULL, Collection::object_cache, Collection::object_cache_instanced, Collection::parents, Collection::preview, and Collection::tag.
Referenced by collection_blend_read_data(), and direct_link_id_embedded_id().
void BKE_collection_blend_read_expand | ( | struct BlendExpander * | expander, |
struct Collection * | collection | ||
) |
Definition at line 337 of file collection.c.
References BKE_collection_compat_blend_read_expand(), BLO_expand, Collection::children, Collection::gobject, LISTBASE_FOREACH, and NULL.
Referenced by collection_blend_read_expand(), and expand_id_embedded_id().
void BKE_collection_blend_read_lib | ( | struct BlendLibReader * | reader, |
struct Collection * | collection | ||
) |
Definition at line 302 of file collection.c.
References BKE_collection_compat_blend_read_lib(), BKE_view_layer_blend_read_lib(), Collection::id, ID::lib, and lib_link_collection_data().
Referenced by collection_blend_read_lib(), and lib_link_id_embedded_id().
void BKE_collection_blend_write_nolib | ( | struct BlendWriter * | writer, |
struct Collection * | collection | ||
) |
Definition at line 190 of file collection.c.
References BKE_id_blend_write(), BKE_previewimg_blend_write(), BLO_write_struct, Collection::children, Collection::gobject, Collection::id, LISTBASE_FOREACH, and Collection::preview.
Referenced by collection_blend_write(), and scene_blend_write().
bool BKE_collection_child_add | ( | struct Main * | bmain, |
struct Collection * | parent, | ||
struct Collection * | child | ||
) |
Definition at line 1585 of file collection.c.
References BKE_main_collection_sync(), and collection_child_add().
Referenced by collection_link_exec(), and loose_data_instantiate_collection_process().
bool BKE_collection_child_add_no_sync | ( | struct Collection * | parent, |
struct Collection * | child | ||
) |
Definition at line 1595 of file collection.c.
References collection_child_add().
Referenced by single_object_users_collection().
bool BKE_collection_child_remove | ( | struct Main * | bmain, |
struct Collection * | parent, | ||
struct Collection * | child | ||
) |
Definition at line 1600 of file collection.c.
References BKE_main_collection_sync(), and collection_child_remove().
Referenced by collection_cycle_fix_recursive(), collection_drop_exec(), make_override_library_exec(), and unlink_collection_fn().
void BKE_collection_compat_blend_read_data | ( | struct BlendDataReader * | reader, |
struct SceneCollection * | sc | ||
) |
Referenced by BKE_collection_blend_read_data(), and scene_blend_read_data().
void BKE_collection_compat_blend_read_expand | ( | struct BlendExpander * | expander, |
struct SceneCollection * | sc | ||
) |
Referenced by BKE_collection_blend_read_expand(), and scene_blend_read_expand().
void BKE_collection_compat_blend_read_lib | ( | struct BlendLibReader * | reader, |
struct Library * | lib, | ||
struct SceneCollection * | sc | ||
) |
Referenced by BKE_collection_blend_read_lib(), and scene_blend_read_lib().
bool BKE_collection_cycle_find | ( | struct Collection * | new_ancestor, |
struct Collection * | collection | ||
) |
Find potential cycles in collections.
new_ancestor | the potential new owner of given collection, or the collection to check if the later is NULL. |
collection | the collection we want to add to new_ancestor, may be NULL if we just want to ensure new_ancestor does not already have cycles. |
Definition at line 1435 of file collection.c.
References BKE_collection_cycle_find(), collection_instance_find_recursive(), LISTBASE_FOREACH, NULL, and Collection::parents.
Referenced by BKE_collection_cycle_find(), BKE_collection_move(), BKE_collection_parent_relations_rebuild(), collection_add_info_get_from_op(), collection_child_add(), collection_cycle_fix_recursive(), and collection_instance_exec().
bool BKE_collection_cycles_fix | ( | struct Main * | bmain, |
struct Collection * | collection | ||
) |
Find and fix potential cycles in collections.
collection | The collection to check for existing cycles. |
Definition at line 1498 of file collection.c.
References collection_cycle_fix_recursive(), and collection_instance_fix_recursive().
Referenced by do_versions_after_linking_290().
bool BKE_collection_delete | ( | struct Main * | bmain, |
struct Collection * | collection, | ||
bool | hierarchy | ||
) |
Remove a collection, optionally removing its child objects or moving them to parent collections.
Definition at line 495 of file collection.c.
References BKE_collection_delete(), BKE_id_delete(), BKE_main_collection_sync(), BLI_assert_msg, Collection::children, CollectionChild::collection, collection_child_add(), COLLECTION_IS_MASTER, collection_object_add(), collection_object_remove(), ListBase::first, Collection::flag, Collection::gobject, LISTBASE_FOREACH, NULL, CollectionObject::ob, and Collection::parents.
Referenced by BKE_collection_delete(), BKE_lib_override_library_main_resync(), and outliner_collection_delete().
struct Collection* BKE_collection_duplicate | ( | struct Main * | bmain, |
struct Collection * | parent, | ||
struct Collection * | collection, | ||
uint | duplicate_flags, | ||
uint | duplicate_options | ||
) |
Make a deep copy (aka duplicate) of the given collection and all of its children, recursively.
Referenced by BKE_scene_duplicate(), and collection_duplicate_exec().
void BKE_collection_free_data | ( | struct Collection * | collection | ) |
Free (or release) any data used by this collection (does not free the collection itself).
Definition at line 489 of file collection.c.
References BKE_libblock_free_data(), collection_free_data(), and Collection::id.
Referenced by scene_free_data().
struct Collection* BKE_collection_from_index | ( | struct Scene * | scene, |
int | index | ||
) |
Return Scene Collection for a given index.
The index is calculated from top to bottom counting the children before the siblings.
Definition at line 1716 of file collection.c.
References collection_from_index_recursive(), Scene::master_collection, and scene.
Referenced by move_to_collection_exec(), and move_to_collection_invoke().
bool BKE_collection_has_collection | ( | const struct Collection * | parent, |
const struct Collection * | collection | ||
) |
bool BKE_collection_has_object | ( | struct Collection * | collection, |
const struct Object * | ob | ||
) |
Referenced by BKE_lib_override_library_id_is_user_deletable(), collection_link_exec(), collection_objects_remove_exec(), lib_override_library_create_post_process(), lineart_intersection_mask_check(), lineart_intersection_priority_check(), lineart_usage_check(), make_override_library_object_overridable_check(), object_add_duplicate_internal(), object_in_any_collection(), object_select_same_collection_exec(), objects_add_active_exec(), objects_remove_active_exec(), and select_grouped_collection().
bool BKE_collection_has_object_recursive | ( | struct Collection * | collection, |
struct Object * | ob | ||
) |
Definition at line 921 of file collection.c.
References BKE_collection_object_cache_get(), BLI_findptr(), ELEM, and NULL.
Referenced by animdata_filter_base_is_ok(), animdata_filter_gpencil(), BKE_object_scenes_users_get(), ED_editors_init(), EEVEE_lightprobes_obj_visibility_cb(), EEVEE_render_cache(), make_override_library_invoke(), object_in_any_scene(), psys_check_group_weights(), select_grouped_exec(), template_id_liboverride_hierarchy_collections_tag_recursive(), and ui_template_id_liboverride_hierarchy_make().
bool BKE_collection_has_object_recursive_instanced | ( | struct Collection * | collection, |
struct Object * | ob | ||
) |
Definition at line 931 of file collection.c.
References BKE_collection_object_cache_instanced_get(), BLI_findptr(), ELEM, and NULL.
Referenced by lineart_gpencil_generate(), and blender::nodes::node_geo_collection_info_cc::node_geo_exec().
bool BKE_collection_is_empty | ( | const struct Collection * | collection | ) |
Referenced by BKE_lib_override_library_main_resync(), BMD_error_messages(), and collection_drop_invoke().
bool BKE_collection_is_in_scene | ( | struct Collection * | collection | ) |
Definition at line 1385 of file collection.c.
References BKE_collection_is_in_scene(), COLLECTION_IS_MASTER, Collection::flag, LISTBASE_FOREACH, and Collection::parents.
Referenced by BKE_collection_is_in_scene(), BKE_collection_object_add_notest(), BKE_collection_object_remove(), and lib_override_library_create_post_process().
struct Collection* BKE_collection_master_add | ( | void | ) |
Definition at line 852 of file collection.c.
References BKE_libblock_alloc(), BKE_SCENE_COLLECTION_NAME, COLLECTION_COLOR_NONE, COLLECTION_IS_MASTER, Collection::color_tag, Collection::flag, ID::flag, Collection::id, ID_GR, LIB_EMBEDDED_DATA, LIB_ID_CREATE_NO_MAIN, and NULL.
Referenced by do_version_layers_to_collections(), and scene_init_data().
bool BKE_collection_move | ( | struct Main * | bmain, |
struct Collection * | to_parent, | ||
struct Collection * | from_parent, | ||
struct Collection * | relative, | ||
bool | relative_after, | ||
struct Collection * | collection | ||
) |
Definition at line 1777 of file collection.c.
References BKE_collection_cycle_find(), BKE_collection_object_cache_free(), BKE_main_collection_sync(), BLI_insertlinkafter(), BLI_insertlinkbefore(), BLI_remlink(), Collection::children, collection_child_add(), collection_child_remove(), collection_find_child(), COLLECTION_IS_MASTER, and Collection::flag.
Referenced by collection_drop_invoke().
void BKE_collection_new_name_get | ( | struct Collection * | collection_parent, |
char * | rname | ||
) |
The automatic/fallback name of a new collection.
Definition at line 713 of file collection.c.
References BLI_listbase_count(), BLI_sprintfN(), BLI_strdup(), BLI_strncpy(), Collection::children, COLLECTION_IS_MASTER, DATA_, Collection::flag, Collection::id, integer_digits_i(), MAX_NAME, MEM_freeN, and ID::name.
Referenced by collection_add(), and move_to_collection_invoke().
bool BKE_collection_object_add | ( | struct Main * | bmain, |
struct Collection * | collection, | ||
struct Object * | ob | ||
) |
Add object to given collection, ensuring this collection is 'editable' (i.e. local and not a liboverride), and finding a suitable parent one otherwise.
Definition at line 1125 of file collection.c.
References BKE_collection_viewlayer_object_add(), and NULL.
Referenced by bc_add_object(), BKE_collection_object_move(), BKE_object_add_for_data(), collection_add_exec(), collection_create_exec(), collection_drop_invoke(), collection_link_exec(), ED_rigidbody_constraint_add(), blender::io::obj::geometry_to_blender_objects(), gpencil_layer_to_curve(), blender::io::usd::import_endjob(), import_endjob(), blender::io::stl::importer_main(), lib_override_library_create_post_process(), loose_data_instantiate_object_base_instance_init(), make_links_data_exec(), make_links_scene_exec(), make_local_all__instance_indirect_unused(), move_to_collection_exec(), Freestyle::BlenderStrokeRenderer::NewMesh(), object_add_duplicate_internal(), object_preview_scene_create(), objects_add_active_exec(), and scene_drop_invoke().
void BKE_collection_object_add_from | ( | struct Main * | bmain, |
struct Scene * | scene, | ||
struct Object * | ob_src, | ||
struct Object * | ob_dst | ||
) |
Add ob_dst to all scene collections that reference object ob_src is in. Used for copying objects.
Logic is very similar to BKE_collection_add_from_object()
Definition at line 1148 of file collection.c.
References BKE_collection_has_object(), BKE_main_collection_sync(), collection_object_add(), FOREACH_SCENE_COLLECTION_BEGIN, FOREACH_SCENE_COLLECTION_END, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, Scene::master_collection, and scene.
Referenced by BKE_object_add_from(), DocumentImporter::create_instance_node(), duplibase_for_convert(), lib_override_library_create_post_process(), make_object_duplilist_real(), and object_add_duplicate_internal().
bool BKE_collection_object_add_notest | ( | struct Main * | bmain, |
struct Collection * | collection, | ||
struct Object * | ob | ||
) |
Same as BKE_collection_object_add, but unconditionally adds the object to the given collection.
NOTE: required in certain cases, like do-versioning or complex ID management tasks.
Definition at line 1099 of file collection.c.
References BKE_collection_is_in_scene(), BKE_main_collection_sync(), BLI_assert, collection_object_add(), DEG_id_tag_update(), Collection::id, ID_RECALC_GEOMETRY, and NULL.
Referenced by BKE_collection_viewlayer_object_add(), do_version_layers_to_collections(), and do_versions_after_linking_280().
void BKE_collection_object_cache_free | ( | struct Collection * | collection | ) |
Definition at line 832 of file collection.c.
References collection_object_cache_free().
Referenced by BKE_collection_move(), BKE_main_collection_sync_remap(), collection_child_add(), collection_child_remove(), collection_free_data(), collection_object_add(), collection_object_remove(), collection_object_remove_duplicates(), and collection_object_remove_nulls().
struct ListBase BKE_collection_object_cache_get | ( | struct Collection * | collection | ) |
Definition at line 787 of file collection.c.
References BLI_MUTEX_INITIALIZER, BLI_mutex_lock(), BLI_mutex_unlock(), COLLECTION_HAS_OBJECT_CACHE, collection_object_cache_fill(), Collection::flag, and Collection::object_cache.
Referenced by BKE_collection_has_object_recursive(), BKE_collection_or_layer_objects(), make_duplis_particle_system(), and psys_find_group_weights().
ListBase BKE_collection_object_cache_instanced_get | ( | struct Collection * | collection | ) |
Definition at line 803 of file collection.c.
References BLI_MUTEX_INITIALIZER, BLI_mutex_lock(), BLI_mutex_unlock(), COLLECTION_HAS_OBJECT_CACHE_INSTANCED, collection_object_cache_fill(), Collection::flag, and Collection::object_cache_instanced.
Referenced by BKE_collection_has_object_recursive_instanced().
bool BKE_collection_object_cyclic_check | ( | struct Main * | bmain, |
struct Object * | object, | ||
struct Collection * | collection | ||
) |
Definition at line 898 of file collection.c.
References BKE_main_id_tag_listbase(), collection_object_cyclic_check_internal(), Main::collections, and LIB_TAG_DOIT.
Referenced by collection_link_exec(), and objects_add_active_exec().
struct Collection* BKE_collection_object_find | ( | struct Main * | bmain, |
struct Scene * | scene, | ||
struct Collection * | collection, | ||
struct Object * | ob | ||
) |
Definition at line 950 of file collection.c.
References BKE_collection_has_object(), collection_next_find(), Main::collections, ListBase::first, Scene::master_collection, NULL, and scene.
Referenced by BKE_object_groups(), BKE_object_groups_clear(), collection_object_active_find_index(), and collection_object_active_itemf().
void BKE_collection_object_move | ( | struct Main * | bmain, |
struct Scene * | scene, | ||
struct Collection * | collection_dst, | ||
struct Collection * | collection_src, | ||
struct Object * | ob | ||
) |
Move object from a collection into another
If source collection is NULL move it from all the existing collections.
Definition at line 1361 of file collection.c.
References BKE_collection_object_add(), BKE_collection_object_remove(), NULL, scene, and scene_collections_object_remove().
Referenced by collection_drop_invoke(), and move_to_collection_exec().
bool BKE_collection_object_remove | ( | struct Main * | bmain, |
struct Collection * | collection, | ||
struct Object * | object, | ||
bool | free_us | ||
) |
Remove object from collection.
Definition at line 1170 of file collection.c.
References BKE_collection_is_in_scene(), BKE_main_collection_sync(), collection_object_remove(), DEG_id_tag_update(), ELEM, Collection::id, ID_RECALC_GEOMETRY, and NULL.
Referenced by BKE_collection_object_move(), BKE_object_groups_clear(), collection_objects_remove_exec(), collection_remove_exec(), do_versions_after_linking_280(), objects_remove_active_exec(), and unlink_object_fn().
bool BKE_collection_objects_select | ( | struct ViewLayer * | view_layer, |
struct Collection * | collection, | ||
bool | deselect | ||
) |
Select all the objects in this Collection (and its nested collections) for this ViewLayer. Return true if any object was selected.
Definition at line 1759 of file collection.c.
References BKE_layer_collection_first_from_scene_collection(), BKE_layer_collection_objects_select(), collection_objects_select(), and NULL.
struct Base* BKE_collection_or_layer_objects | ( | const struct ViewLayer * | view_layer, |
struct Collection * | collection | ||
) |
Referenced by BKE_collision_relations_create(), and BKE_effector_relations_create().
struct Collection* BKE_collection_parent_editable_find_recursive | ( | const struct ViewLayer * | view_layer, |
struct Collection * | collection | ||
) |
Return parent collection which is not linked.
Referenced by loose_data_instantiate_ensure_active_collection().
void BKE_collection_parent_relations_rebuild | ( | struct Collection * | collection | ) |
Rebuild parent relationships from child ones, for all children of given collection.
Definition at line 1610 of file collection.c.
References BKE_collection_cycle_find(), BLI_addtail(), BLI_assert, BLI_freelinkN(), Collection::children, CollectionParent::collection, collection_find_child(), collection_find_parent(), LIB_TAG_COPIED_ON_WRITE, LIB_TAG_NO_MAIN, LISTBASE_FOREACH_MUTABLE, MEM_callocN, and NULL.
Referenced by collection_parents_rebuild_recursive().
const char* BKE_collection_ui_name_get | ( | struct Collection * | collection | ) |
The name to show in the interface.
Definition at line 736 of file collection.c.
References COLLECTION_IS_MASTER, Collection::flag, Collection::id, IFACE_, and ID::name.
Referenced by draw_selected_name(), get_stats_string(), move_to_collection_menu_create(), and outliner_add_collection_init().
bool BKE_collection_viewlayer_object_add | ( | struct Main * | bmain, |
const struct ViewLayer * | view_layer, | ||
struct Collection * | collection, | ||
struct Object * | ob | ||
) |
Add object to given collection, similar to BKE_collection_object_add.
However, it additionally ensures that the selected collection is also part of the given view_layer
, if non-NULL. Otherwise, the object is not added to any collection.
Referenced by BKE_object_add().
Definition at line 1400 of file collection.c.
References BKE_main_collection_sync().
Referenced by blo_read_file_internal(), and library_link_end().
void BKE_collections_child_remove_nulls | ( | struct Main * | bmain, |
struct Collection * | parent_collection, | ||
struct Collection * | child_collection | ||
) |
Remove all NULL children from parent collections of changed collection. This is used for library remapping, where these pointers have been set to NULL. Otherwise this should never happen.
parent_collection | The collection owning the pointers that were remapped. May be NULL, in which case whole bmain database of collections is checked. |
child_collection | The collection that was remapped to another pointer. May be NULL, in which case whole bmain database of collections is checked. |
Definition at line 1322 of file collection.c.
References BLI_freelinkN(), collection_find_child(), collection_missing_parents_remove(), collection_null_children_remove(), Main::collections, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, Scene::master_collection, NULL, Collection::parents, scene, and Main::scenes.
Referenced by libblock_remap_data_postprocess_collection_update().
Check all collections in bmain (including embedded ones in scenes) for duplicate CollectionObject with a same object pointer within a same object, and remove them.
NOTE: Always keeps the first of the detected duplicates.
Definition at line 1289 of file collection.c.
References collection_object_remove_duplicates(), Main::collections, LISTBASE_FOREACH, Scene::master_collection, Main::objects, scene, and Main::scenes.
Referenced by libblock_remap_data_postprocess_object_update().
Check all collections in bmain (including embedded ones in scenes) for CollectionObject with NULL object pointer, and remove them.
Definition at line 1250 of file collection.c.
References collection_object_remove_nulls(), Main::collections, LISTBASE_FOREACH, Scene::master_collection, scene, and Main::scenes.
Referenced by libblock_remap_data_postprocess_object_update().
Rebuild parent relationships from child ones, for all collections in given bmain.
Definition at line 1658 of file collection.c.
References BLI_assert, BLI_freelistN(), BLI_listbase_is_empty(), collection_parents_rebuild_recursive(), COLLECTION_TAG_RELATION_REBUILD, Main::collections, LISTBASE_FOREACH, Scene::master_collection, NULL, Collection::parents, scene, Main::scenes, and Collection::tag.
Referenced by after_liblink_merged_bmain_process(), and libblock_remap_data_postprocess_collection_update().
void BKE_scene_collections_iterator_begin | ( | struct BLI_Iterator * | iter, |
void * | data_in | ||
) |
Only use this in non-performance critical situations (it iterates over all scene collections twice)
Definition at line 1884 of file collection.c.
References BLI_assert, BLI_ITERATOR_INIT, BLI_Iterator::current, BLI_Iterator::data, data, MEM_callocN, scene, and scene_collections_array().
Referenced by scene_objects_iterator_begin().
void BKE_scene_collections_iterator_end | ( | struct BLI_Iterator * | iter | ) |
Definition at line 1913 of file collection.c.
References BLI_Iterator::data, data, MEM_freeN, and BLI_Iterator::valid.
Referenced by BKE_scene_objects_iterator_end().
void BKE_scene_collections_iterator_next | ( | struct BLI_Iterator * | iter | ) |
Definition at line 1901 of file collection.c.
References BLI_Iterator::current, BLI_Iterator::data, data, and BLI_Iterator::valid.
Referenced by BKE_scene_objects_iterator_next().
bool BKE_scene_collections_object_remove | ( | struct Main * | bmain, |
struct Scene * | scene, | ||
struct Object * | object, | ||
bool | free_us | ||
) |
Remove object from all collections of scene
Definition at line 1224 of file collection.c.
References NULL, scene, and scene_collections_object_remove().
Referenced by ED_object_base_free_and_unlink(), ED_object_base_free_and_unlink_no_indirect_check(), DocumentImporter::finish(), lib_override_library_proxy_convert_do(), outliner_batch_delete_hierarchy(), and ui_template_id_liboverride_hierarchy_make().
Generate a new GSet (or extend given objects_gset
if not NULL) with all objects referenced by all collections of given scene
.
Definition at line 2086 of file collection.c.
References BKE_scene_objects_iterator_end(), BKE_scene_objects_iterator_next(), BLI_Iterator::data, NULL, scene, scene_objects_iterator_begin(), and BLI_Iterator::valid.
Referenced by lib_override_library_create_post_process().
void BKE_scene_objects_iterator_begin | ( | struct BLI_Iterator * | iter, |
void * | data_in | ||
) |
Definition at line 1958 of file collection.c.
References NULL, scene, and scene_objects_iterator_begin().
Referenced by BKE_scene_objects_iterator_begin_ex().
void BKE_scene_objects_iterator_begin_ex | ( | struct BLI_Iterator * | iter, |
void * | data_in | ||
) |
Definition at line 1985 of file collection.c.
References BKE_scene_objects_iterator_begin(), BLI_Iterator::data, data, and scene_objects_iterator_skip_invalid_flag().
void BKE_scene_objects_iterator_end | ( | struct BLI_Iterator * | iter | ) |
Definition at line 2074 of file collection.c.
References BKE_scene_collections_iterator_end(), BLI_gset_free(), BLI_Iterator::data, data, MEM_freeN, and NULL.
Referenced by BKE_scene_objects_as_gset(), BKE_scene_objects_iterator_end_ex(), and single_obdata_users().
void BKE_scene_objects_iterator_end_ex | ( | struct BLI_Iterator * | iter | ) |
Definition at line 2013 of file collection.c.
References BKE_scene_objects_iterator_end(), BLI_Iterator::data, and data.
void BKE_scene_objects_iterator_next | ( | struct BLI_Iterator * | iter | ) |
Definition at line 2042 of file collection.c.
References BKE_scene_collections_iterator_next(), BLI_Iterator::current, BLI_Iterator::data, data, ListBase::first, Collection::gobject, CollectionObject::next, NULL, CollectionObject::ob, object_base_unique(), and BLI_Iterator::valid.
Referenced by BKE_scene_objects_as_gset(), BKE_scene_objects_iterator_next_ex(), and scene_objects_iterator_begin().
void BKE_scene_objects_iterator_next_ex | ( | struct BLI_Iterator * | iter | ) |
Definition at line 1998 of file collection.c.
References BKE_scene_objects_iterator_next(), BLI_Iterator::data, data, and scene_objects_iterator_skip_invalid_flag().