Blender
V3.3
|
Go to the source code of this file.
Classes | |
struct | BlendThumbnail |
struct | MainIDRelationsEntryItem |
struct | MainIDRelationsEntry |
struct | MainIDRelations |
struct | Main |
Macros | |
#define | FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id) |
#define | FOREACH_MAIN_LISTBASE_ID_END |
#define | FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb) |
#define | FOREACH_MAIN_LISTBASE_END |
#define | FOREACH_MAIN_ID_BEGIN(_bmain, _id) |
#define | FOREACH_MAIN_ID_END |
#define | MAIN_VERSION_ATLEAST(main, ver, subver) |
#define | MAIN_VERSION_OLDER(main, ver, subver) |
#define | MAIN_VERSION_FILE_OLDER_OR_EQUAL(main, ver, subver) |
#define | BLEN_THUMB_SIZE 128 |
#define | BLEN_THUMB_MEMSIZE(_x, _y) (sizeof(BlendThumbnail) + ((size_t)(_x) * (size_t)(_y)) * sizeof(int)) |
#define | BLEN_THUMB_MEMSIZE_IS_VALID(_x, _y) (((_x) > 0 && (_y) > 0) && ((uint64_t)(_x) * (uint64_t)(_y) < (SIZE_MAX / (sizeof(int) * 4)))) |
Typedefs | |
typedef struct BlendThumbnail | BlendThumbnail |
typedef struct MainIDRelationsEntryItem | MainIDRelationsEntryItem |
typedef struct MainIDRelationsEntry | MainIDRelationsEntry |
typedef enum eMainIDRelationsEntryTags | eMainIDRelationsEntryTags |
typedef struct MainIDRelations | MainIDRelations |
typedef struct Main | Main |
Enumerations | |
enum | eMainIDRelationsEntryTags { MAINIDRELATIONS_ENTRY_TAGS_DOIT = 1 << 0 , MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_TO = 1 << 4 , MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_FROM = 1 << 5 , MAINIDRELATIONS_ENTRY_TAGS_PROCESSED , MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS_TO = 1 << 8 , MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS_FROM = 1 << 9 , MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS } |
enum | { MAINIDRELATIONS_INCLUDE_UI = 1 << 0 } |
Functions | |
struct Main * | BKE_main_new (void) |
void | BKE_main_free (struct Main *mainvar) |
bool | BKE_main_is_empty (struct Main *bmain) |
void | BKE_main_lock (struct Main *bmain) |
void | BKE_main_unlock (struct Main *bmain) |
void | BKE_main_relations_create (struct Main *bmain, short flag) |
void | BKE_main_relations_free (struct Main *bmain) |
void | BKE_main_relations_tag_set (struct Main *bmain, eMainIDRelationsEntryTags tag, bool value) |
struct GSet * | BKE_main_gset_create (struct Main *bmain, struct GSet *gset) |
struct GHash * | BKE_main_library_weak_reference_create (struct Main *bmain) ATTR_NONNULL() |
void | BKE_main_library_weak_reference_destroy (struct GHash *library_weak_reference_mapping) ATTR_NONNULL() |
struct ID * | BKE_main_library_weak_reference_search_item (struct GHash *library_weak_reference_mapping, const char *library_filepath, const char *library_id_name) ATTR_NONNULL() |
void | BKE_main_library_weak_reference_add_item (struct GHash *library_weak_reference_mapping, const char *library_filepath, const char *library_id_name, struct ID *new_id) ATTR_NONNULL() |
void | BKE_main_library_weak_reference_update_item (struct GHash *library_weak_reference_mapping, const char *library_filepath, const char *library_id_name, struct ID *old_id, struct ID *new_id) ATTR_NONNULL() |
void | BKE_main_library_weak_reference_remove_item (struct GHash *library_weak_reference_mapping, const char *library_filepath, const char *library_id_name, struct ID *old_id) ATTR_NONNULL() |
struct BlendThumbnail * | BKE_main_thumbnail_from_imbuf (struct Main *bmain, struct ImBuf *img) |
struct ImBuf * | BKE_main_thumbnail_to_imbuf (struct Main *bmain, struct BlendThumbnail *data) |
void | BKE_main_thumbnail_create (struct Main *bmain) |
const char * | BKE_main_blendfile_path (const struct Main *bmain) ATTR_NONNULL() |
const char * | BKE_main_blendfile_path_from_global (void) |
struct ListBase * | which_libbase (struct Main *bmain, short type) |
int | set_listbasepointers (struct Main *main, struct ListBase *lb[]) |
Main is the root of the 'data-base' of a Blender context. All data is put into lists, and all these lists are stored here.
BKE_main
files are for operations over the Main database itself, or generating extra temp data to help working with it. Those should typically not affect the data-blocks themselves.BKE_main_
should be used for functions in that file. Definition in file BKE_main.h.
#define BLEN_THUMB_MEMSIZE | ( | _x, | |
_y | |||
) | (sizeof(BlendThumbnail) + ((size_t)(_x) * (size_t)(_y)) * sizeof(int)) |
Definition at line 448 of file BKE_main.h.
#define BLEN_THUMB_MEMSIZE_IS_VALID | ( | _x, | |
_y | |||
) | (((_x) > 0 && (_y) > 0) && ((uint64_t)(_x) * (uint64_t)(_y) < (SIZE_MAX / (sizeof(int) * 4)))) |
Protect against buffer overflow vulnerability & negative sizes.
Definition at line 451 of file BKE_main.h.
#define BLEN_THUMB_SIZE 128 |
The size of thumbnails (optionally) stored in the .blend
files header.
NOTE(@campbellbarton): This is kept small as it's stored uncompressed in the .blend
file, where a larger size would increase the size of every .blend
file unreasonably. If we wanted to increase the size, we'd want to use compression (JPEG or similar).
Definition at line 446 of file BKE_main.h.
#define FOREACH_MAIN_ID_BEGIN | ( | _bmain, | |
_id | |||
) |
Top level foreach
-like macro allowing to loop over all IDs in a given Main data-base.
NOTE: Order tries to go from 'user IDs' to 'used IDs' (e.g. collections will be processed before objects, which will be processed before obdata types, etc.).
WARNING: DO NOT use break statement with that macro, use #FOREACH_MAIN_LISTBASE and #FOREACH_MAIN_LISTBASE_ID instead if you need that kind of control flow.
Definition at line 361 of file BKE_main.h.
#define FOREACH_MAIN_ID_END |
Definition at line 367 of file BKE_main.h.
#define FOREACH_MAIN_LISTBASE_BEGIN | ( | _bmain, | |
_lb | |||
) |
Definition at line 341 of file BKE_main.h.
#define FOREACH_MAIN_LISTBASE_END |
Definition at line 348 of file BKE_main.h.
#define FOREACH_MAIN_LISTBASE_ID_BEGIN | ( | _lb, | |
_id | |||
) |
Definition at line 330 of file BKE_main.h.
#define FOREACH_MAIN_LISTBASE_ID_END |
Definition at line 336 of file BKE_main.h.
Definition at line 427 of file BKE_main.h.
Definition at line 435 of file BKE_main.h.
Definition at line 431 of file BKE_main.h.
typedef struct BlendThumbnail BlendThumbnail |
typedef struct MainIDRelations MainIDRelations |
typedef struct MainIDRelationsEntry MainIDRelationsEntry |
typedef struct MainIDRelationsEntryItem MainIDRelationsEntryItem |
anonymous enum |
Enumerator | |
---|---|
MAINIDRELATIONS_INCLUDE_UI |
Definition at line 116 of file BKE_main.h.
Definition at line 78 of file BKE_main.h.
const char* BKE_main_blendfile_path | ( | const struct Main * | bmain | ) |
Return file-path of given main.
Referenced by bake_targets_output_external(), BKE_blendfile_read_from_memfile(), BKE_bpath_missing_files_find(), BKE_image_load(), BKE_image_save_options_init(), BKE_library_filepath_set(), BKE_memfile_undo_decode(), BKE_movieclip_file_add(), BKE_movieclip_file_add_exists_ex(), BKE_packedfile_pack_all(), BKE_packedfile_pack_all_libraries(), BKE_packedfile_unpack(), BKE_packedfile_unpack_all_libraries(), BKE_scene_set_name(), BKE_sound_new_file(), BKE_sound_new_file_exists_ex(), BKE_vfont_load(), BKE_vfont_load_exists_ex(), BLO_memfile_main_get(), block_create__close_file_dialog(), block_create_save_file_forwardcompat_dialog(), bookmark_select_exec(), bpy_lib_load(), BPY_modules_load_user(), cachefile_layer_open_invoke(), cachefile_open_invoke(), detect_clip_source(), do_write_image_or_movie(), draw_seq_in_view(), ED_image_filesel_detect_sequences(), file_browse_exec(), file_directory_enter_handle(), file_execute(), file_expand_directory(), file_filename_enter_handle(), file_operator_to_sfile(), file_parent_exec(), file_select_do(), file_sfile_to_operator_ex(), filelist_contains_main(), filelist_readjob_start(), blender::io::gpencil::GpencilIO::filepath_set(), image_open_exec(), image_save_options_from_op(), image_save_sequence_exec(), lib_id_library_local_paths(), library_link_begin(), library_link_end(), load_data_init_from_operator(), blender::io::obj::load_image_at_path(), make_paths_absolute_exec(), make_paths_relative_exec(), multires_external_save_exec(), namebutton_fn(), preview_prepare_scene(), RE_RenderAnim(), RE_RenderFrame(), read_global(), save_set_filepath(), screen_opengl_render_anim_step(), screen_opengl_render_write(), SEQ_add_image_strip(), SEQ_add_movie_strip(), seq_disk_cache_get_project_dir(), seq_sound_proxy_update_cb(), sequencer_change_path_exec(), sequencer_export_subtitles_invoke(), sequencer_generic_invoke_path__internal(), sound_mixdown_exec(), text_open_exec(), text_open_invoke(), text_save_as_invoke(), txt_write_file(), unpack_menu(), volume_import_exec(), wm_autosave_location(), wm_block_file_close_save(), wm_lib_relocate_exec_do(), wm_link_append_exec(), wm_open_mainfile__select_file_path(), WM_operator_drop_load_path(), wm_revert_mainfile_exec(), wm_save_as_mainfile_exec(), and write_result().
const char* BKE_main_blendfile_path_from_global | ( | void | ) |
Return file-path of global main G_MAIN.
Definition at line 562 of file main.c.
References BKE_main_blendfile_path(), and G_MAIN.
Referenced by BKE_modifier_path_init(), BKE_ptcache_toggle_disk_cache(), block_create_autorun_warning(), bpy_lib_write(), blender::compositor::OutputOpenExrSingleLayerMultiViewOperation::deinit_execution(), blender::compositor::OutputOpenExrMultiLayerMultiViewOperation::deinit_execution(), blender::compositor::OutputStereoOperation::deinit_execution(), blender::compositor::OutputSingleLayerOperation::deinit_execution(), blender::compositor::OutputOpenExrMultiLayerOperation::deinit_execution(), dynamicPaint_outputSurfaceImage(), filelist_setdir(), fileselect_ensure_updated_file_params(), fileselect_initialize_params_common(), get_drag_path(), get_proxy_fname(), icon_preview_imbuf_from_brush(), blender::io::usd::import_startjob(), library_link_end(), main(), movieclip_open_anim_file(), pose_copy_exec(), pose_paste_exec(), ptcache_file_open(), ptcache_filename(), ptcache_path(), render_result_exr_file_cache_path(), save_set_compress(), screenshot_exec(), screenshot_invoke(), SEQ_add_image_init_alpha_mode(), SEQ_add_reload_new_file(), seq_open_anim_file(), seq_proxy_get_custom_file_fname(), seq_proxy_get_fname(), seq_proxy_multiview_context_invalid(), seq_render_image_strip(), stampdata(), wm_history_file_update(), WM_init(), wm_link_append_invoke(), wm_revert_mainfile_poll(), wm_save_mainfile_invoke(), wm_window_title(), and write_crash_blend().
Definition at line 40 of file main.c.
References Freestyle::a, BKE_id_free_ex(), BKE_main_free(), BKE_main_idmap_destroy(), BKE_main_namemap_destroy(), BKE_main_relations_free(), Main::blen_thumb, BLI_assert_unreachable, BLI_listbase_clear(), BLI_spin_end(), ListBase::first, id, Main::id_map, INDEX_ID_MAX, LIB_ID_FREE_NO_DEG_TAG, LIB_ID_FREE_NO_MAIN, LIB_ID_FREE_NO_UI_USER, LIB_ID_FREE_NO_USER_REFCOUNT, Main::lock, MEM_freeN, MEM_SAFE_FREE, Main::name_map, Main::next, ID::next, NULL, Main::relations, and set_listbasepointers().
Referenced by BKE_blender_free(), BKE_blender_globals_clear(), BKE_blendfile_userdef_read(), BKE_blendfile_userdef_read_from_memory(), BKE_blendfile_workspace_config_data_free(), BKE_lib_override_library_operations_store_finalize(), BKE_main_free(), BLO_blendfiledata_free(), blo_join_main(), BLO_library_temp_free(), bpy_rna_data_context_exit(), ED_preview_free_dbase(), library_link_end(), object_preview_render(), pose_copy_exec(), pose_paste_exec(), read_libraries(), render_endjob(), seq_prefetch_free(), blender::bke::tests::TestData::teardown(), blender::bke::tests::BPathTest::TearDown(), blender::bke::image::partial_update::ImagePartialUpdateTest::TearDown(), blender::io::alembic::AlembicExportTest::TearDown(), Freestyle::BlenderStrokeRenderer::~BlenderStrokeRenderer(), and blender::bke::tests::LibIDMainSortTestContext::~LibIDMainSortTestContext().
Create a GSet storing all IDs present in given bmain, by their pointers.
gset | If not NULL, given GSet will be extended with IDs from given bmain, instead of creating a new one. |
Definition at line 346 of file main.c.
References BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), BLI_gset_add(), BLI_gset_new(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id, and NULL.
Referenced by BKE_main_idmap_create().
Check whether given bmain
is empty or contains some IDs.
Definition at line 204 of file main.c.
References FOREACH_MAIN_ID_BEGIN, and FOREACH_MAIN_ID_END.
Referenced by library_link_end().
void BKE_main_library_weak_reference_add_item | ( | struct GHash * | library_weak_reference_mapping, |
const char * | library_filepath, | ||
const char * | library_id_name, | ||
struct ID * | new_id | ||
) |
Add the given ID weak library reference to given local ID and the runtime mapping.
library_weak_reference_mapping | the mapping data generated by BKE_main_library_weak_reference_create. |
library_filepath | the path of a blend file library (relative to current working one). |
library_id_name | the full ID name, including the leading two chars encoding the ID type. |
new_id | New local ID matching given weak reference. |
Definition at line 440 of file main.c.
References BKE_idtype_idcode_append_is_reusable(), BLI_assert, BLI_ghash_ensure_p(), BLI_strncpy(), GS, lib_weak_key_create(), LibraryWeakReference::library_filepath, LibraryWeakReference::library_id_name, ID::library_weak_reference, MEM_mallocN, ID::name, NULL, and UNUSED_VARS_NDEBUG.
Referenced by BKE_blendfile_append().
Generate a mapping between 'library path' of an ID (as a pair (relative blend file path, id name)), and a current local ID, if any.
This uses the information stored in ID.library_weak_reference
.
Definition at line 394 of file main.c.
References BKE_idtype_idcode_append_is_reusable(), BKE_idtype_idcode_is_linkable(), BLI_assert, BLI_ghash_insert(), BLI_ghash_new(), ListBase::first, FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, GS, lib_weak_key_cmp(), lib_weak_key_create(), lib_weak_key_hash(), LibraryWeakReference::library_filepath, LibraryWeakReference::library_id_name, ID::library_weak_reference, ID::name, and NULL.
Referenced by BKE_blendfile_append().
Destroy the data generated by BKE_main_library_weak_reference_create.
Definition at line 426 of file main.c.
References BLI_ghash_free(), MEM_freeN, and NULL.
Referenced by BKE_blendfile_append().
void BKE_main_library_weak_reference_remove_item | ( | struct GHash * | library_weak_reference_mapping, |
const char * | library_filepath, | ||
const char * | library_id_name, | ||
struct ID * | old_id | ||
) |
Remove the given ID weak library reference from the given local ID and the runtime mapping.
library_weak_reference_mapping | the mapping data generated by BKE_main_library_weak_reference_create. |
library_filepath | the path of a blend file library (relative to current working one). |
library_id_name | the full ID name, including the leading two chars encoding the ID type. |
old_id | Existing local ID matching given weak reference. |
Definition at line 491 of file main.c.
References BLI_assert, BLI_ghash_lookup(), BLI_ghash_remove(), GS, lib_weak_key_create(), ID::library_weak_reference, MEM_freeN, MEM_SAFE_FREE, ID::name, and NULL.
Referenced by BKE_blendfile_append().
struct ID* BKE_main_library_weak_reference_search_item | ( | struct GHash * | library_weak_reference_mapping, |
const char * | library_filepath, | ||
const char * | library_id_name | ||
) |
Search for a local ID matching the given linked ID reference.
library_weak_reference_mapping | the mapping data generated by BKE_main_library_weak_reference_create. |
library_filepath | the path of a blend file library (relative to current working one). |
library_id_name | the full ID name, including the leading two chars encoding the ID type. |
Definition at line 431 of file main.c.
References BLI_ghash_lookup(), and lib_weak_key_create().
Referenced by BKE_blendfile_append().
void BKE_main_library_weak_reference_update_item | ( | struct GHash * | library_weak_reference_mapping, |
const char * | library_filepath, | ||
const char * | library_id_name, | ||
struct ID * | old_id, | ||
struct ID * | new_id | ||
) |
Update the status of the given ID weak library reference in current local IDs and the runtime mapping.
This effectively transfers the 'ownership' of the given weak reference from old_id
to new_id
.
library_weak_reference_mapping | the mapping data generated by BKE_main_library_weak_reference_create. |
library_filepath | the path of a blend file library (relative to current working one). |
library_id_name | the full ID name, including the leading two chars encoding the ID type. |
old_id | Existing local ID matching given weak reference. |
new_id | New local ID matching given weak reference. |
Definition at line 468 of file main.c.
References BLI_assert, BLI_ghash_lookup_p(), GS, lib_weak_key_create(), LibraryWeakReference::library_filepath, LibraryWeakReference::library_id_name, ID::library_weak_reference, ID::name, NULL, and STREQ.
Definition at line 214 of file main.c.
References BLI_spin_lock(), and Main::lock.
Referenced by BKE_blendfile_library_relocate(), BKE_id_free_ex(), BKE_libblock_alloc(), BKE_libblock_management_main_add(), BKE_libblock_management_main_remove(), BKE_libblock_remap(), BKE_libblock_remap_multiple(), BKE_libblock_unlink(), BKE_objects_materials_test_all(), BLO_main_validate_libraries(), BLO_main_validate_shapekeys(), filelist_readjob_main_assets_add_items(), id_delete(), and libblock_remap_foreach_idpair_cb().
Definition at line 32 of file main.c.
References BLI_spin_init(), Main::lock, MEM_callocN, and MEM_mallocN.
Referenced by BKE_blender_globals_init(), BKE_lib_override_library_operations_store_init(), Freestyle::BlenderStrokeRenderer::BlenderStrokeRenderer(), blo_find_main(), BLO_library_temp_load_id(), blo_read_file_internal(), blo_split_main(), bpy_rna_data_context_enter(), direct_link_library(), blender::bke::tests::LibIDMainSortTestContext::LibIDMainSortTestContext(), library_link_end(), object_preview_render(), pose_copy_exec(), pose_paste_exec(), read_libraries(), seq_prefetch_start_ex(), blender::bke::tests::TestData::setup(), blender::bke::tests::BPathTest::SetUp(), blender::bke::image::partial_update::ImagePartialUpdateTest::SetUp(), and blender::io::alembic::AlembicExportTest::SetUp().
Generate the mappings between used IDs and their users, and vice-versa.
Definition at line 276 of file main.c.
References BKE_library_foreach_ID_link(), BKE_main_relations_free(), BLI_assert, BLI_ghash_ensure_p(), BLI_ghash_new(), BLI_ghashutil_ptrcmp(), BLI_ghashutil_ptrhash(), BLI_mempool_create(), BLI_MEMPOOL_NOP, MainIDRelations::entry_items_pool, MainIDRelations::flag, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, id, IDWALK_INCLUDE_UI, IDWALK_READONLY, main_relations_create_idlink_cb(), MAINIDRELATIONS_INCLUDE_UI, MEM_callocN, MEM_mallocN, NULL, Main::relations, MainIDRelations::relations_from_pointers, and ID::session_uuid.
Referenced by BKE_lib_override_library_delete(), BKE_lib_override_library_id_hierarchy_reset(), BKE_lib_override_library_main_hierarchy_root_ensure(), BKE_lib_query_unused_ids_tag(), BKE_library_make_local(), lib_override_library_create_do(), lib_override_library_main_resync_on_library_indirect_level(), and lib_override_library_resync().
Definition at line 311 of file main.c.
References BLI_ghash_free(), BLI_mempool_destroy(), MainIDRelations::entry_items_pool, MEM_freeN, NULL, Main::relations, and MainIDRelations::relations_from_pointers.
Referenced by BKE_lib_override_library_delete(), BKE_lib_override_library_id_hierarchy_reset(), BKE_lib_override_library_main_hierarchy_root_ensure(), BKE_lib_query_unused_ids_tag(), BKE_library_make_local(), BKE_main_free(), BKE_main_relations_create(), lib_override_library_create_do(), lib_override_library_main_resync_on_library_indirect_level(), and lib_override_library_resync().
void BKE_main_relations_tag_set | ( | struct Main * | bmain, |
eMainIDRelationsEntryTags | tag, | ||
bool | value | ||
) |
Set or clear given tag
in all relation entries of given bmain
.
Definition at line 323 of file main.c.
References BLI_ghashIterator_done(), BLI_ghashIterator_free(), BLI_ghashIterator_getValue(), BLI_ghashIterator_new(), BLI_ghashIterator_step(), NULL, Main::relations, MainIDRelations::relations_from_pointers, and MainIDRelationsEntry::tags.
Referenced by BKE_lib_override_library_main_hierarchy_root_ensure(), lib_override_library_create_do(), lib_override_library_main_resync_on_library_indirect_level(), and lib_override_library_resync().
Generates an empty (black) thumbnail for given Main.
Definition at line 548 of file main.c.
References Main::blen_thumb, BLEN_THUMB_MEMSIZE, BLEN_THUMB_SIZE, BlendThumbnail::height, MEM_callocN, MEM_SAFE_FREE, and BlendThumbnail::width.
struct BlendThumbnail* BKE_main_thumbnail_from_imbuf | ( | struct Main * | bmain, |
struct ImBuf * | img | ||
) |
Generates a raw .blend file thumbnail data from given image.
bmain | If not NULL, also store generated data in this Main. |
img | ImBuf image to generate thumbnail data from. |
Definition at line 508 of file main.c.
References Main::blen_thumb, BLEN_THUMB_MEMSIZE, data, IMB_rect_from_float(), MEM_mallocN, MEM_SAFE_FREE, NULL, ImBuf::rect, ImBuf::x, and ImBuf::y.
Referenced by blend_file_thumb_from_camera(), and blend_file_thumb_from_screenshot().
struct ImBuf* BKE_main_thumbnail_to_imbuf | ( | struct Main * | bmain, |
struct BlendThumbnail * | data | ||
) |
Generates an image from raw .blend file thumbnail data.
bmain | Use this bmain->blen_thumb data if given data is NULL. |
data | Raw .blend file thumbnail data. |
Definition at line 532 of file main.c.
References Main::blen_thumb, data, IMB_allocFromBuffer(), and NULL.
Referenced by imb_thumb_load_from_blendfile(), and wm_file_write().
Definition at line 219 of file main.c.
References BLI_spin_unlock(), and Main::lock.
Referenced by BKE_blendfile_library_relocate(), BKE_id_free_ex(), BKE_libblock_alloc(), BKE_libblock_management_main_add(), BKE_libblock_management_main_remove(), BKE_libblock_remap(), BKE_libblock_remap_multiple(), BKE_libblock_unlink(), BKE_objects_materials_test_all(), BLO_main_validate_libraries(), BLO_main_validate_shapekeys(), filelist_readjob_main_assets_add_items(), id_delete(), and libblock_remap_foreach_idpair_cb().
Put the pointers to all the ListBase structs in given bmain
into the *lb[INDEX_ID_MAX]
array, and return the number of those for convenience.
This is useful for generic traversal of all the blocks in a Main (by traversing all the lists in turn), without worrying about block types.
lb | Array of lists INDEX_ID_MAX in length. |
INDEX_ID_<IDTYPE>
enum definitions in DNA_ID.h
. See also the FOREACH_MAIN_ID_BEGIN macro in BKE_main.h
Definition at line 654 of file main.c.
References Main::actions, Main::armatures, Main::brushes, Main::cachefiles, Main::cameras, Main::collections, Main::curves, Main::fonts, Main::gpencils, Main::hair_curves, Main::images, INDEX_ID_AC, INDEX_ID_AR, INDEX_ID_BR, INDEX_ID_CA, INDEX_ID_CF, INDEX_ID_CU_LEGACY, INDEX_ID_CV, INDEX_ID_GD, INDEX_ID_GR, INDEX_ID_IM, INDEX_ID_IP, INDEX_ID_KE, INDEX_ID_LA, INDEX_ID_LI, INDEX_ID_LP, INDEX_ID_LS, INDEX_ID_LT, INDEX_ID_MA, INDEX_ID_MAX, INDEX_ID_MB, INDEX_ID_MC, INDEX_ID_ME, INDEX_ID_MSK, INDEX_ID_NT, INDEX_ID_NULL, INDEX_ID_OB, INDEX_ID_PA, INDEX_ID_PAL, INDEX_ID_PC, INDEX_ID_PT, INDEX_ID_SCE, INDEX_ID_SCR, INDEX_ID_SIM, INDEX_ID_SO, INDEX_ID_SPK, INDEX_ID_TE, INDEX_ID_TXT, INDEX_ID_VF, INDEX_ID_VO, INDEX_ID_WM, INDEX_ID_WO, INDEX_ID_WS, Main::ipo, Main::lattices, Main::libraries, Main::lightprobes, Main::lights, Main::linestyles, Main::masks, Main::materials, Main::meshes, Main::metaballs, Main::movieclips, Main::nodetrees, NULL, Main::objects, Main::paintcurves, Main::palettes, Main::particles, Main::pointclouds, Main::scenes, Main::screens, Main::shapekeys, Main::simulations, Main::sounds, Main::speakers, Main::texts, Main::textures, Main::volumes, Main::wm, Main::workspaces, and Main::worlds.
Referenced by add_main_to_main(), BKE_blendfile_library_relocate(), BKE_blendfile_write_partial(), BKE_library_ID_test_usages(), BKE_library_indirectly_used_data_tag_clear(), BKE_library_make_local(), BKE_main_free(), BKE_main_id_flag_all(), BKE_main_id_tag_all(), blo_add_library_pointer_map(), blo_do_versions_270(), BLO_expand_main(), BLO_main_validate_libraries(), blo_split_main(), blender::ed::outliner::TreeDisplayIDOrphans::buildTree(), has_linked_ids_to_read(), id_delete(), library_ID_is_used(), read_library_clear_weak_links(), read_library_linked_ids(), split_main_newid(), write_file_handle(), and write_libraries().
Definition at line 567 of file main.c.
References Main::actions, Main::armatures, Main::brushes, Main::cachefiles, Main::cameras, Main::collections, Main::curves, Main::fonts, Main::gpencils, Main::hair_curves, ID_AC, ID_AR, ID_BR, ID_CA, ID_CF, ID_CU_LEGACY, ID_CV, ID_GD, ID_GR, ID_IM, ID_IP, ID_KE, ID_LA, ID_LI, ID_LP, ID_LS, ID_LT, ID_MA, ID_MB, ID_MC, ID_ME, ID_MSK, ID_NT, ID_OB, ID_PA, ID_PAL, ID_PC, ID_PT, ID_SCE, ID_SCR, ID_SIM, ID_SO, ID_SPK, ID_TE, ID_TXT, ID_VF, ID_VO, ID_WM, ID_WO, ID_WS, Main::images, Main::ipo, Main::lattices, Main::libraries, Main::lightprobes, Main::lights, Main::linestyles, Main::masks, Main::materials, Main::meshes, Main::metaballs, Main::movieclips, Main::nodetrees, NULL, Main::objects, Main::paintcurves, Main::palettes, Main::particles, Main::pointclouds, Main::scenes, Main::screens, Main::shapekeys, Main::simulations, Main::sounds, Main::speakers, Main::texts, Main::textures, type, Main::volumes, Main::wm, Main::workspaces, and Main::worlds.
Referenced by BKE_blendfile_library_relocate(), BKE_id_free_ex(), BKE_id_is_in_global_main(), BKE_lib_id_clear_library_data(), BKE_libblock_alloc(), BKE_libblock_find_name(), BKE_libblock_find_session_uuid(), BKE_libblock_management_main_add(), BKE_libblock_management_main_remove(), BKE_libblock_rename(), BKE_main_id_tag_idcode(), BKE_main_idmap_lookup_name(), BKE_mask_clipboard_paste_to_layer(), BKE_node_clipboard_validate(), blendfile_library_relocate_remap(), BLI_libblock_ensure_unique_name(), blo_do_versions_280(), blo_do_versions_290(), blo_do_versions_300(), blender::ed::outliner::TreeDisplayIDOrphans::buildTree(), create_placeholder(), do_versions_rename_id(), expand_doit_library(), is_yet_read(), link_named_part(), main_namemap_validate_and_fix(), outliner_id_itemf(), outliner_id_remap_exec(), pastebuf_match_path_property(), read_libblock(), read_libblock_undo_restore_at_old_address(), read_libblock_undo_restore_identical(), seqclipboard_ptr_restore(), split_libdata(), ui_template_id(), and undosys_id_ref_resolve().