|
Blender V5.0
|
#include "CLG_log.h"#include <cstring>#include <optional>#include "BLI_iterator.h"#include "BLI_listbase.h"#include "BLI_math_base.h"#include "BLI_mutex.hh"#include "BLI_string.h"#include "BLI_string_utf8.h"#include "BLI_string_utils.hh"#include "BLT_translation.hh"#include "BKE_anim_data.hh"#include "BKE_collection.hh"#include "BKE_file_handler.hh"#include "BKE_idprop.hh"#include "BKE_idtype.hh"#include "BKE_layer.hh"#include "BKE_lib_id.hh"#include "BKE_lib_query.hh"#include "BKE_lib_remap.hh"#include "BKE_library.hh"#include "BKE_main.hh"#include "BKE_object.hh"#include "BKE_preview_image.hh"#include "BKE_rigidbody.h"#include "BKE_scene.hh"#include "DNA_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.hh"#include "DEG_depsgraph_query.hh"#include "MEM_guardedalloc.h"#include "BLO_read_write.hh"Go to the source code of this file.
Classes | |
| struct | CollectionsIteratorData |
| struct | SceneObjectsIteratorData |
Macros | |
| #define | DNA_DEPRECATED_ALLOW |
Variables | |
| static CLG_LogRef | LOG = {"object.collection"} |
Collection Data-Block | |
| IDTypeInfo | IDType_ID_GR |
| static void | collection_init_data (ID *id) |
| static void | collection_copy_data (Main *bmain, std::optional< Library * >, ID *id_dst, const ID *id_src, const int flag) |
| static void | collection_free_data (ID *id) |
| static void | collection_foreach_id (ID *id, LibraryForeachIDData *data) |
| static ID ** | collection_owner_pointer_get (ID *id, const bool debug_relationship_assert) |
| void | BKE_collection_blend_write_prepare_nolib (BlendWriter *, Collection *collection) |
| void | BKE_collection_blend_write_nolib (BlendWriter *writer, Collection *collection) |
| static void | collection_blend_write (BlendWriter *writer, ID *id, const void *id_address) |
| void | BKE_collection_blend_read_data (BlendDataReader *reader, Collection *collection, ID *owner_id) |
| static void | collection_blend_read_data (BlendDataReader *reader, ID *id) |
| static void | collection_blend_read_after_liblink (BlendLibReader *, ID *id) |
| #define DNA_DEPRECATED_ALLOW |
Definition at line 10 of file collection.cc.
| 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 452 of file collection.cc.
References BKE_main_collection_sync(), and collection_add().
Referenced by BKE_lib_override_library_main_resync(), BKE_light_linking_collection_new(), blender::ed::object::collection_add_exec(), blender::ed::object::collection_create_exec(), blender::ed::outliner::collection_new_exec(), blender::io::usd::create_collection(), do_version_layers_to_collections(), do_versions_after_linking_280(), ED_rigidbody_constraint_add(), blender::io::obj::find_or_create_collection(), blender::io::usd::import_startjob(), loose_data_instantiate_ensure_active_collection(), and blender::ed::object::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 483 of file collection.cc.
References BKE_collection_child_find(), BKE_main_collection_sync(), collection_child_add(), FOREACH_SCENE_COLLECTION_BEGIN, FOREACH_SCENE_COLLECTION_END, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, and Scene::master_collection.
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 459 of file collection.cc.
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, and Scene::master_collection.
Referenced by lib_override_library_create_post_process().
| void BKE_collection_blend_read_data | ( | BlendDataReader * | reader, |
| Collection * | collection, | ||
| ID * | owner_id ) |
Definition at line 315 of file collection.cc.
References BKE_previewimg_blend_read(), BLI_assert, BLO_read_fileversion_get(), BLO_read_struct, BLO_read_struct_list, Collection::children, CLOG_WARN, COLLECTION_FLAG_ALL_RUNTIME, data, Collection::exporters, Collection::flag, ID::flag, Collection::gobject, Collection::id, ID_FLAG_EMBEDDED_DATA, IDP_BlendDataRead, ID::lib, LISTBASE_FOREACH, LOG, ID::name, Collection::owner_id, Collection::preview, and Collection::runtime.
Referenced by collection_blend_read_data(), and direct_link_id_embedded_id().
| void BKE_collection_blend_write_nolib | ( | BlendWriter * | writer, |
| Collection * | collection ) |
Definition at line 280 of file collection.cc.
References BKE_id_blend_write(), BKE_previewimg_blend_write(), BLO_write_struct, Collection::children, data, Collection::exporters, Collection::gobject, Collection::id, IDP_BlendWrite(), LISTBASE_FOREACH, and Collection::preview.
Referenced by collection_blend_write(), and scene_blend_write().
| void BKE_collection_blend_write_prepare_nolib | ( | BlendWriter * | writer, |
| Collection * | collection ) |
Perform some pre-writing cleanup on the COllection data itself (not in any sub-data referenced by pointers). To be called before writing the Collection struct itself.
Definition at line 273 of file collection.cc.
References COLLECTION_FLAG_ALL_RUNTIME, Collection::flag, and Collection::runtime.
Referenced by collection_blend_write(), and scene_blend_write().
| bool BKE_collection_child_add | ( | Main * | bmain, |
| Collection * | parent, | ||
| Collection * | child ) |
Definition at line 2010 of file collection.cc.
References BKE_main_collection_sync(), and collection_child_add().
Referenced by blender::ed::outliner::collection_link_exec(), light_linking_collection_add_collection(), loose_data_instantiate_collection_process(), ui_template_id_liboverride_hierarchy_make(), and blender::ed::object::visual_geometry_to_objects_exec().
| bool BKE_collection_child_add_no_sync | ( | Main * | bmain, |
| Collection * | parent, | ||
| Collection * | child ) |
Definition at line 2020 of file collection.cc.
References collection_child_add().
Referenced by blender::ed::object::single_object_users_collection().
| CollectionChild * BKE_collection_child_find | ( | Collection * | parent, |
| Collection * | collection ) |
Definition at line 1919 of file collection.cc.
References BLI_findptr(), Collection::children, and offsetof.
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(), blender::ed::outliner::collection_duplicate_exec(), collection_duplicate_recursive(), and collection_missing_parents_remove().
| bool BKE_collection_child_remove | ( | Main * | bmain, |
| Collection * | parent, | ||
| Collection * | child ) |
Definition at line 2025 of file collection.cc.
References BKE_main_collection_sync(), and collection_child_remove().
Referenced by BKE_light_linking_unlink_id_from_collection(), collection_cycle_fix_recursive(), blender::ed::object::collection_drop_exec(), blender::ed::object::make_override_library_exec(), and blender::ed::outliner::unlink_collection_fn().
| bool BKE_collection_contains_geometry_recursive | ( | const Collection * | collection | ) |
Check if the collection contains any geometry that can be rendered. Otherwise there's nothing to display in the preview, so don't generate one. Objects and sub-collections hidden in the render will be skipped.
Definition at line 1108 of file collection.cc.
References BKE_collection_contains_geometry_recursive(), Collection::children, COLLECTION_HIDE_RENDER, Collection::gobject, LISTBASE_FOREACH, OB_HIDE_RENDER, and OB_TYPE_IS_GEOMETRY.
Referenced by BKE_collection_contains_geometry_recursive(), BKE_light_linking_add_receiver_to_collection(), BKE_light_linking_link_receiver_to_emitter(), ED_preview_id_is_supported(), and icon_preview_startjob_all_sizes().
| 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 1849 of file collection.cc.
References BKE_collection_cycle_find(), collection_instance_find_recursive(), LISTBASE_FOREACH, and Collection::runtime.
Referenced by BKE_collection_cycle_find(), BKE_collection_move(), BKE_collection_parent_relations_rebuild(), BKE_collection_validate(), blender::ed::object::collection_add_info_get_from_op(), collection_child_add(), collection_cycle_fix_recursive(), and blender::ed::outliner::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 1913 of file collection.cc.
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 545 of file collection.cc.
References BKE_collection_delete(), BKE_id_delete(), BKE_main_collection_sync(), BLI_assert_msg, BLI_ghash_free(), Collection::children, CollectionChild::collection, collection_child_add(), COLLECTION_IS_MASTER, collection_object_add(), collection_object_remove_no_gobject_hash(), ListBase::first, Collection::flag, Collection::gobject, LIB_ID_CREATE_NO_DEG_TAG, LISTBASE_FOREACH, CollectionObject::ob, and Collection::runtime.
Referenced by BKE_collection_delete(), BKE_lib_override_library_main_resync(), and blender::ed::outliner::outliner_collection_delete().
| Collection * BKE_collection_duplicate | ( | Main * | bmain, |
| Collection * | parent, | ||
| CollectionChild * | child_old, | ||
| Collection * | collection, | ||
| eDupli_ID_Flags | duplicate_flags, | ||
| uint | duplicate_options ) |
Make a deep copy (aka duplicate) of the given collection and all of its children, recursively.
| dupflag | Controls which sub-data are also duplicated (see eDupli_ID_Flags in DNA_userdef_types.h). |
| duplicate_options | Additional context information about current duplicate call (e.g. if it's part of a higher-level duplication or not, etc.). (see eLibIDDuplicateFlags in BKE_lib_id.hh). |
Definition at line 732 of file collection.cc.
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, ID_REMAP_FORCE_OBDATA_IN_EDITMODE, ID_REMAP_SKIP_USER_CLEAR, ID_TAG_NEW, ID_TAG_NO_MAIN, LIB_ID_CREATE_NO_MAIN, LIB_ID_DUPLICATE_IS_ROOT_ID, LIB_ID_DUPLICATE_IS_SUBPROCESS, ID::tag, and USER_DUP_LINKED_ID.
Referenced by BKE_scene_duplicate(), and blender::ed::outliner::collection_duplicate_exec().
| CollectionExport * BKE_collection_exporter_add | ( | Collection * | collection, |
| char * | idname, | ||
| char * | label ) |
Add a new collection exporter to the collection.
Definition at line 1485 of file collection.cc.
References Collection::active_exporter_index, BKE_collection_exporter_name_set(), BLI_addtail(), BLI_listbase_count(), data, Collection::exporters, IDP_GROUP, IDP_New(), IO_HANDLER_PANEL_OPEN, MEM_callocN(), and STRNCPY().
Referenced by blender::ed::object::collection_exporter_add_exec().
| void BKE_collection_exporter_free_data | ( | CollectionExport * | data | ) |
Free all data owned by the collection exporter.
Definition at line 538 of file collection.cc.
References data, and IDP_FreeProperty().
Referenced by BKE_collection_exporter_remove(), and collection_free_data().
| bool BKE_collection_exporter_move | ( | Collection * | collection, |
| const int | from, | ||
| const int | to ) |
Move a collection exporter from one position to another.
Definition at line 1517 of file collection.cc.
References BLI_listbase_move_index(), and Collection::exporters.
Referenced by blender::ed::object::collection_exporter_move_exec().
| void BKE_collection_exporter_name_set | ( | const ListBase * | exporters, |
| CollectionExport * | data, | ||
| const char * | newname ) |
Assigns a unique name to the collection exporter.
Definition at line 524 of file collection.cc.
References BLI_listbase_from_link(), BLI_uniquename(), data, name, offsetof, and STRNCPY().
Referenced by BKE_collection_exporter_add(), and blo_do_versions_430().
| void BKE_collection_exporter_remove | ( | Collection * | collection, |
| CollectionExport * | data ) |
Remove a collection exporter from the collection.
Definition at line 1504 of file collection.cc.
References Collection::active_exporter_index, BKE_collection_exporter_free_data(), BLI_listbase_count(), BLI_remlink(), count, data, Collection::exporters, and MEM_freeN().
Referenced by blender::ed::object::collection_exporter_remove_exec().
| void BKE_collection_free_data | ( | Collection * | collection | ) |
Free (or release) any data used by this collection (does not free the collection itself).
Definition at line 518 of file collection.cc.
References BKE_libblock_free_data(), collection_free_data(), and Collection::id.
Referenced by scene_free_data().
| Collection * BKE_collection_from_session_uid | ( | Main * | bmain, |
| uint64_t | session_uid, | ||
| Scene ** | r_scene = nullptr ) |
Return Collection for a given session_uid and its owner Scene.
Definition at line 2190 of file collection.cc.
References BKE_collection_from_session_uid(), LISTBASE_FOREACH, and Main::scenes.
| Collection * BKE_collection_from_session_uid | ( | Scene * | scene, |
| uint64_t | session_uid ) |
Return Scene Collection for a given session_uid.
Definition at line 2181 of file collection.cc.
References collection_from_session_uid_recursive(), Collection::id, Scene::master_collection, and ID::session_uid.
Referenced by BKE_collection_from_session_uid(), blender::ed::object::move_to_collection_exec(), and blender::ed::object::move_to_collection_invoke().
| bool BKE_collection_has_collection | ( | const Collection * | parent, |
| const Collection * | collection ) |
Definition at line 1940 of file collection.cc.
References collection_find_child_recursive().
Referenced by lib_override_library_create_post_process(), blender::ed::object::make_override_library_invoke(), blender::ed::outliner::outliner_collection_is_isolated(), template_id_liboverride_hierarchy_collections_tag_recursive(), and ui_template_id_liboverride_hierarchy_make().
| bool BKE_collection_has_object | ( | Collection * | collection, |
| const Object * | ob ) |
Definition at line 1065 of file collection.cc.
References BLI_ghash_lookup(), collection_gobject_hash_ensure(), ELEM, and Collection::runtime.
Referenced by BKE_collection_add_from_object(), BKE_collection_object_add_from(), BKE_collection_object_find(), BKE_lib_override_library_id_is_user_deletable(), BKE_rigidbody_object_copy(), blender::ed::object::collection_link_exec(), blender::ed::object::collection_objects_remove_exec(), blender::ed::object::find_collections_containing_object(), lib_override_library_create_post_process(), lineart_intersection_mask_check(), lineart_intersection_priority_check(), lineart_usage_check(), blender::ed::object::make_override_library_object_overridable_check(), make_selected_objects_local(), blender::ed::object::move_to_collection_exec(), blender::ed::object::object_add_sync_rigid_body(), object_in_any_collection(), blender::ed::object::object_select_same_collection_exec(), blender::ed::object::objects_add_active_exec(), blender::ed::object::objects_remove_active_exec(), blender::ed::object::select_grouped_collection(), and blender::ed::outliner::unlink_object_fn().
| bool BKE_collection_has_object_recursive | ( | Collection * | collection, |
| Object * | ob ) |
Definition at line 1074 of file collection.cc.
References BKE_collection_object_cache_get(), BLI_findptr(), ELEM, and offsetof.
Referenced by animdata_filter_base_is_ok(), animdata_filter_grease_pencil(), BKE_object_scenes_users_get(), blender::ed::outliner::can_select_recursive(), ED_editors_init(), blender::ed::object::make_override_library_invoke(), object_in_any_scene(), psys_check_group_weights(), blender::ed::object::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 1084 of file collection.cc.
References BKE_collection_object_cache_instanced_get(), BLI_findptr(), ELEM, and offsetof.
Referenced by MOD_lineart_gpencil_generate_v3().
| bool BKE_collection_has_object_recursive_instanced_orig_id | ( | Collection * | collection_eval, |
| Object * | object_eval ) |
Find whether an evaluated object's original ID is contained or instanced by any object in this collection. The collection is expected to be an evaluated data-block too.
Definition at line 1094 of file collection.cc.
References BKE_collection_object_cache_instanced_get(), BLI_assert, DEG_get_original(), Collection::id, ID_TAG_COPIED_ON_EVAL, LISTBASE_FOREACH, and ID::tag.
Referenced by blender::nodes::node_geo_collection_info_cc::node_geo_exec().
| bool BKE_collection_is_empty | ( | const Collection * | collection | ) |
Definition at line 1164 of file collection.cc.
References BLI_listbase_is_empty(), Collection::children, and Collection::gobject.
Referenced by BKE_lib_override_library_main_resync(), BMD_error_messages(), and blender::ed::outliner::collection_drop_invoke().
| bool BKE_collection_is_in_scene | ( | Collection * | collection | ) |
Definition at line 1797 of file collection.cc.
References BKE_collection_is_in_scene(), COLLECTION_IS_MASTER, Collection::flag, LISTBASE_FOREACH, and Collection::runtime.
Referenced by BKE_collection_is_in_scene(), BKE_collection_object_add_notest(), BKE_collection_object_remove(), BKE_collection_object_replace(), and lib_override_library_create_post_process().
| Collection * BKE_collection_master_add | ( | Scene * | scene | ) |
Definition at line 998 of file collection.cc.
References BKE_libblock_alloc_in_lib(), BKE_SCENE_COLLECTION_NAME, BLI_assert, COLLECTION_COLOR_NONE, COLLECTION_IS_MASTER, Collection::color_tag, Collection::flag, ID::flag, Collection::id, Scene::id, ID_FLAG_EMBEDDED_DATA, ID_GR, ID::lib, LIB_ID_CREATE_NO_MAIN, Scene::master_collection, Collection::owner_id, and Collection::runtime.
Referenced by do_version_layers_to_collections(), do_versions_after_linking_280(), 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 2265 of file collection.cc.
References BKE_collection_child_find(), 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_IS_MASTER, and Collection::flag.
Referenced by blender::ed::outliner::collection_drop_invoke().
| void BKE_collection_new_name_get | ( | Collection * | collection_parent, |
| char | r_name[MAX_ID_NAME - 2] ) |
Definition at line 805 of file collection.cc.
References BLI_listbase_count(), BLI_snprintf(), BLI_snprintf_utf8(), BLI_strncpy_utf8(), BLI_strncpy_utf8_rlen(), Collection::children, COLLECTION_IS_MASTER, DATA_, Collection::flag, Collection::id, integer_digits_i(), MAX_ID_NAME, and ID::name.
Referenced by collection_add().
| bool BKE_collection_object_add | ( | Main * | bmain, |
| Collection * | collection, | ||
| 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 1567 of file collection.cc.
References BKE_collection_viewlayer_object_add().
Referenced by BKE_collection_object_move(), BKE_object_add_for_data(), BKE_rigidbody_object_copy(), blender::ed::object::collection_add_exec(), blender::ed::object::collection_create_exec(), blender::ed::outliner::collection_drop_invoke(), blender::ed::object::collection_link_exec(), blender::io::usd::USDStageReader::create_proto_collections(), ED_rigidbody_constraint_add(), blender::io::obj::geometry_to_blender_objects(), blender::io::usd::import_endjob(), import_endjob(), blender::io::ply::importer_main(), blender::io::stl::importer_main(), lib_override_library_create_post_process(), light_linking_collection_add_object(), loose_data_instantiate_object_base_instance_init(), blender::ed::object::make_links_data_exec(), blender::ed::object::make_links_scene_exec(), blender::ed::object::make_local_all__instance_indirect_unused(), blender::ed::object::move_to_collection_exec(), Freestyle::BlenderStrokeRenderer::NewMesh(), blender::ed::object::object_add_sync_base_collection(), blender::ed::object::object_add_sync_rigid_body(), object_preview_scene_create(), blender::ed::object::objects_add_active_exec(), blender::ed::outliner::scene_drop_invoke(), blender::bke::tests::TEST_F(), blender::bke::tests::TEST_F(), ui_template_id_liboverride_hierarchy_make(), blender::ed::object::visual_geometry_to_objects_exec(), and blender::bke::tests::WholeIDTestData::WholeIDTestData().
| 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 1590 of file collection.cc.
References BKE_collection_has_object(), BKE_main_collection_sync(), collection_object_add(), FOREACH_SCENE_COLLECTION_BEGIN, FOREACH_SCENE_COLLECTION_END, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, and Scene::master_collection.
Referenced by BKE_object_add_from(), blender::ed::object::duplibase_for_convert(), lib_override_library_create_post_process(), blender::ed::object::make_object_duplilist_real(), and blender::ed::object::object_add_sync_base_collection().
| bool BKE_collection_object_add_notest | ( | Main * | bmain, |
| Collection * | collection, | ||
| 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 1542 of file collection.cc.
References BKE_collection_is_in_scene(), BKE_main_collection_sync(), BLI_assert, collection_object_add(), Collection::id, ID_TAG_NO_MAIN, LIB_ID_CREATE_NO_MAIN, and ID::tag.
Referenced by BKE_collection_viewlayer_object_add(), do_version_layers_to_collections(), and do_versions_after_linking_280().
| void BKE_collection_object_cache_free | ( | const Main * | bmain, |
| Collection * | collection, | ||
| const int | id_create_flag ) |
Free the object cache of given collection and all of its ancestors (recursively).
| bmain | The Main database owning the collection. May be nullptr, only used if doing depsgraph tagging. |
| id_create_flag | Flags controlling ID creation, used here to enable or not depsgraph tagging of affected IDs (e.g. LIB_ID_CREATE_NO_DEG_TAG would prevent depsgraph tagging). |
Definition at line 955 of file collection.cc.
References BLI_assert, collection_object_cache_free_parent_recursive(), ID_RECALC_GEOMETRY, and ID_RECALC_HIERARCHY.
Referenced by BKE_collection_move(), collection_child_add(), collection_child_remove(), collection_gobject_hash_ensure_fix(), collection_object_add(), collection_object_remove_no_gobject_hash(), and blender::deg::deg_graph_build_finalize().
| ListBase BKE_collection_object_cache_get | ( | Collection * | collection | ) |
Definition at line 878 of file collection.cc.
References COLLECTION_HAS_OBJECT_CACHE, collection_object_cache_fill(), Collection::flag, lock, and Collection::runtime.
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 893 of file collection.cc.
References COLLECTION_HAS_OBJECT_CACHE_INSTANCED, collection_object_cache_fill(), Collection::flag, lock, and Collection::runtime.
Referenced by BKE_collection_has_object_recursive_instanced(), and BKE_collection_has_object_recursive_instanced_orig_id().
| bool BKE_collection_object_cyclic_check | ( | Main * | bmain, |
| Object * | object, | ||
| Collection * | collection ) |
Definition at line 1051 of file collection.cc.
References BKE_main_id_tag_listbase(), collection_object_cyclic_check_internal(), Main::collections, and ID_TAG_DOIT.
Referenced by blender::ed::object::collection_link_exec(), and blender::ed::object::objects_add_active_exec().
| Collection * BKE_collection_object_find | ( | Main * | bmain, |
| Scene * | scene, | ||
| Collection * | collection, | ||
| Object * | ob ) |
Definition at line 1140 of file collection.cc.
References BKE_collection_has_object(), collection_next_find(), Main::collections, ListBase::first, and Scene::master_collection.
Referenced by BKE_object_groups(), BKE_object_groups_clear(), blender::ed::object::collection_object_active_find_index(), blender::ed::object::collection_object_active_itemf(), and blender::ed::outliner::outliner_collection_get_for_recursive().
| 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 1773 of file collection.cc.
References BKE_collection_object_add(), BKE_collection_object_remove(), and scene_collections_object_remove().
Referenced by blender::ed::outliner::collection_drop_invoke(), and blender::ed::object::move_to_collection_exec().
| bool BKE_collection_object_remove | ( | Main * | bmain, |
| Collection * | collection, | ||
| Object * | ob, | ||
| bool | free_us ) |
Remove ob from collection.
Definition at line 1613 of file collection.cc.
References BKE_collection_is_in_scene(), BKE_main_collection_sync(), collection_object_remove(), ELEM, Collection::id, ID_TAG_NO_MAIN, LIB_ID_CREATE_NO_MAIN, and ID::tag.
Referenced by BKE_collection_object_move(), BKE_light_linking_unlink_id_from_collection(), BKE_object_groups_clear(), blender::ed::object::collection_objects_remove_exec(), blender::ed::object::collection_remove_exec(), do_versions_after_linking_280(), blender::ed::object::objects_remove_active_exec(), and blender::ed::outliner::unlink_object_fn().
| bool BKE_collection_object_replace | ( | Main * | bmain, |
| Collection * | collection, | ||
| Object * | ob_old, | ||
| Object * | ob_new ) |
Replace one object with another in a collection (managing user counts).
Definition at line 1634 of file collection.cc.
References BKE_collection_is_in_scene(), BKE_main_collection_sync(), BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_popkey(), collection_gobject_hash_ensure(), collection_object_remove_no_gobject_hash(), Object::id, id_us_min(), id_us_plus(), CollectionObject::ob, and Collection::runtime.
| bool BKE_collection_objects_select | ( | const Scene * | scene, |
| 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 2244 of file collection.cc.
References BKE_layer_collection_first_from_scene_collection(), BKE_layer_collection_objects_select(), and collection_objects_select().
| Base * BKE_collection_or_layer_objects | ( | const Scene * | scene, |
| ViewLayer * | view_layer, | ||
| Collection * | collection ) |
Definition at line 981 of file collection.cc.
References BKE_collection_object_cache_get(), BKE_view_layer_object_bases_get(), BKE_view_layer_synced_ensure(), and ListBase::first.
Referenced by BKE_collision_relations_create(), BKE_effector_relations_create(), and blender::deg::FromCollectionBuilderPipeline::FromCollectionBuilderPipeline().
| Collection * BKE_collection_parent_editable_find_recursive | ( | const ViewLayer * | view_layer, |
| Collection * | collection ) |
Return parent collection which is not linked.
Definition at line 1380 of file collection.cc.
References BKE_collection_parent_editable_find_recursive(), collection_is_editable_in_viewlayer(), COLLECTION_IS_MASTER, Collection::flag, LISTBASE_FOREACH, and Collection::runtime.
Referenced by BKE_collection_parent_editable_find_recursive(), BKE_collection_viewlayer_object_add(), and loose_data_instantiate_ensure_active_collection().
| void BKE_collection_parent_relations_rebuild | ( | Collection * | collection | ) |
Rebuild parent relationships from child ones, for all children of given collection.
Definition at line 2035 of file collection.cc.
References BKE_collection_child_find(), BKE_collection_cycle_find(), BLI_addtail(), BLI_assert, BLI_freelinkN(), Collection::children, CollectionParent::collection, collection_find_parent(), ID_TAG_COPIED_ON_EVAL, ID_TAG_NO_MAIN, LISTBASE_FOREACH_MUTABLE, and MEM_callocN().
Referenced by collection_parents_rebuild_recursive().
| const char * BKE_collection_ui_name_get | ( | Collection * | collection | ) |
The name to show in the interface.
Definition at line 827 of file collection.cc.
References COLLECTION_IS_MASTER, Collection::flag, Collection::id, IFACE_, and ID::name.
Referenced by draw_selected_name(), get_stats_string(), blender::ed::object::move_to_collection_exec(), blender::ed::object::move_to_collection_menu_draw(), and blender::ed::outliner::outliner_add_collection_init().
| bool BKE_collection_validate | ( | Collection * | collection | ) |
Perform some validation on integrity of the data of this collection.
Definition at line 2117 of file collection.cc.
References BKE_collection_cycle_find(), BLI_gset_clear(), BLI_gset_ensure_p_ex(), BLI_gset_free(), BLI_gset_ptr_new(), BLI_listbase_validate(), Collection::children, LISTBASE_FOREACH, and Collection::runtime.
| bool BKE_collection_viewlayer_object_add | ( | Main * | bmain, |
| const ViewLayer * | view_layer, | ||
| Collection * | collection, | ||
| 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.
Definition at line 1572 of file collection.cc.
References BKE_collection_object_add_notest(), and BKE_collection_parent_editable_find_recursive().
Referenced by BKE_collection_object_add(), and BKE_object_add().
| void BKE_collections_after_lib_link | ( | Main * | bmain | ) |
Definition at line 1812 of file collection.cc.
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 1734 of file collection.cc.
References BKE_collection_child_find(), BLI_freelinkN(), collection_missing_parents_remove(), collection_null_children_remove(), Main::collections, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, Collection::runtime, and Main::scenes.
Referenced by libblock_remap_data_postprocess_collection_update().
| void BKE_collections_object_remove_invalids | ( | Main * | bmain | ) |
Check all collections in bmain (including embedded ones in scenes) for invalid CollectionObject (either with NULL object pointer, or duplicates), and remove them.
Definition at line 1703 of file collection.cc.
References collection_gobject_hash_ensure_fix(), Main::collections, LISTBASE_FOREACH, and Main::scenes.
Referenced by libblock_remap_data_postprocess_object_update().
| void BKE_main_collections_object_cache_free | ( | const Main * | bmain | ) |
Free the object cache of all collections in given bmain, including master collections of scenes.
Definition at line 964 of file collection.cc.
References collection_object_cache_free(), Main::collections, ListBase::first, ID_RECALC_GEOMETRY, ID_RECALC_HIERARCHY, and Main::scenes.
Referenced by BKE_main_collection_sync_remap().
| void BKE_main_collections_parent_relations_rebuild | ( | Main * | bmain | ) |
Rebuild parent relationships from child ones, for all collections in given bmain.
Definition at line 2083 of file collection.cc.
References BLI_assert, BLI_freelistN(), BLI_listbase_is_empty(), collection_parents_rebuild_recursive(), COLLECTION_TAG_RELATION_REBUILD, Main::collections, LISTBASE_FOREACH, and Main::scenes.
Referenced by after_liblink_merged_bmain_process(), BKE_blendfile_library_relocate(), blo_read_file_internal(), libblock_remap_data_postprocess_collection_update(), and library_link_end().
| 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 2372 of file collection.cc.
References BLI_assert, BLI_ITERATOR_INIT, BLI_Iterator::current, BLI_Iterator::data, data, MEM_callocN(), and scene_collections_array().
Referenced by scene_objects_iterator_begin().
| void BKE_scene_collections_iterator_end | ( | BLI_Iterator * | iter | ) |
Definition at line 2401 of file collection.cc.
References BLI_Iterator::data, data, MEM_freeN(), and BLI_Iterator::valid.
Referenced by BKE_scene_objects_iterator_end().
| void BKE_scene_collections_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 2389 of file collection.cc.
References BLI_Iterator::current, BLI_Iterator::data, data, and BLI_Iterator::valid.
Referenced by BKE_scene_objects_iterator_next().
Remove object from all collections of scene
Definition at line 1698 of file collection.cc.
References scene_collections_object_remove().
Referenced by blender::ed::object::base_free_and_unlink(), blender::ed::object::base_free_and_unlink_no_indirect_check(), lib_override_library_proxy_convert_do(), blender::ed::outliner::outliner_batch_delete_object_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 2575 of file collection.cc.
References BKE_scene_objects_iterator_end(), BKE_scene_objects_iterator_next(), BLI_Iterator::data, 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 2446 of file collection.cc.
References 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 2473 of file collection.cc.
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 2563 of file collection.cc.
References BKE_scene_collections_iterator_end(), BLI_gset_free(), BLI_Iterator::data, data, and MEM_freeN().
Referenced by BKE_scene_objects_as_gset(), BKE_scene_objects_iterator_end_ex(), and blender::ed::object::single_obdata_users().
| void BKE_scene_objects_iterator_end_ex | ( | BLI_Iterator * | iter | ) |
Definition at line 2501 of file collection.cc.
References BKE_scene_objects_iterator_end(), BLI_Iterator::data, and data.
| void BKE_scene_objects_iterator_next | ( | BLI_Iterator * | iter | ) |
Definition at line 2530 of file collection.cc.
References BKE_scene_collections_iterator_next(), BLI_Iterator::current, BLI_Iterator::data, data, ListBase::first, Collection::gobject, CollectionObject::next, 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 | ( | BLI_Iterator * | iter | ) |
Definition at line 2486 of file collection.cc.
References BKE_scene_objects_iterator_next(), BLI_Iterator::data, data, and scene_objects_iterator_skip_invalid_flag().
|
static |
Definition at line 424 of file collection.cc.
References BKE_collection_new_name_get(), BKE_id_new(), collection_child_add(), Collection::id, id_us_min(), MAX_ID_NAME, name, and STRNCPY_UTF8.
Referenced by BKE_collection_add().
|
static |
Definition at line 367 of file collection.cc.
References BLI_assert, BLI_freelinkN(), COLLECTION_TAG_COLLECTION_OBJECT_DIRTY, Collection::gobject, LISTBASE_FOREACH_MUTABLE, and Collection::runtime.
|
static |
Definition at line 361 of file collection.cc.
References BKE_collection_blend_read_data().
|
static |
Definition at line 303 of file collection.cc.
References BKE_collection_blend_write_nolib(), BKE_collection_blend_write_prepare_nolib(), BLO_write_id_struct, and Collection::id.
|
static |
| id_create_flag | Creation/Copy ID management flags, e.g. LIB_ID_CREATE_NO_MAIN. |
Definition at line 1951 of file collection.cc.
References BKE_collection_child_find(), BKE_collection_cycle_find(), BKE_collection_object_cache_free(), BLI_addtail(), Collection::children, CollectionChild::collection, CollectionParent::collection, Collection::id, id_us_plus(), LIB_ID_CREATE_NO_MAIN, CollectionChild::light_linking, MEM_callocN(), and Collection::runtime.
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 |
| id_create_flag | Creation/Copy ID management flags, e.g. LIB_ID_CREATE_NO_MAIN. |
Definition at line 1989 of file collection.cc.
References BKE_collection_child_find(), BKE_collection_object_cache_free(), BLI_freelinkN(), Collection::children, collection_find_parent(), Collection::id, id_us_min(), and Collection::runtime.
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.hh's LIB_ID_COPY_... flags for more). |
Definition at line 142 of file collection.cc.
References BKE_previewimg_id_copy(), BLI_assert, BLI_listbase_clear(), Collection::children, collection_child_add(), collection_exporter_copy(), COLLECTION_HAS_OBJECT_CACHE, COLLECTION_HAS_OBJECT_CACHE_INSTANCED, COLLECTION_IS_MASTER, collection_object_add(), data, Collection::exporters, Collection::flag, flag, ID::flag, Collection::gobject, Collection::id, ID_FLAG_EMBEDDED_DATA, LIB_ID_COPY_NO_PREVIEW, LISTBASE_FOREACH, Collection::preview, and Collection::runtime.
|
static |
Definition at line 1894 of file collection.cc.
References BKE_collection_child_remove(), BKE_collection_cycle_find(), collection_cycle_fix_recursive(), LISTBASE_FOREACH_MUTABLE, and Collection::runtime.
Referenced by BKE_collection_cycles_fix(), and collection_cycle_fix_recursive().
|
static |
Definition at line 615 of file collection.cc.
References BKE_collection_child_find(), BKE_id_copy_for_duplicate(), BKE_object_duplicate(), BLI_assert, BLI_insertlinkafter(), BLI_remlink(), Collection::children, collection_child_add(), collection_child_remove(), collection_duplicate_recursive(), COLLECTION_IS_MASTER, collection_object_add(), collection_object_remove(), ELEM, Collection::flag, Collection::gobject, Collection::id, Object::id, LIB_ID_DUPLICATE_IS_SUBPROCESS, CollectionChild::light_linking, Object::light_linking, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, ID::newid, and USER_DUP_OBJECT.
Referenced by BKE_collection_duplicate(), and collection_duplicate_recursive().
|
static |
Definition at line 1526 of file collection.cc.
References BLI_addtail(), data, CollectionExport::export_properties, Collection::exporters, CollectionExport::fh_idname, CollectionExport::flag, IDP_AssignString(), IDP_CopyProperty(), IDP_GetPropertyFromGroup(), MEM_callocN(), and STRNCPY().
Referenced by collection_copy_data().
|
static |
Definition at line 1925 of file collection.cc.
References Collection::children, collection_find_child_recursive(), and LISTBASE_FOREACH.
Referenced by BKE_collection_has_collection(), collection_find_child_recursive(), and collection_object_add().
|
static |
Definition at line 1945 of file collection.cc.
References BLI_findptr(), offsetof, and Collection::runtime.
Referenced by BKE_collection_parent_relations_rebuild(), and collection_child_remove().
|
static |
Definition at line 209 of file collection.cc.
References BKE_LIB_FOREACHID_PROCESS_ID, BKE_LIB_FOREACHID_PROCESS_IDSUPER, BKE_lib_query_foreachid_process_flags_get(), Collection::children, collection_gobject_hash_update_object(), COLLECTION_TAG_COLLECTION_OBJECT_DIRTY, data, Collection::gobject, ID_FLAG_EMBEDDED_DATA, IDWALK_CB_EMBEDDED_NOT_OWNING, IDWALK_CB_LOOPBACK, IDWALK_CB_NEVER_SELF, IDWALK_CB_NOP, IDWALK_CB_OVERRIDE_LIBRARY_HIERARCHY_DEFAULT, IDWALK_CB_READFILE_IGNORE, IDWALK_CB_USER, IDWALK_NO_ORIG_POINTERS_ACCESS, LISTBASE_FOREACH, Collection::owner_id, and Collection::runtime.
|
static |
Definition at line 182 of file collection.cc.
References BKE_collection_exporter_free_data(), BKE_previewimg_free(), BLI_freelistN(), BLI_ghash_free(), Collection::children, collection_object_cache_free(), data, Collection::exporters, Collection::gobject, LIB_ID_CREATE_NO_DEG_TAG, LISTBASE_FOREACH, Collection::preview, and Collection::runtime.
Referenced by BKE_collection_free_data().
|
static |
Definition at line 2165 of file collection.cc.
References Collection::children, collection_from_session_uid_recursive(), and LISTBASE_FOREACH.
Referenced by BKE_collection_from_session_uid(), and collection_from_session_uid_recursive().
|
static |
Validate the integrity of the collection's CollectionObject list, and of its mapping.
Simple test is very fast, as it only checks that the 'dirty' tag for collection's objects is not set.
The extensive check is expensive. This should not be done from within loops over collections items, or from low-level operations that can be assumed safe (like adding or removing an object from a collection). It ensures that:
Definition at line 1323 of file collection.cc.
References BLI_assert, BLI_ghash_lookup(), collection_gobject_hash_create(), COLLECTION_TAG_COLLECTION_OBJECT_DIRTY, Collection::gobject, LISTBASE_FOREACH, Collection::runtime, and UNUSED_VARS_NDEBUG.
Referenced by collection_gobject_hash_ensure(), and collection_gobject_hash_ensure_fix().
|
static |
Definition at line 1179 of file collection.cc.
References BLI_ghash_ptr_new_ex(), BLI_listbase_count(), and Collection::gobject.
Referenced by collection_gobject_hash_create(), and collection_gobject_hash_ensure_fix().
|
static |
Definition at line 1184 of file collection.cc.
References BLI_assert, BLI_ghash_ensure_p(), collection_gobject_hash_alloc(), COLLECTION_TAG_COLLECTION_OBJECT_DIRTY, Collection::gobject, LISTBASE_FOREACH, Collection::runtime, and UNLIKELY.
Referenced by collection_gobject_assert_internal_consistency(), and collection_gobject_hash_ensure().
|
static |
Definition at line 1203 of file collection.cc.
References collection_gobject_assert_internal_consistency(), collection_gobject_hash_create(), and Collection::runtime.
Referenced by BKE_collection_has_object(), BKE_collection_object_replace(), collection_object_add(), and collection_object_remove().
|
static |
Similar to collection_gobject_hash_ensure/collection_gobject_hash_create, but does fix inconsistencies in the collection objects list.
Definition at line 1221 of file collection.cc.
References BKE_collection_object_cache_free(), BLI_freelinkN(), BLI_ghash_clear_ex(), BLI_ghash_ensure_p(), BLI_ghash_len(), collection_gobject_assert_internal_consistency(), collection_gobject_hash_alloc(), COLLECTION_TAG_COLLECTION_OBJECT_DIRTY, Collection::gobject, LISTBASE_FOREACH_MUTABLE, and Collection::runtime.
Referenced by BKE_collections_object_remove_invalids().
|
static |
Update the collections object hash, removing ob_old, inserting cob->ob as the new key.
| ob_old | The existing key to cob in the hash, not removed when nullptr. |
| cob | The cob->ob is to be used as the new key, when nullptr it's not added back into the hash. |
Definition at line 1277 of file collection.cc.
References BLI_ghash_ensure_p(), BLI_ghash_popkey(), COLLECTION_TAG_COLLECTION_OBJECT_DIRTY, CollectionObject::ob, and Collection::runtime.
Referenced by collection_foreach_id().
|
static |
Definition at line 123 of file collection.cc.
References BLI_assert, DNA_struct_default_get, MEMCMP_STRUCT_AFTER_IS_ZERO, MEMCPY_STRUCT_AFTER, and Collection::runtime.
|
static |
Definition at line 1826 of file collection.cc.
References Collection::children, collection_instance_find_recursive(), ELEM, Collection::gobject, and LISTBASE_FOREACH.
Referenced by BKE_collection_cycle_find(), and collection_instance_find_recursive().
|
static |
Definition at line 1870 of file collection.cc.
References Collection::children, collection_instance_fix_recursive(), Collection::gobject, Collection::id, id_us_min(), and LISTBASE_FOREACH.
Referenced by BKE_collection_cycles_fix(), and collection_instance_fix_recursive().
|
static |
Check if a collection is editable, i.e. if its lists of objects and sub-collections can be modified.
Definition at line 1354 of file collection.cc.
References BKE_layer_collection_first_from_scene_collection(), LayerCollection::flag, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, and LAYER_COLLECTION_EXCLUDE.
Referenced by BKE_collection_parent_editable_find_recursive().
|
static |
Definition at line 1723 of file collection.cc.
References BKE_collection_child_find(), BLI_freelinkN(), LISTBASE_FOREACH_MUTABLE, and Collection::runtime.
Referenced by BKE_collections_child_remove_nulls().
|
static |
Definition at line 1131 of file collection.cc.
References Main::collections, ListBase::first, Collection::id, Scene::master_collection, and ID::next.
Referenced by BKE_collection_object_find().
|
static |
Definition at line 1714 of file collection.cc.
References BLI_freelinkN(), Collection::children, and LISTBASE_FOREACH_MUTABLE.
Referenced by BKE_collections_child_remove_nulls().
|
static |
| id_create_flag | Creation/Copy ID management flags, e.g. LIB_ID_CREATE_NO_MAIN. |
Definition at line 1408 of file collection.cc.
References BKE_collection_object_cache_free(), BKE_rigidbody_main_collection_object_add(), BLI_addtail(), BLI_ghash_ensure_p(), collection_find_child_recursive(), collection_gobject_hash_ensure(), Collection::gobject, Object::id, id_us_plus(), Object::instance_collection, LIB_ID_CREATE_NO_MAIN, LIB_ID_CREATE_NO_USER_REFCOUNT, CollectionObject::light_linking, MEM_callocN(), CollectionObject::ob, and Collection::runtime.
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 842 of file collection.cc.
References BASE_ENABLED_RENDER, BASE_ENABLED_VIEWPORT, BLI_addtail(), BLI_findptr(), Collection::children, COLLECTION_HIDE_RENDER, COLLECTION_HIDE_VIEWPORT, collection_object_cache_fill(), Base::flag, Collection::flag, Collection::gobject, LISTBASE_FOREACH, MEM_callocN(), Base::object, and offsetof.
Referenced by BKE_collection_object_cache_get(), BKE_collection_object_cache_instanced_get(), and collection_object_cache_fill().
|
static |
| id_create_flag | Creation/Copy ID management flags, e.g. LIB_ID_CREATE_NO_MAIN. |
Definition at line 909 of file collection.cc.
References BLI_assert, BLI_freelistN(), COLLECTION_HAS_OBJECT_CACHE, COLLECTION_HAS_OBJECT_CACHE_INSTANCED, DEG_id_tag_update_ex(), Collection::flag, Collection::id, LIB_ID_CREATE_NO_DEG_TAG, LIB_ID_CREATE_NO_MAIN, and Collection::runtime.
Referenced by BKE_main_collections_object_cache_free(), collection_free_data(), and collection_object_cache_free_parent_recursive().
|
static |
Utils to recursively tag the parent hierarchy of a collection, matching the
Definition at line 935 of file collection.cc.
References collection_object_cache_free(), collection_object_cache_free_parent_recursive(), LISTBASE_FOREACH, and Collection::runtime.
Referenced by BKE_collection_object_cache_free(), and collection_object_cache_free_parent_recursive().
|
static |
Definition at line 1022 of file collection.cc.
References collection_object_cyclic_check_internal(), FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN, FOREACH_COLLECTION_OBJECT_RECURSIVE_END, Collection::id, ID_TAG_DOIT, Object::instance_collection, and ID::tag.
Referenced by BKE_collection_object_cyclic_check(), and collection_object_cyclic_check_internal().
|
static |
| id_create_flag | Creation/Copy ID management flags, e.g. LIB_ID_CREATE_NO_MAIN. |
Definition at line 1472 of file collection.cc.
References BLI_ghash_popkey(), collection_gobject_hash_ensure(), collection_object_remove_no_gobject_hash(), and Collection::runtime.
Referenced by BKE_collection_object_remove(), collection_duplicate_recursive(), and scene_collections_object_remove().
|
static |
| id_create_flag | Creation/Copy ID management flags, e.g. LIB_ID_CREATE_NO_MAIN. |
A version of collection_object_remove that does not handle collection->runtime->gobject_hash, Either the caller must have removed the object from the hash or the hash may be nullptr.
Definition at line 1454 of file collection.cc.
References BKE_collection_object_cache_free(), BKE_id_free_us(), BLI_freelinkN(), Collection::gobject, Object::id, id_us_min(), and CollectionObject::ob.
Referenced by BKE_collection_delete(), BKE_collection_object_replace(), and collection_object_remove().
|
static |
Definition at line 2204 of file collection.cc.
References BASE_SELECTABLE, BASE_SELECTED, BKE_view_layer_base_find(), BKE_view_layer_synced_ensure(), Collection::children, COLLECTION_HIDE_SELECT, collection_objects_select(), Base::flag, Collection::flag, Collection::gobject, and LISTBASE_FOREACH.
Referenced by BKE_collection_objects_select(), and collection_objects_select().
Definition at line 256 of file collection.cc.
References BLI_assert, COLLECTION_IS_MASTER, Collection::flag, ID::flag, GS, ID_FLAG_EMBEDDED_DATA, ID_SCE, ID::name, and Collection::owner_id.
|
static |
Definition at line 2064 of file collection.cc.
References BKE_collection_parent_relations_rebuild(), Collection::children, collection_parents_rebuild_recursive(), COLLECTION_TAG_RELATION_REBUILD, ID_TAG_COPIED_ON_EVAL, ID_TAG_NO_MAIN, LISTBASE_FOREACH, and Collection::runtime.
Referenced by BKE_main_collections_parent_relations_rebuild(), and collection_parents_rebuild_recursive().
|
static |
Ensures we only get each object once, even when included in several collections.
Definition at line 2517 of file collection.cc.
References BLI_gset_ensure_p_ex(), CollectionObject::next, and CollectionObject::ob.
Referenced by BKE_scene_objects_iterator_next().
|
static |
Definition at line 2325 of file collection.cc.
References Collection::children, data, LISTBASE_FOREACH, and scene_collection_callback().
Referenced by scene_collection_callback(), and scene_collections_array().
|
static |
Definition at line 2349 of file collection.cc.
References BLI_assert, Scene::master_collection, MEM_malloc_arrayN(), scene_collection_callback(), scene_collections_build_array(), and scene_collections_count().
Referenced by BKE_scene_collections_iterator_begin().
|
static |
Definition at line 2342 of file collection.cc.
References data.
Referenced by scene_collections_array().
|
static |
Definition at line 2336 of file collection.cc.
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 1669 of file collection.cc.
References BKE_main_collection_sync(), BKE_scene_remove_rigidbody_object(), collection_object_remove(), FOREACH_SCENE_COLLECTION_BEGIN, FOREACH_SCENE_COLLECTION_END, Scene::id, ID_IS_EDITABLE, ID_IS_OVERRIDE_LIBRARY, ID_TAG_NO_MAIN, LIB_ID_CREATE_NO_MAIN, and ID::tag.
Referenced by BKE_collection_object_move(), and BKE_scene_collections_object_remove().
|
static |
Definition at line 2422 of file collection.cc.
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, and MEM_callocN().
Referenced by BKE_scene_objects_as_gset(), and BKE_scene_objects_iterator_begin().
|
static |
Definition at line 2453 of file collection.cc.
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 386 of file collection.cc.
|
static |
Definition at line 59 of file collection.cc.