|
Blender
V2.93
|
#include <string.h>#include "BLI_blenlib.h"#include "BLI_iterator.h"#include "BLI_listbase.h"#include "BLI_math_base.h"#include "BLI_threads.h"#include "BLT_translation.h"#include "BKE_anim_data.h"#include "BKE_collection.h"#include "BKE_icons.h"#include "BKE_idprop.h"#include "BKE_idtype.h"#include "BKE_layer.h"#include "BKE_lib_id.h"#include "BKE_lib_query.h"#include "BKE_lib_remap.h"#include "BKE_main.h"#include "BKE_object.h"#include "BKE_rigidbody.h"#include "BKE_scene.h"#include "DNA_defaults.h"#include "DNA_ID.h"#include "DNA_collection_types.h"#include "DNA_layer_types.h"#include "DNA_object_types.h"#include "DNA_rigidbody_types.h"#include "DNA_scene_types.h"#include "DEG_depsgraph.h"#include "DEG_depsgraph_query.h"#include "MEM_guardedalloc.h"#include "BLO_read_write.h"Go to the source code of this file.
Classes | |
| struct | LayerCollectionFlag |
| struct | CollectionsIteratorData |
| struct | SceneObjectsIteratorData |
Macros | |
| #define | DNA_DEPRECATED_ALLOW |
Collection move (outliner drag & drop) | |
| typedef struct LayerCollectionFlag | LayerCollectionFlag |
| static void | layer_collection_flags_store_recursive (const LayerCollection *layer_collection, LayerCollectionFlag *flag) |
| static void | layer_collection_flags_store (Main *bmain, const Collection *collection, ListBase *r_layer_level_list) |
| static void | layer_collection_flags_free_recursive (LayerCollectionFlag *flag) |
| static void | layer_collection_flags_restore_recursive (LayerCollection *layer_collection, LayerCollectionFlag *flag) |
| static void | layer_collection_flags_restore (ListBase *flags, const Collection *collection) |
| bool | BKE_collection_move (Main *bmain, Collection *to_parent, Collection *from_parent, Collection *relative, bool relative_after, Collection *collection) |
| #define DNA_DEPRECATED_ALLOW |
Definition at line 22 of file collection.c.
| typedef struct CollectionsIteratorData CollectionsIteratorData |
| typedef struct LayerCollectionFlag LayerCollectionFlag |
| typedef struct SceneObjectsIteratorData SceneObjectsIteratorData |
| Collection* BKE_collection_add | ( | Main * | bmain, |
| Collection * | collection_parent, | ||
| const char * | name_custom | ||
| ) |
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 435 of file collection.c.
References BKE_main_collection_sync(), and collection_add().
Referenced by add_loose_objects_to_scene(), 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(), lib_override_library_create_post_process(), and move_to_collection_exec().
| void BKE_collection_add_from_collection | ( | Main * | bmain, |
| Scene * | scene, | ||
| Collection * | collection_src, | ||
| 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 476 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, Scene::master_collection, and scene.
Referenced by lib_override_library_create_post_process().
| void BKE_collection_add_from_object | ( | Main * | bmain, |
| Scene * | scene, | ||
| const Object * | ob_src, | ||
| 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().
Definition at line 448 of file collection.c.
References BKE_collection_has_object(), BKE_main_collection_sync(), collection_child_add(), FOREACH_SCENE_COLLECTION_BEGIN, FOREACH_SCENE_COLLECTION_END, ID_IS_LINKED, Scene::master_collection, and scene.
| void BKE_collection_blend_read_data | ( | BlendDataReader * | reader, |
| Collection * | collection | ||
| ) |
Definition at line 244 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 | ( | BlendExpander * | expander, |
| Collection * | collection | ||
| ) |
Definition at line 345 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 | ( | BlendLibReader * | reader, |
| Collection * | collection | ||
| ) |
Definition at line 310 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 | ( | BlendWriter * | writer, |
| Collection * | collection | ||
| ) |
Definition at line 197 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 | ( | Main * | bmain, |
| Collection * | parent, | ||
| Collection * | child | ||
| ) |
Definition at line 1606 of file collection.c.
References BKE_main_collection_sync(), and collection_child_add().
Referenced by add_collections_to_scene(), and collection_link_exec().
| bool BKE_collection_child_add_no_sync | ( | Collection * | parent, |
| Collection * | child | ||
| ) |
Definition at line 1616 of file collection.c.
References collection_child_add().
Referenced by single_object_users_collection().
| bool BKE_collection_child_remove | ( | Main * | bmain, |
| Collection * | parent, | ||
| Collection * | child | ||
| ) |
Definition at line 1621 of file collection.c.
References BKE_main_collection_sync(), and collection_child_remove().
Referenced by collection_cycle_fix_recursive(), and unlink_collection_fn().
| bool BKE_collection_cycle_find | ( | Collection * | new_ancestor, |
| 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 1450 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_child_add(), collection_cycle_fix_recursive(), collection_instance_add_exec(), and collection_instance_exec().
| bool BKE_collection_cycles_fix | ( | Main * | bmain, |
| Collection * | collection | ||
| ) |
Find and fix potential cycles in collections.
| collection | The collection to check for existing cycles. |
Definition at line 1519 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 | ( | Main * | bmain, |
| Collection * | collection, | ||
| bool | hierarchy | ||
| ) |
Remove a collection, optionally removing its child objects or moving them to parent collections.
Definition at line 520 of file collection.c.
References BKE_collection_delete(), BKE_id_delete(), BKE_main_collection_sync(), BLI_assert, 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().
| Collection* BKE_collection_duplicate | ( | Main * | bmain, |
| Collection * | parent, | ||
| Collection * | collection, | ||
| eDupli_ID_Flags | duplicate_flags, | ||
| eLibIDDuplicateFlags | duplicate_options | ||
| ) |
Make a deep copy (aka duplicate) of the given collection and all of its children, recursively.
Definition at line 688 of file collection.c.
References BKE_libblock_relink_to_newid(), BKE_main_collection_sync(), BKE_main_id_clear_newpoins(), BKE_main_id_tag_all(), BLI_assert, collection_duplicate_recursive(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, Collection::id, ID_IS_LINKED, LIB_ID_DUPLICATE_IS_ROOT_ID, LIB_ID_DUPLICATE_IS_SUBPROCESS, LIB_TAG_NEW, ID::tag, and USER_DUP_LINKED_ID.
| void BKE_collection_free | ( | Collection * | collection | ) |
Free (or release) any data used by this collection (does not free the collection itself).
Definition at line 510 of file collection.c.
References BKE_libblock_free_data(), collection_free_data(), and Collection::id.
Referenced by scene_free_data().
| Collection* BKE_collection_from_index | ( | Scene * | scene, |
| const 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 1734 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 | ( | Collection * | parent, |
| Collection * | collection | ||
| ) |
Definition at line 1545 of file collection.c.
References collection_find_child_recursive().
Referenced by outliner_collection_is_isolated().
| bool BKE_collection_has_object | ( | Collection * | collection, |
| const Object * | ob | ||
| ) |
Definition at line 952 of file collection.c.
References BLI_findptr(), ELEM, Collection::gobject, and NULL.
Referenced by BKE_collection_add_from_object(), BKE_collection_object_add_from(), and BKE_collection_object_find().
| bool BKE_collection_has_object_recursive | ( | Collection * | collection, |
| Object * | ob | ||
| ) |
Definition at line 961 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(), EEVEE_lightprobes_obj_visibility_cb(), EEVEE_render_cache(), make_override_collections_of_linked_object_itemf(), psys_check_group_weights(), select_grouped_exec(), and template_id_cb().
| bool BKE_collection_has_object_recursive_instanced | ( | Collection * | collection, |
| Object * | ob | ||
| ) |
Definition at line 971 of file collection.c.
References BKE_collection_object_cache_instanced_get(), BLI_findptr(), ELEM, and NULL.
Referenced by _lineart_object_not_in_source_collection(), and lineart_gpencil_generate().
| bool BKE_collection_is_empty | ( | const Collection * | collection | ) |
Definition at line 1014 of file collection.c.
References BLI_listbase_is_empty(), Collection::children, and Collection::gobject.
| bool BKE_collection_is_in_scene | ( | Collection * | collection | ) |
Definition at line 1391 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(), BKE_collection_object_remove(), and lib_override_library_create_post_process().
| Collection* BKE_collection_master_add | ( | void | ) |
Definition at line 892 of file collection.c.
References BKE_libblock_alloc(), 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 | ( | Main * | bmain, |
| Collection * | to_parent, | ||
| Collection * | from_parent, | ||
| Collection * | relative, | ||
| bool | relative_after, | ||
| Collection * | collection | ||
| ) |
Definition at line 1918 of file collection.c.
References BKE_collection_cycle_find(), BKE_collection_object_cache_free(), BKE_main_collection_sync(), BKE_scene_find_from_collection(), BLI_insertlinkafter(), BLI_insertlinkbefore(), BLI_remlink(), Collection::children, LayerCollectionFlag::collection, collection_child_add(), collection_child_remove(), collection_find_child(), COLLECTION_IS_MASTER, Collection::flag, layer_collection_flags_restore(), and layer_collection_flags_store().
Referenced by collection_drop_invoke().
| void BKE_collection_new_name_get | ( | Collection * | collection_parent, |
| char * | rname | ||
| ) |
The automatic/fallback name of a new collection.
Definition at line 751 of file collection.c.
References BLI_listbase_count(), BLI_sprintfN(), BLI_strdup(), BLI_strncpy(), Collection::children, COLLECTION_IS_MASTER, 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 | ( | Main * | bmain, |
| Collection * | collection, | ||
| Object * | ob | ||
| ) |
Add object to collection
Definition at line 1134 of file collection.c.
References BKE_collection_is_in_scene(), BKE_main_collection_sync(), BLI_assert, collection_object_add(), collection_parent_editable_find_recursive(), DEG_id_tag_update(), ELEM, Collection::id, ID_RECALC_GEOMETRY, and NULL.
Referenced by add_collections_to_scene(), add_loose_object_data_to_scene(), add_loose_objects_to_scene(), bc_add_object(), BKE_collection_object_move(), BKE_object_add(), BKE_object_add_for_data(), collection_add_exec(), collection_create_exec(), collection_drop_invoke(), collection_link_exec(), do_version_layers_to_collections(), do_versions_after_linking_280(), ED_rigidbody_constraint_add(), gpencil_layer_to_curve(), import_endjob(), lib_override_library_create_post_process(), 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 | ( | Main * | bmain, |
| Scene * | scene, | ||
| Object * | ob_src, | ||
| 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 1168 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(), object_add_duplicate_internal(), and template_id_cb().
| void BKE_collection_object_cache_free | ( | Collection * | collection | ) |
Definition at line 872 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(), and collection_object_remove_nulls().
| ListBase BKE_collection_object_cache_get | ( | Collection * | collection | ) |
Definition at line 827 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(), make_proxy_exec(), and psys_find_group_weights().
| ListBase BKE_collection_object_cache_instanced_get | ( | Collection * | collection | ) |
Definition at line 843 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 | ( | Main * | bmain, |
| Object * | object, | ||
| Collection * | collection | ||
| ) |
Definition at line 938 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().
| Collection* BKE_collection_object_find | ( | Main * | bmain, |
| Scene * | scene, | ||
| Collection * | collection, | ||
| Object * | ob | ||
| ) |
Definition at line 990 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 | ( | Main * | bmain, |
| Scene * | scene, | ||
| Collection * | collection_dst, | ||
| Collection * | collection_src, | ||
| Object * | ob | ||
| ) |
Move object from a collection into another
If source collection is NULL move it from all the existing collections.
Definition at line 1367 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 | ( | Main * | bmain, |
| Collection * | collection, | ||
| Object * | ob, | ||
| const bool | free_us | ||
| ) |
Remove object from collection.
Definition at line 1193 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 | ( | ViewLayer * | view_layer, |
| 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 1781 of file collection.c.
References BKE_layer_collection_first_from_scene_collection(), BKE_layer_collection_objects_select(), collection_objects_select(), and NULL.
| Base* BKE_collection_or_layer_objects | ( | const ViewLayer * | view_layer, |
| Collection * | collection | ||
| ) |
Definition at line 877 of file collection.c.
References BKE_collection_object_cache_get(), ListBase::first, and FIRSTBASE.
| void BKE_collection_parent_relations_rebuild | ( | Collection * | collection | ) |
Rebuild parent relationships from child ones, for all children of given collection.
Definition at line 1636 of file collection.c.
References BKE_collection_cycle_find(), BLI_addtail(), BLI_freelinkN(), Collection::children, CollectionParent::collection, collection_find_child(), 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 776 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().
| void BKE_collections_after_lib_link | ( | Main * | bmain | ) |
Definition at line 1406 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 | ( | Main * | bmain, |
| Collection * | parent_collection, | ||
| 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 1318 of file collection.c.
References BLI_freelinkN(), collection_find_child(), collection_missing_parents_remove(), collection_null_children_remove(), Main::collections, ListBase::first, Collection::id, Scene::id, Scene::master_collection, ID::next, NULL, Collection::parents, scene, and Main::scenes.
Referenced by libblock_remap_data_postprocess_collection_update().
| void BKE_collections_object_remove_nulls | ( | Main * | bmain | ) |
Definition at line 1271 of file collection.c.
References collection_object_remove_nulls(), Main::collections, ListBase::first, Scene::id, Scene::master_collection, ID::next, scene, and Main::scenes.
Referenced by libblock_remap_data_postprocess_object_update().
| void BKE_main_collections_parent_relations_rebuild | ( | Main * | bmain | ) |
Rebuild parent relationships from child ones, for all collections in given bmain.
Definition at line 1671 of file collection.c.
References BLI_freelistN(), collection_parents_rebuild_recursive(), COLLECTION_TAG_RELATION_REBUILD, Main::collections, ListBase::first, Scene::id, Scene::master_collection, ID::next, NULL, scene, and Main::scenes.
Referenced by after_liblink_merged_bmain_process(), and libblock_remap_data_postprocess_collection_update().
| void BKE_scene_collections_iterator_begin | ( | BLI_Iterator * | iter, |
| void * | data_in | ||
| ) |
Only use this in non-performance critical situations (it iterates over all scene collections twice)
Definition at line 2048 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 2077 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 2065 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 | ( | Main * | bmain, |
| Scene * | scene, | ||
| Object * | ob, | ||
| const bool | free_us | ||
| ) |
Remove object from all collections of scene
Definition at line 1243 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(), and outline_batch_delete_hierarchy().
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 2196 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 | ( | BLI_Iterator * | iter, |
| void * | data_in | ||
| ) |
Definition at line 2122 of file collection.c.
References NULL, scene, and scene_objects_iterator_begin().
| void BKE_scene_objects_iterator_end | ( | BLI_Iterator * | iter | ) |
Definition at line 2177 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(), and single_obdata_users().
| void BKE_scene_objects_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 2145 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(), and scene_objects_iterator_begin().
|
static |
Definition at line 403 of file collection.c.
References BKE_collection_new_name_get(), BKE_id_new(), collection_child_add(), Collection::id, ID_GR, id_us_min(), MAX_NAME, and STRNCPY.
Referenced by BKE_collection_add().
|
static |
Definition at line 273 of file collection.c.
References BKE_collection_blend_read_data().
|
static |
Definition at line 362 of file collection.c.
References BKE_collection_blend_read_expand().
|
static |
Definition at line 325 of file collection.c.
References BKE_collection_blend_read_lib().
|
static |
Definition at line 213 of file collection.c.
References BKE_collection_blend_write_nolib(), BLI_listbase_clear(), BLO_write_id_struct, BLO_write_is_undo(), COLLECTION_HAS_OBJECT_CACHE, COLLECTION_HAS_OBJECT_CACHE_INSTANCED, Collection::flag, Collection::id, Collection::object_cache, Collection::object_cache_instanced, Collection::parents, Collection::tag, and ID::us.
|
static |
Definition at line 1555 of file collection.c.
References BKE_collection_cycle_find(), BKE_collection_object_cache_free(), BLI_addtail(), Collection::children, CollectionParent::collection, CollectionChild::collection, collection_find_child(), Collection::id, id_us_plus(), LIB_ID_CREATE_NO_MAIN, MEM_callocN, and Collection::parents.
Referenced by BKE_collection_add_from_collection(), BKE_collection_add_from_object(), BKE_collection_child_add(), BKE_collection_child_add_no_sync(), BKE_collection_delete(), BKE_collection_move(), collection_add(), collection_copy_data(), and collection_duplicate_recursive().
|
static |
Definition at line 1588 of file collection.c.
References BKE_collection_object_cache_free(), BLI_freelinkN(), Collection::children, collection_find_child(), collection_find_parent(), Collection::id, id_us_min(), NULL, and Collection::parents.
Referenced by BKE_collection_child_remove(), BKE_collection_move(), and collection_duplicate_recursive().
|
static |
Only copy internal data of Collection ID from source to already allocated/initialized destination. You probably never want to use that directly, use BKE_id_copy or BKE_id_copy_ex for typical needs.
WARNING! This function will not handle ID user count!
| flag | Copying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more). |
Definition at line 108 of file collection.c.
References BKE_previewimg_id_copy(), BLI_assert, BLI_listbase_clear(), Collection::children, collection_child_add(), COLLECTION_HAS_OBJECT_CACHE, COLLECTION_HAS_OBJECT_CACHE_INSTANCED, COLLECTION_IS_MASTER, collection_object_add(), Collection::flag, ID::flag, Collection::gobject, Collection::id, LIB_EMBEDDED_DATA, LIB_ID_COPY_NO_PREVIEW, LISTBASE_FOREACH, NULL, Collection::object_cache, Collection::object_cache_instanced, Collection::parents, and Collection::preview.
|
static |
Definition at line 1494 of file collection.c.
References BKE_collection_child_remove(), BKE_collection_cycle_find(), LISTBASE_FOREACH_MUTABLE, and Collection::parents.
Referenced by BKE_collection_cycles_fix().
|
static |
Definition at line 579 of file collection.c.
References BKE_id_copy_for_duplicate(), BKE_object_duplicate(), BLI_assert, BLI_insertlinkafter(), BLI_remlink(), Collection::children, collection_child_add(), collection_child_remove(), collection_find_child(), COLLECTION_IS_MASTER, collection_object_add(), collection_object_remove(), ELEM, Collection::flag, Collection::gobject, Collection::id, Object::id, if(), LIB_ID_DUPLICATE_IS_SUBPROCESS, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, ID::newid, NULL, and USER_DUP_OBJECT.
Referenced by BKE_collection_duplicate().
|
static |
Definition at line 1525 of file collection.c.
References BLI_findptr(), and Collection::children.
Referenced by BKE_collection_add_from_collection(), BKE_collection_move(), BKE_collection_parent_relations_rebuild(), BKE_collections_child_remove_nulls(), collection_child_add(), collection_child_remove(), collection_duplicate_recursive(), and collection_missing_parents_remove().
|
static |
Definition at line 1530 of file collection.c.
References Collection::children, and LISTBASE_FOREACH.
Referenced by BKE_collection_has_collection(), and collection_object_add().
|
static |
Definition at line 1550 of file collection.c.
References BLI_findptr(), and Collection::parents.
Referenced by collection_child_remove().
|
static |
Definition at line 155 of file collection.c.
References BKE_LIB_FOREACHID_PROCESS, Collection::children, data, Collection::gobject, IDWALK_CB_EMBEDDED, IDWALK_CB_LOOPBACK, IDWALK_CB_NEVER_SELF, IDWALK_CB_NOP, IDWALK_CB_USER, LIB_EMBEDDED_DATA, LISTBASE_FOREACH, NULL, and Collection::parents.
|
static |
Definition at line 141 of file collection.c.
References BKE_collection_object_cache_free(), BKE_previewimg_free(), BLI_freelistN(), Collection::children, Collection::gobject, Collection::parents, and Collection::preview.
Referenced by BKE_collection_free().
|
static |
Definition at line 1710 of file collection.c.
References Collection::children, LISTBASE_FOREACH, and NULL.
Referenced by BKE_collection_from_index().
|
static |
Definition at line 90 of file collection.c.
References BLI_assert, DNA_struct_default_get, MEMCMP_STRUCT_AFTER_IS_ZERO, and MEMCPY_STRUCT_AFTER.
|
static |
Definition at line 1420 of file collection.c.
References Collection::children, ELEM, Collection::gobject, LISTBASE_FOREACH, and NULL.
Referenced by BKE_collection_cycle_find().
|
static |
Definition at line 1471 of file collection.c.
References Collection::children, Collection::gobject, Collection::id, id_us_min(), LISTBASE_FOREACH, and NULL.
Referenced by BKE_collection_cycles_fix().
|
static |
Definition at line 1295 of file collection.c.
References BLI_freelinkN(), collection_find_child(), ListBase::first, NULL, and Collection::parents.
Referenced by BKE_collections_child_remove_nulls().
|
static |
Definition at line 981 of file collection.c.
References Main::collections, ListBase::first, Collection::id, Scene::master_collection, ID::next, and scene.
Referenced by BKE_collection_object_find().
|
static |
Definition at line 1283 of file collection.c.
References BLI_freelinkN(), Collection::children, ListBase::first, and NULL.
Referenced by BKE_collections_child_remove_nulls().
|
static |
Definition at line 1070 of file collection.c.
References BKE_collection_object_cache_free(), BKE_rigidbody_main_collection_object_add(), BLI_addtail(), BLI_findptr(), collection_find_child_recursive(), collection_tag_update_parent_recursive(), Collection::gobject, Object::id, ID_RECALC_COPY_ON_WRITE, id_us_plus(), Object::instance_collection, LIB_ID_CREATE_NO_MAIN, LIB_ID_CREATE_NO_USER_REFCOUNT, MEM_callocN, and CollectionObject::ob.
Referenced by BKE_collection_delete(), BKE_collection_object_add(), BKE_collection_object_add_from(), collection_copy_data(), and collection_duplicate_recursive().
|
static |
Definition at line 791 of file collection.c.
References BASE_ENABLED_RENDER, BASE_ENABLED_VIEWPORT, BLI_addtail(), BLI_findptr(), Collection::children, COLLECTION_RESTRICT_RENDER, COLLECTION_RESTRICT_VIEWPORT, Collection::flag, Base::flag, Collection::gobject, LISTBASE_FOREACH, MEM_callocN, NULL, and Base::object.
Referenced by BKE_collection_object_cache_get(), and BKE_collection_object_cache_instanced_get().
|
static |
Definition at line 859 of file collection.c.
References BLI_freelistN(), COLLECTION_HAS_OBJECT_CACHE, COLLECTION_HAS_OBJECT_CACHE_INSTANCED, Collection::flag, LISTBASE_FOREACH, Collection::object_cache, Collection::object_cache_instanced, and Collection::parents.
Referenced by BKE_collection_object_cache_free().
|
static |
Definition at line 909 of file collection.c.
References FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN, FOREACH_COLLECTION_OBJECT_RECURSIVE_END, Collection::id, Object::instance_collection, LIB_TAG_DOIT, and ID::tag.
Referenced by BKE_collection_object_cyclic_check().
|
static |
Definition at line 1106 of file collection.c.
References BKE_collection_object_cache_free(), BKE_id_free_us(), BLI_findptr(), BLI_freelinkN(), collection_tag_update_parent_recursive(), Collection::gobject, Object::id, ID_RECALC_COPY_ON_WRITE, id_us_min(), and NULL.
Referenced by BKE_collection_delete(), BKE_collection_object_remove(), collection_duplicate_recursive(), and scene_collections_object_remove().
|
static |
Definition at line 1253 of file collection.c.
References BKE_collection_object_cache_free(), BLI_freelinkN(), ListBase::first, Collection::gobject, and NULL.
Referenced by BKE_collections_object_remove_nulls().
|
static |
Definition at line 1741 of file collection.c.
References BASE_SELECTABLE, BASE_SELECTED, BKE_view_layer_base_find(), Collection::children, COLLECTION_RESTRICT_SELECT, Collection::flag, Base::flag, Collection::gobject, and LISTBASE_FOREACH.
Referenced by BKE_collection_objects_select().
Definition at line 177 of file collection.c.
References BLI_assert, COLLECTION_IS_MASTER, ListBase::first, Collection::flag, ID::flag, id, Scene::id, LIB_EMBEDDED_DATA, LIB_TAG_NO_MAIN, Scene::master_collection, ID::next, NULL, scene, Main::scenes, and ID::tag.
|
static |
Definition at line 1045 of file collection.c.
References COLLECTION_IS_MASTER, Collection::flag, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, LISTBASE_FOREACH, NULL, and Collection::parents.
Referenced by BKE_collection_object_add().
|
static |
Definition at line 1658 of file collection.c.
References BKE_collection_parent_relations_rebuild(), Collection::children, COLLECTION_TAG_RELATION_REBUILD, ListBase::first, NULL, and Collection::tag.
Referenced by BKE_main_collections_parent_relations_rebuild().
|
static |
Definition at line 1026 of file collection.c.
References COLLECTION_IS_MASTER, DEG_id_tag_update_ex(), Collection::flag, Collection::id, LISTBASE_FOREACH, and Collection::parents.
Referenced by collection_object_add(), and collection_object_remove().
|
static |
Definition at line 1855 of file collection.c.
References BLI_freelistN(), LayerCollectionFlag::flag, and LISTBASE_FOREACH.
Referenced by layer_collection_flags_restore().
|
static |
Restore a collection's (and its children's) flags for each view layer from the structure built in layer_collection_flags_store.
Definition at line 1895 of file collection.c.
References BKE_layer_collection_first_from_scene_collection(), BLI_assert, BLI_freelistN(), LayerCollectionFlag::collection, LayerCollectionFlag::flag, layer_collection_flags_free_recursive(), layer_collection_flags_restore_recursive(), LISTBASE_FOREACH, NULL, and LayerCollectionFlag::view_layer.
Referenced by BKE_collection_move().
|
static |
Definition at line 1864 of file collection.c.
References BLI_assert, BLI_listbase_count(), LayerCollection::collection, LayerCollectionFlag::flag, LayerCollection::flag, LAYER_COLLECTION_EXCLUDE, LayerCollection::layer_collections, LISTBASE_FOREACH, and LayerCollectionFlag::next.
Referenced by layer_collection_flags_restore().
|
static |
For every view layer, find the collection and save flags for it and its children in a temporary tree structure.
Definition at line 1829 of file collection.c.
References BKE_layer_collection_first_from_scene_collection(), BLI_addtail(), BLI_listbase_clear(), LayerCollectionFlag::collection, LayerCollectionFlag::flag, layer_collection_flags_store_recursive(), LISTBASE_FOREACH, MEM_callocN, NULL, scene, Main::scenes, LayerCollectionFlag::view_layer, and Scene::view_layers.
Referenced by BKE_collection_move().
|
static |
Definition at line 1812 of file collection.c.
References BLI_addtail(), LayerCollection::collection, LayerCollectionFlag::flag, LayerCollection::flag, LayerCollection::layer_collections, LISTBASE_FOREACH, and MEM_callocN.
Referenced by layer_collection_flags_store().
|
static |
Definition at line 279 of file collection.c.
References BLI_freelinkN(), BLO_read_id_address, Collection::children, Collection::gobject, lib, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, and NULL.
Referenced by BKE_collection_blend_read_lib().
|
static |
Ensures we only get each object once, even when included in several collections.
Definition at line 2132 of file collection.c.
References BLI_gset_ensure_p_ex(), CollectionObject::next, NULL, and CollectionObject::ob.
Referenced by BKE_scene_objects_iterator_next().
|
static |
Definition at line 1997 of file collection.c.
References callback, Collection::children, data, and LISTBASE_FOREACH.
Referenced by scene_collections_array().
|
static |
Definition at line 2021 of file collection.c.
References BLI_assert, Scene::master_collection, MEM_malloc_arrayN, NULL, scene, scene_collection_callback(), scene_collections_build_array(), and scene_collections_count().
Referenced by BKE_scene_collections_iterator_begin().
|
static |
Definition at line 2014 of file collection.c.
References data.
Referenced by scene_collections_array().
|
static |
Definition at line 2008 of file collection.c.
References data.
Referenced by scene_collections_array().
|
static |
Remove object from all collections of scene
| collection_skip | Don't remove base from this collection. |
Definition at line 1219 of file collection.c.
References BKE_main_collection_sync(), BKE_scene_remove_rigidbody_object(), collection_object_remove(), FOREACH_SCENE_COLLECTION_BEGIN, FOREACH_SCENE_COLLECTION_END, NULL, and scene.
Referenced by BKE_collection_object_move(), and BKE_scene_collections_object_remove().
|
static |
Definition at line 2098 of file collection.c.
References BKE_scene_collections_iterator_begin(), BKE_scene_objects_iterator_next(), BLI_gset_ptr_new(), BLI_ITERATOR_INIT, BLI_Iterator::data, data, ListBase::first, Collection::gobject, MEM_callocN, NULL, and scene.
Referenced by BKE_scene_objects_as_gset(), and BKE_scene_objects_iterator_begin().
| IDTypeInfo IDType_ID_GR |
Definition at line 368 of file collection.c.