Blender
V3.3
|
#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 | CollectionsIteratorData |
struct | SceneObjectsIteratorData |
Macros | |
#define | DNA_DEPRECATED_ALLOW |
#define DNA_DEPRECATED_ALLOW |
Definition at line 8 of file collection.c.
typedef struct CollectionsIteratorData CollectionsIteratorData |
typedef struct SceneObjectsIteratorData SceneObjectsIteratorData |
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 | ( | Main * | bmain, |
Scene * | scene, | ||
const Object * | ob_src, | ||
Collection * | collection_dst | ||
) |
Definition at line 432 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, ID_IS_OVERRIDABLE_LIBRARY, Scene::master_collection, and scene.
void BKE_collection_blend_read_data | ( | BlendDataReader * | reader, |
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 | ( | BlendExpander * | expander, |
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 | ( | BlendLibReader * | reader, |
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 | ( | BlendWriter * | writer, |
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 | ( | Main * | bmain, |
Collection * | parent, | ||
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 | ( | Collection * | parent, |
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 | ( | Main * | bmain, |
Collection * | parent, | ||
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().
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().
Collection* BKE_collection_duplicate | ( | Main * | bmain, |
Collection * | parent, | ||
Collection * | collection, | ||
eDupli_ID_Flags | duplicate_flags, | ||
eLibIDDuplicateFlags | duplicate_options | ||
) |
Definition at line 655 of file collection.c.
References BKE_libblock_relink_to_newid(), BKE_main_collection_sync(), BKE_main_id_newptr_and_tag_clear(), 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_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().
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 Collection * | parent, |
const Collection * | collection | ||
) |
Definition at line 1524 of file collection.c.
References collection_find_child_recursive().
bool BKE_collection_has_object | ( | Collection * | collection, |
const Object * | ob | ||
) |
Definition at line 912 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 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 | ( | Collection * | collection, |
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 Collection * | collection | ) |
Definition at line 974 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 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().
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 | ( | Main * | bmain, |
Collection * | to_parent, | ||
Collection * | from_parent, | ||
Collection * | relative, | ||
bool | relative_after, | ||
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 | ( | 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().
ListBase BKE_collection_object_cache_get | ( | 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 | ( | 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 | ( | Main * | bmain, |
Object * | object, | ||
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().
Collection* BKE_collection_object_find | ( | Main * | bmain, |
Scene * | scene, | ||
Collection * | collection, | ||
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.
Base* BKE_collection_or_layer_objects | ( | const ViewLayer * | view_layer, |
Collection * | collection | ||
) |
Definition at line 837 of file collection.c.
References BKE_collection_object_cache_get(), ListBase::first, and FIRSTBASE.
Collection* BKE_collection_parent_editable_find_recursive | ( | const ViewLayer * | view_layer, |
Collection * | collection | ||
) |
Definition at line 1005 of file collection.c.
References BKE_view_layer_has_collection(), COLLECTION_IS_MASTER, Collection::flag, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, LISTBASE_FOREACH, NULL, and Collection::parents.
Referenced by BKE_collection_viewlayer_object_add().
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 | ( | Main * | bmain, |
const ViewLayer * | view_layer, | ||
Collection * | collection, | ||
Object * | ob | ||
) |
Definition at line 1130 of file collection.c.
References BKE_collection_object_add_notest(), BKE_collection_parent_editable_find_recursive(), and NULL.
Referenced by BKE_collection_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 | ( | 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 | ( | 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 | ( | 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 | ( | 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().
|
static |
Definition at line 397 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 265 of file collection.c.
References BKE_collection_blend_read_data().
|
static |
Definition at line 354 of file collection.c.
References BKE_collection_blend_read_expand().
|
static |
Definition at line 317 of file collection.c.
References BKE_collection_blend_read_lib().
|
static |
Definition at line 206 of file collection.c.
References BKE_collection_blend_write_nolib(), BLI_listbase_clear(), BLO_write_id_struct, COLLECTION_HAS_OBJECT_CACHE, COLLECTION_HAS_OBJECT_CACHE_INSTANCED, Collection::flag, Collection::id, Collection::object_cache, Collection::object_cache_instanced, Collection::parents, and Collection::tag.
|
static |
Definition at line 1534 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 1567 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 95 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 1479 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 554 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_COPY_DEFAULT, 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 1504 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 1509 of file collection.c.
References Collection::children, and LISTBASE_FOREACH.
Referenced by BKE_collection_has_collection(), and collection_object_add().
|
static |
Definition at line 1529 of file collection.c.
References BLI_findptr(), and Collection::parents.
Referenced by BKE_collection_parent_relations_rebuild(), and collection_child_remove().
|
static |
Definition at line 142 of file collection.c.
References BKE_LIB_FOREACHID_PROCESS_IDSUPER, 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.
Definition at line 128 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_data().
|
static |
Definition at line 1697 of file collection.c.
References Collection::children, LISTBASE_FOREACH, and NULL.
Referenced by BKE_collection_from_index().
Definition at line 77 of file collection.c.
References BLI_assert, DNA_struct_default_get, MEMCMP_STRUCT_AFTER_IS_ZERO, and MEMCPY_STRUCT_AFTER.
|
static |
Definition at line 1414 of file collection.c.
References Collection::children, ELEM, Collection::gobject, LISTBASE_FOREACH, and NULL.
Referenced by BKE_collection_cycle_find().
|
static |
Definition at line 1456 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 1313 of file collection.c.
References BLI_freelinkN(), collection_find_child(), LISTBASE_FOREACH_MUTABLE, NULL, and Collection::parents.
Referenced by BKE_collections_child_remove_nulls().
|
static |
Definition at line 941 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 1304 of file collection.c.
References BLI_freelinkN(), Collection::children, LISTBASE_FOREACH_MUTABLE, and NULL.
Referenced by BKE_collections_child_remove_nulls().
|
static |
Definition at line 1038 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_from(), BKE_collection_object_add_notest(), collection_copy_data(), and collection_duplicate_recursive().
|
static |
Definition at line 751 of file collection.c.
References BASE_ENABLED_RENDER, BASE_ENABLED_VIEWPORT, BLI_addtail(), BLI_findptr(), Collection::children, COLLECTION_HIDE_RENDER, COLLECTION_HIDE_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 819 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 869 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 1074 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 1266 of file collection.c.
References BKE_collection_object_cache_free(), BLI_freelinkN(), Collection::gobject, LISTBASE_FOREACH, and LISTBASE_FOREACH_MUTABLE.
Referenced by BKE_collections_object_remove_duplicates().
|
static |
Definition at line 1234 of file collection.c.
References BKE_collection_object_cache_free(), BLI_freelinkN(), Collection::gobject, LISTBASE_FOREACH_MUTABLE, and NULL.
Referenced by BKE_collections_object_remove_nulls().
|
static |
Definition at line 1723 of file collection.c.
References BASE_SELECTABLE, BASE_SELECTED, BKE_view_layer_base_find(), Collection::children, COLLECTION_HIDE_SELECT, Collection::flag, Base::flag, Collection::gobject, and LISTBASE_FOREACH.
Referenced by BKE_collection_objects_select().
Definition at line 165 of file collection.c.
References BLI_assert, BLI_assert_msg, COLLECTION_IS_MASTER, Collection::flag, ID::flag, GS, id, Scene::id, ID_SCE, LIB_EMBEDDED_DATA, LIB_TAG_NO_MAIN, LISTBASE_FOREACH, Scene::master_collection, ID::name, NULL, scene, Main::scenes, and ID::tag.
|
static |
Definition at line 1639 of file collection.c.
References BKE_collection_parent_relations_rebuild(), Collection::children, COLLECTION_TAG_RELATION_REBUILD, LIB_TAG_COPIED_ON_WRITE, LIB_TAG_NO_MAIN, LISTBASE_FOREACH, and Collection::tag.
Referenced by BKE_main_collections_parent_relations_rebuild().
|
static |
Definition at line 986 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 271 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 2029 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 1837 of file collection.c.
References callback, Collection::children, data, and LISTBASE_FOREACH.
Referenced by scene_collections_array().
|
static |
Definition at line 1861 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 1854 of file collection.c.
References data.
Referenced by scene_collections_array().
|
static |
Definition at line 1848 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 1196 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, ID_IS_LINKED, ID_IS_OVERRIDE_LIBRARY, NULL, and scene.
Referenced by BKE_collection_object_move(), and BKE_scene_collections_object_remove().
|
static |
Definition at line 1934 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().
|
static |
Definition at line 1965 of file collection.c.
References BLI_Iterator::current, BLI_Iterator::data, data, Object::flag, BLI_Iterator::skip, and BLI_Iterator::valid.
Referenced by BKE_scene_objects_iterator_begin_ex(), and BKE_scene_objects_iterator_next_ex().
IDTypeInfo IDType_ID_GR |
Definition at line 360 of file collection.c.