|
Blender V5.0
|
external readfile function prototypes. More...
#include "DNA_listBase.h"#include "BLI_compiler_attrs.h"#include "BLI_math_vector_types.hh"#include "BLI_sys_types.h"#include "BLI_utildefines.h"#include "BLI_utility_mixins.hh"Go to the source code of this file.
Classes | |
| struct | WorkspaceConfigFileData |
| struct | BlendFileData |
| struct | BlendFileReadWMSetupData |
| struct | BlendFileReadParams |
| struct | BlendFileReadReport |
| struct | BLODataBlockInfo |
| struct | LibraryLink_Params |
| struct | TempLibraryContext |
| struct | ID_Readfile_Data |
| struct | ID_Readfile_Data::Tags |
Macros | |
| #define | BLO_GROUP_MAX 32 |
| #define | BLO_EMBEDDED_STARTUP_BLEND "<startup.blend>" |
| #define | BLEN_THUMB_MEMSIZE_FILE(_x, _y) |
Functions | |
| void * | BLO_library_read_struct (FileData *fd, BHead *bh, const char *blockname) |
| void | BLO_update_defaults_startup_blend (Main *bmain, const char *app_template) |
| void | BLO_update_defaults_workspace (WorkSpace *workspace, const char *app_template) |
| void | BLO_sanitize_experimental_features_userpref_blend (UserDef *userdef) |
| BlendThumbnail * | BLO_thumbnail_from_file (const char *filepath) |
| short | BLO_version_from_file (const char *filepath) |
| ID_Readfile_Data::Tags | BLO_readfile_id_runtime_tags (ID &id) |
| ID_Readfile_Data::Tags & | BLO_readfile_id_runtime_tags_for_write (ID &id) |
| void | BLO_readfile_id_runtime_data_free_all (Main &bmain) |
| void | BLO_readfile_id_runtime_data_free (ID &id) |
BLO Read File API | |
| |
| #define | BLO_READ_SKIP_ALL (BLO_READ_SKIP_USERDEF | BLO_READ_SKIP_DATA) |
| enum | eBlenFileType { BLENFILETYPE_BLEND = 1 } |
| enum | eBLOReadSkip { BLO_READ_SKIP_NONE = 0 , BLO_READ_SKIP_USERDEF = (1 << 0) , BLO_READ_SKIP_DATA = (1 << 1) , BLO_READ_SKIP_UNDO_OLD_MAIN = (1 << 2) } |
| BlendFileData * | BLO_read_from_file (const char *filepath, eBLOReadSkip skip_flags, BlendFileReadReport *reports) |
| BlendFileData * | BLO_read_from_memory (const void *mem, int memsize, eBLOReadSkip skip_flags, ReportList *reports) |
| BlendFileData * | BLO_read_from_memfile (Main *oldmain, const char *filepath, MemFile *memfile, const BlendFileReadParams *params, ReportList *reports) |
| void | BLO_blendfiledata_free (BlendFileData *bfd) |
| void | BLO_read_do_version_after_setup (Main *new_bmain, BlendfileLinkAppendContext *lapp_context, BlendFileReadReport *reports) |
BLO Blend File Handle API | |
| #define | BLO_read_assert_message(_check_expr, _ret_value, _bh, _bmain, _message) |
| void | BLO_datablock_info_free (BLODataBlockInfo *datablock_info) |
| void | BLO_datablock_info_linklist_free (LinkNode *datablock_infos) |
| BlendHandle * | BLO_blendhandle_from_file (const char *filepath, BlendFileReadReport *reports) |
| BlendHandle * | BLO_blendhandle_from_memory (const void *mem, int memsize, BlendFileReadReport *reports) |
| blender::int3 | BLO_blendhandle_get_version (const BlendHandle *bh) |
| LinkNode * | BLO_blendhandle_get_datablock_names (BlendHandle *bh, int ofblocktype, bool use_assets_only, int *r_tot_names) |
| LinkNode * | BLO_blendhandle_get_datablock_info (BlendHandle *bh, int ofblocktype, bool use_assets_only, int *r_tot_info_items) |
| PreviewImage * | BLO_blendhandle_get_preview_for_id (BlendHandle *bh, int ofblocktype, const char *name) |
| LinkNode * | BLO_blendhandle_get_linkable_groups (BlendHandle *bh) |
| void | BLO_blendhandle_close (BlendHandle *bh) ATTR_NONNULL(1) |
| void | BLO_read_invalidate_message (BlendHandle *bh, Main *bmain, const char *message) |
external readfile function prototypes.
Definition in file BLO_readfile.hh.
| #define BLEN_THUMB_MEMSIZE_FILE | ( | _x, | |
| _y ) |
Definition at line 616 of file BLO_readfile.hh.
Referenced by blo_read_file_internal(), BLO_thumbnail_from_file(), read_file_thumbnail(), and write_thumb().
| #define BLO_EMBEDDED_STARTUP_BLEND "<startup.blend>" |
Definition at line 365 of file BLO_readfile.hh.
Referenced by BKE_blendfile_library_path_explode(), link_append_context_library_blohandle_ensure(), and workspace_append_button().
| #define BLO_GROUP_MAX 32 |
Definition at line 364 of file BLO_readfile.hh.
Referenced by BKE_blendfile_library_path_explode(), and groupname_to_code().
| #define BLO_read_assert_message | ( | _check_expr, | |
| _ret_value, | |||
| _bh, | |||
| _bmain, | |||
| _message ) |
BLI_assert-like macro to check a condition, and if false, fail the whole .blend reading process by marking the Main data-base as invalid, and returning provided _ret_value.
NOTE: About usages:
Definition at line 355 of file BLO_readfile.hh.
Referenced by do_versions_after_linking_280().
| #define BLO_READ_SKIP_ALL (BLO_READ_SKIP_USERDEF | BLO_READ_SKIP_DATA) |
Definition at line 164 of file BLO_readfile.hh.
Referenced by BKE_blendfile_userdef_read(), and BKE_blendfile_userdef_read_from_memory().
| enum eBlenFileType |
| Enumerator | |
|---|---|
| BLENFILETYPE_BLEND | |
Definition at line 54 of file BLO_readfile.hh.
| enum eBLOLibLinkFlags |
Options controlling behavior of append/link code.
| Enumerator | |
|---|---|
| BLO_LIBLINK_USE_PLACEHOLDERS | Generate a placeholder (empty ID) if not found in current lib file. |
| BLO_LIBLINK_FORCE_INDIRECT | Force loaded ID to be tagged as ID_TAG_INDIRECT (used in reload context only). |
| BLO_LIBLINK_APPEND_SET_OB_ACTIVE_CLIPBOARD | Set the object active when OB_FLAG_ACTIVE_CLIPBOARD is set. Used for copy & paste so the active object is preserved. |
| BLO_LIBLINK_APPEND_SET_FAKEUSER | Set fake user on appended IDs. |
| BLO_LIBLINK_APPEND_RECURSIVE | Append (make local) also indirect dependencies of appended IDs coming from other libraries. NOTE: All IDs (including indirectly linked ones) coming from the same initial library are always made local. |
| BLO_LIBLINK_APPEND_LOCAL_ID_REUSE | Try to re-use previously appended matching ID on new append. |
| BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR | Clear the asset data. |
| BLO_LIBLINK_OBDATA_INSTANCE | Instantiate object data IDs (i.e. create objects for them if needed). |
| BLO_LIBLINK_COLLECTION_INSTANCE | Instantiate collections as empties, instead of linking them into current view layer. |
| BLO_LIBLINK_COLLECTION_NO_HIERARCHY_REBUILD | Do not rebuild collections hierarchy runtime data (mainly the parents info) as part of BLO_library_link_end. Needed when some IDs have been temporarily removed from Main, see e.g. BKE_blendfile_library_relocate. |
| BLO_LIBLINK_PACK | Pack the linked data-blocks to keep them working even if the source file is not available. |
Definition at line 376 of file BLO_readfile.hh.
| enum eBLOReadSkip |
Skip reading some data-block types (may want to skip screen data too).
| Enumerator | |
|---|---|
| BLO_READ_SKIP_NONE | |
| BLO_READ_SKIP_USERDEF | Skip BLO_CODE_USER blocks. |
| BLO_READ_SKIP_DATA | Only read BLO_CODE_USER (and associated data). |
| BLO_READ_SKIP_UNDO_OLD_MAIN | Do not attempt to re-use IDs from old bmain for unchanged ones in case of undo. |
Definition at line 154 of file BLO_readfile.hh.
| void BLO_blendfiledata_free | ( | BlendFileData * | bfd | ) |
Frees a BlendFileData structure and all the data associated with it (the userdef data, and the main libblock data).
| bfd | The structure to free. |
Definition at line 432 of file readblenentry.cc.
References BKE_main_free(), BlendFileData::main, MEM_freeN(), and BlendFileData::user.
Referenced by BKE_blendfile_read(), BKE_blendfile_read_from_memfile(), BKE_blendfile_read_from_memory(), BKE_blendfile_read_setup_readfile(), BlendfileLoadingBaseTest::blendfile_free(), and blender::ed::vse::sequencer_clipboard_paste_exec().
| void BLO_blendhandle_close | ( | BlendHandle * | bh | ) |
Close and free a blendhandle. The handle becomes invalid after this call.
| bh | The handle to close. |
Definition at line 321 of file readblenentry.cc.
References blo_filedata_free().
Referenced by BKE_blendfile_is_readable(), BLO_library_temp_load_id(), BLO_main_validate_libraries(), filelist_freelib(), filelist_readjob_list_lib(), imb_thumb_load_from_blend_id(), and link_append_context_library_blohandle_release().
| BlendHandle * BLO_blendhandle_from_file | ( | const char * | filepath, |
| BlendFileReadReport * | reports ) |
Open a blendhandle from a file path.
| filepath | The file path to open. |
| reports | Report errors in opening the file (can be NULL). |
Definition at line 58 of file readblenentry.cc.
References blo_filedata_from_file().
Referenced by BKE_blendfile_is_readable(), BLO_library_temp_load_id(), BLO_main_validate_libraries(), bpy_lib_enter(), filelist_readjob_list_lib(), imb_thumb_load_from_blend_id(), and link_append_context_library_blohandle_ensure().
| BlendHandle * BLO_blendhandle_from_memory | ( | const void * | mem, |
| int | memsize, | ||
| BlendFileReadReport * | reports ) |
Open a blendhandle from memory.
| mem | The data to load from. |
| memsize | The size of the data. |
Definition at line 67 of file readblenentry.cc.
References blo_filedata_from_memory().
Referenced by link_append_context_library_blohandle_ensure().
| LinkNode * BLO_blendhandle_get_datablock_info | ( | BlendHandle * | bh, |
| int | ofblocktype, | ||
| bool | use_assets_only, | ||
| int * | r_tot_info_items ) |
Gets the names and asset-data (if ID is an asset) of data-blocks in a file of a certain type. The data-blocks can be limited to assets.
| bh | The blendhandle to access. |
| ofblocktype | The type of names to get. |
| use_assets_only | Limit the result to assets only. |
| r_tot_info_items | The length of the returned list. |
Definition at line 145 of file readblenentry.cc.
References BLODataBlockInfo::asset_data, blendhandle_load_id_data_and_validate(), BLI_linklist_prepend(), blo_bhead_first(), blo_bhead_next(), blo_bhead_prev(), BLO_CODE_DATA, BLO_CODE_ENDB, blo_read_asset_data_block(), BHead::code, DNA_struct_find_with_alias(), FileData::filesdna, BLODataBlockInfo::free_asset_data, MEM_mallocN(), BLODataBlockInfo::name, name, BLODataBlockInfo::no_preview_found, and STRNCPY().
Referenced by filelist_readjob_list_lib().
| LinkNode * BLO_blendhandle_get_datablock_names | ( | BlendHandle * | bh, |
| int | ofblocktype, | ||
| bool | use_assets_only, | ||
| int * | r_tot_names ) |
Gets the names of all the data-blocks in a file of a certain type (e.g. all the scene names in a file).
| bh | The blendhandle to access. |
| ofblocktype | The type of names to get. |
| use_assets_only | Only list IDs marked as assets. |
| r_tot_names | The length of the returned list. |
Definition at line 112 of file readblenentry.cc.
References blendhandle_load_id_data_and_validate(), BLI_linklist_prepend(), BLI_strdup(), blo_bhead_first(), blo_bhead_next(), BLO_CODE_ENDB, and BHead::code.
Referenced by _bpy_names(), BKE_blendfile_link_append_context_item_idtypes_from_library_add(), and BLO_main_validate_libraries().
| LinkNode * BLO_blendhandle_get_linkable_groups | ( | BlendHandle * | bh | ) |
Gets the names of all the linkable data-block types available in a file. (e.g. "Scene", "Mesh", "Light", etc.).
| bh | The blendhandle to access. |
Definition at line 294 of file readblenentry.cc.
References BKE_idtype_idcode_is_linkable(), BKE_idtype_idcode_is_valid(), BKE_idtype_idcode_to_name(), BLI_gset_add(), BLI_gset_free(), BLI_gset_ptr_new(), BLI_linklist_prepend(), BLI_strdup(), blo_bhead_first(), blo_bhead_next(), BLO_CODE_ENDB, BHead::code, and str.
Referenced by filelist_readjob_list_lib().
| PreviewImage * BLO_blendhandle_get_preview_for_id | ( | BlendHandle * | bh, |
| int | ofblocktype, | ||
| const char * | name ) |
Get the PreviewImage of a single data block in a file. (e.g. all the scene previews in a file).
| bh | The blendhandle to access. |
| ofblocktype | The type of names to get. |
| name | Name of the block without the ID_ prefix, to read the preview image from. |
Definition at line 253 of file readblenentry.cc.
References blo_bhead_first(), blo_bhead_id_name(), blo_bhead_next(), blo_blendhandle_read_preview_rects(), BLO_CODE_DATA, BLO_CODE_ENDB, BLO_library_read_struct(), DNA_struct_find_with_alias(), FileData::filesdna, MEM_dupallocN(), MEM_freeN(), name, result, and STREQ.
Referenced by imb_thumb_load_from_blend_id().
| blender::int3 BLO_blendhandle_get_version | ( | const BlendHandle * | bh | ) |
Returns the major and minor version number of Blender used to create the file.
Definition at line 78 of file readblenentry.cc.
References FileData::filesubversion, and FileData::fileversion.
Referenced by bpy_lib_enter().
| void BLO_datablock_info_free | ( | BLODataBlockInfo * | datablock_info | ) |
Frees contained data, not datablock_info itself.
Definition at line 41 of file readblenentry.cc.
References BLODataBlockInfo::asset_data, BKE_asset_metadata_free(), and BLODataBlockInfo::free_asset_data.
Referenced by BLO_datablock_info_linklist_free().
| void BLO_datablock_info_linklist_free | ( | LinkNode * | datablock_infos | ) |
Can be used to free the list returned by BLO_blendhandle_get_datablock_info().
Definition at line 49 of file readblenentry.cc.
References BLI_linklist_free(), BLO_datablock_info_free(), and MEM_freeN().
Referenced by filelist_readjob_list_lib().
| Main * BLO_library_link_begin | ( | BlendHandle ** | bh, |
| const char * | filepath, | ||
| const LibraryLink_Params * | params ) |
Initialize the #BlendHandle for linking library data.
| bh | A blender file handle as returned by BLO_blendhandle_from_file or BLO_blendhandle_from_memory. |
| filepath | Used for relative linking, copied to the lib->filepath. |
| params | Settings for linking that don't change from beginning to end of linking. |
Definition at line 5133 of file readfile.cc.
References library_link_begin(), and params.
Referenced by BKE_blendfile_link(), and BLO_library_temp_load_id().
| void BLO_library_link_end | ( | Main * | mainl, |
| BlendHandle ** | bh, | ||
| const LibraryLink_Params * | params, | ||
| ReportList * | reports ) |
Finalize linking from a given .blend file (library). Optionally instance the indirect object/collection in the scene when the flags are set.
| mainl | The main database to link from (not the active one). |
| bh | The blender file handle (WARNING! may be freed by this function!). |
| params | Settings for linking that don't change from beginning to end of linking. |
Definition at line 5293 of file readfile.cc.
References Main::is_read_invalid, lib, library_filedata_release(), library_link_end(), LISTBASE_FOREACH, and params.
Referenced by BKE_blendfile_link(), and BLO_library_temp_load_id().
| ID * BLO_library_link_named_part | ( | Main * | mainl, |
| BlendHandle ** | bh, | ||
| short | idcode, | ||
| const char * | name, | ||
| const LibraryLink_Params * | params ) |
Link a named data-block from an external blend file.
| mainl | The main database to link from (not the active one). |
| bh | The blender file handle. |
| idcode | The kind of data-block to link. |
| name | The name of the data-block (without the 2 char ID prefix). |
Definition at line 5037 of file readfile.cc.
References Main::is_read_invalid, link_named_part(), name, and params.
Referenced by BKE_blendfile_link(), and BLO_library_temp_load_id().
| void BLO_library_link_params_init | ( | LibraryLink_Params * | params, |
| Main * | bmain, | ||
| int | flag, | ||
| int | id_tag_extra ) |
Definition at line 5105 of file readfile.cc.
Referenced by BKE_copybuffer_read(), BLO_library_link_params_init_with_context(), BLO_library_temp_load_id(), and bpy_lib_exit().
| void BLO_library_link_params_init_with_context | ( | LibraryLink_Params * | params, |
| Main * | bmain, | ||
| int | flag, | ||
| int | id_tag_extra, | ||
| Scene * | scene, | ||
| ViewLayer * | view_layer, | ||
| const View3D * | v3d ) |
Definition at line 5116 of file readfile.cc.
References BLO_library_link_params_init(), flag, and params.
Referenced by BKE_copybuffer_paste(), wm_file_link_append_datablock_ex(), wm_id_linked_relocate_exec(), WM_lib_reload(), wm_lib_relocate_exec_do(), and wm_link_append_exec().
Definition at line 5315 of file readfile.cc.
References INDEX_ID_NULL, and read_struct().
Referenced by BLO_blendhandle_get_preview_for_id(), and blo_blendhandle_read_preview_rects().
| void BLO_library_temp_free | ( | TempLibraryContext * | temp_lib_ctx | ) |
Definition at line 47 of file readfile_tempload.cc.
References BKE_main_free(), TempLibraryContext::bmain_base, and MEM_freeN().
Referenced by blender::ed::asset::AssetTemporaryIDConsumer::~AssetTemporaryIDConsumer().
| TempLibraryContext * BLO_library_temp_load_id | ( | Main * | real_main, |
| const char * | blend_file_path, | ||
| short | idcode, | ||
| const char * | idname, | ||
| ReportList * | reports ) |
Definition at line 18 of file readfile_tempload.cc.
References TempLibraryContext::bf_reports, BKE_main_new(), BLO_blendhandle_close(), BLO_blendhandle_from_file(), BLO_library_link_begin(), BLO_library_link_end(), BLO_library_link_named_part(), BLO_library_link_params_init(), TempLibraryContext::bmain_base, Main::filepath, ID_TAG_TEMP_MAIN, MEM_callocN(), BlendFileReadReport::reports, STRNCPY(), and TempLibraryContext::temp_id.
Referenced by blender::ed::asset::AssetTemporaryIDConsumer::import_id().
| void BLO_read_do_version_after_setup | ( | Main * | new_bmain, |
| BlendfileLinkAppendContext * | lapp_context, | ||
| BlendFileReadReport * | reports ) |
Does versioning code that requires the Main data-base to be fully loaded and valid.
readfile's do_versions does not allow to create (or delete) IDs, and only operates on a single library at a time.
Called at the end of #setup_add_data from BKE's blendfile.cc.
| new_bmain | the newly read Main data-base. |
Definition at line 445 of file readblenentry.cc.
References do_versions_after_setup().
Referenced by BKE_blendfile_append(), BKE_blendfile_link(), and setup_app_data().
| BlendFileData * BLO_read_from_file | ( | const char * | filepath, |
| eBLOReadSkip | skip_flags, | ||
| BlendFileReadReport * | reports ) |
Open a blender file from a filepath. The function returns NULL and sets a report in the list if it cannot open the file.
| filepath | The path of the file to open. |
| reports | If the return value is NULL, errors indicating the cause of the failure. |
Definition at line 337 of file readblenentry.cc.
References BLI_assert, BLI_path_is_abs_from_cwd(), BLI_path_is_rel(), blo_filedata_free(), blo_filedata_from_file(), blo_read_file_internal(), and FileData::skip_flags.
Referenced by BKE_blendfile_read(), BKE_blendfile_userdef_read(), BKE_blendfile_workspace_config_read(), and BlendfileLoadingBaseTest::blendfile_load().
| BlendFileData * BLO_read_from_memfile | ( | Main * | oldmain, |
| const char * | filepath, | ||
| MemFile * | memfile, | ||
| const BlendFileReadParams * | params, | ||
| ReportList * | reports ) |
Used for undo/redo, skips part of libraries reading (assuming their data are already loaded & valid).
| oldmain | old main, from which we will keep libraries and other data-blocks that should not have changed. |
| filepath | current file, only for retrieving library data. Typically BKE_main_blendfile_path(oldmain). |
Definition at line 377 of file readblenentry.cc.
References BLI_assert, blo_cache_storage_init(), blo_cache_storage_old_bmain_clear(), blo_filedata_free(), blo_filedata_from_memfile(), blo_join_main(), blo_make_old_idmap_from_main(), blo_read_file_internal(), blo_split_main(), FileData::old_bmain, params, FileData::relabase, BlendFileReadReport::reports, FileData::skip_flags, Main::split_mains, and STRNCPY().
Referenced by BKE_blendfile_read_from_memfile(), and BLO_memfile_main_get().
| BlendFileData * BLO_read_from_memory | ( | const void * | mem, |
| int | memsize, | ||
| eBLOReadSkip | skip_flags, | ||
| ReportList * | reports ) |
Open a blender file from memory. The function returns NULL and sets a report in the list if it cannot open the file.
| mem | The file data. |
| memsize | The length of mem. |
| reports | If the return value is NULL, errors indicating the cause of the failure. |
Definition at line 357 of file readblenentry.cc.
References blo_filedata_free(), blo_filedata_from_memory(), blo_read_file_internal(), BlendFileReadReport::reports, and FileData::skip_flags.
Referenced by BKE_blendfile_read_from_memory(), BKE_blendfile_userdef_read_from_memory(), BKE_blendfile_workspace_config_read(), and load_main_from_memory().
| void BLO_read_invalidate_message | ( | BlendHandle * | bh, |
| Main * | bmain, | ||
| const char * | message ) |
Mark the given Main (and the 'root' local one in case of lib-split Mains) as invalid, and generate an error report containing given message.
Definition at line 328 of file readblenentry.cc.
References blo_readfile_invalidate().
| void BLO_readfile_id_runtime_data_free | ( | ID & | id | ) |
Free the ID_Readfile_Data of this ID. Does not deal with embedded IDs.
Definition at line 2220 of file readfile.cc.
References MEM_SAFE_FREE.
Referenced by BKE_libblock_free_runtime_data(), and BLO_readfile_id_runtime_data_free_all().
| void BLO_readfile_id_runtime_data_free_all | ( | Main & | bmain | ) |
Free the ID_Readfile_Data of all IDs in this bmain and all their embedded IDs.
This is typically called at the end of the versioning process, as after that ID.runtime.readfile_data should no longer be needed.
Definition at line 2225 of file readfile.cc.
References BLO_readfile_id_runtime_data_free(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, bNodeTree::id, Collection::id, ID_SCE, ID::name, and blender::bke::node_tree_from_id().
Referenced by BKE_blendfile_append(), BKE_blendfile_link(), and setup_app_data().
| ID_Readfile_Data::Tags BLO_readfile_id_runtime_tags | ( | ID & | id | ) |
Return id->runtime->readfile_data->tags if the readfile_data is allocated, otherwise return an all-zero set of tags.
Definition at line 2206 of file readfile.cc.
Referenced by blo_do_versions_pre250(), blender::animrig::versioning::convert_legacy_action_assignments(), direct_link_id(), direct_link_id_common(), expand_main(), has_linked_ids_to_read(), lib_link_all(), read_id_in_lib(), read_library_clear_weak_links(), read_library_linked_id(), and read_library_linked_ids().
| ID_Readfile_Data::Tags & BLO_readfile_id_runtime_tags_for_write | ( | ID & | id | ) |
Create the readfile_data if needed, and return id->runtime->readfile_data->tags.
Use it instead of BLO_readfile_id_runtime_tags when tags need to be set.
Definition at line 2214 of file readfile.cc.
References readfile_id_runtime_data_ensure().
Referenced by blo_do_versions_pre250(), expand_main(), lib_link_all(), read_libblock_undo_restore_at_old_address(), and read_library_linked_id().
| void BLO_sanitize_experimental_features_userpref_blend | ( | UserDef * | userdef | ) |
Disable unwanted experimental feature settings on startup.
Definition at line 1751 of file versioning_userdef.cc.
References BKE_blender_version_is_alpha(), UserDef::experimental, and MEMSET_STRUCT_AFTER.
Referenced by wm_init_userdef().
| BlendThumbnail * BLO_thumbnail_from_file | ( | const char * | filepath | ) |
Does a very light reading of given .blend file to extract its stored thumbnail.
| filepath | The path of the file to extract thumbnail from. |
Definition at line 1456 of file readfile.cc.
References BLEN_THUMB_MEMSIZE, BLEN_THUMB_MEMSIZE_FILE, BLEN_THUMB_MEMSIZE_IS_VALID, BLI_assert, blo_filedata_free(), blo_filedata_from_file_minimal(), data, MEM_mallocN(), and read_file_thumbnail().
Referenced by imb_thumb_load_from_blendfile(), and uiTemplateRecentFiles_tooltip_func().
| void BLO_update_defaults_startup_blend | ( | Main * | bmain, |
| const char * | app_template ) |
Update defaults in startup.blend, without having to save and embed it.
Definition at line 558 of file versioning_defaults.cc.
References app_template, AUDIO_SYNC, BKE_appdir_folder_id(), BKE_gpencil_material_add(), BKE_gpencil_palette_ensure(), BKE_id_delete(), BKE_libblock_rename(), BKE_main_library_weak_reference_add(), BKE_ntree_update_tag_node_property(), BKE_paint_ensure_from_paintmode(), BKE_workspace_active_layout_for_workspace_get(), BKE_workspace_layout_remove(), BLENDER_SYSTEM_DATAFILES, BLI_findstring(), BLI_mempool_destroy(), blo_is_builtin_template(), blo_update_defaults_scene(), blo_update_defaults_windowmanager(), BLO_update_defaults_workspace(), Main::brushes, Main::cameras, CD_GRID_PAINT_MASK, copy_v4_fl(), CustomData_free_layers(), DEG2RADF, DNA_struct_default_get, do_versions_rename_id(), Object::dtx, bGPdata::flag, MaterialGPencilStyle::flag, Paint::flags, GP_DATA_STROKE_PAINTMODE, GP_MATERIAL_MODE_DOT, GP_MATERIAL_MODE_SQUARE, GP_MATERIAL_STROKE_SHOW, ToolSettings::gp_paint, GP_SELECTMODE_STROKE, Material::gp_style, ToolSettings::gpencil_selectmode_edit, bScreen::id, ID_LA, ID_MA, ID_OB, LA_SHAD_RES_ABSOLUTE, Main::lights, LISTBASE_FOREACH, LISTBASE_FOREACH_MUTABLE, MA_BL_TRANSPARENT_SHADOW, Main::materials, ME_REMESH_REPROJECT_ATTRIBUTES, ME_REMESH_REPROJECT_VOLUME, blender::bke::mesh_smooth_set(), Main::meshes, MaterialGPencilStyle::mix_factor, MaterialGPencilStyle::mix_rgba, MaterialGPencilStyle::mode, ID::name, name, blender::bke::node_find_socket(), OB_GPENCIL_LEGACY, OB_MODE_PAINT_GREASE_PENCIL, OB_USE_GPENCIL_LIGHTS, Main::objects, offsetof, GpPaint::paint, PAINT_SHOW_BRUSH, SCE_FRAME_DROP, Main::scenes, WorkSpaceLayout::screen, Main::screens, SculptGPencil, SET_FLAG_FROM_TEST, SH_NODE_BACKGROUND, SH_NODE_BSDF_PRINCIPLED, SH_NODE_OUTPUT_MATERIAL, SH_NODE_OUTPUT_WORLD, SH_NODE_SUBSURFACE_SCATTERING, Object::shadow_terminator_geometry_offset, Object::shadow_terminator_normal_offset, Object::shadow_terminator_shading_offset, SHD_GLOSSY_MULTI_GGX, SHD_SUBSURFACE_RANDOM_WALK, SOCK_IN, SPACE_OUTLINER, STR_ELEM, STREQ, STRNCPY_UTF8, MaterialGPencilStyle::texture_offset, SpaceOutliner::treestore, Object::type, version_cycles_node_socket_float_value(), version_cycles_node_socket_rgba_value(), VertexGPencil, WeightGPencil, Main::wm, WO_USE_SUN_SHADOW, Main::workspaces, and Main::worlds.
Referenced by BKE_blendfile_read_setup_readfile().
| void BLO_update_defaults_workspace | ( | WorkSpace * | workspace, |
| const char * | app_template ) |
Definition at line 315 of file versioning_defaults.cc.
References app_template, bScreen::areabase, BCONTEXT_STRIP, BKE_region_find_in_listbase_by_type(), BKE_workspace_tool_remove(), BLI_listbase_is_empty(), blo_is_builtin_template(), blo_update_defaults_screen(), copy_v3_fl(), ListBase::first, ARegion::flag, View3DShading::flag, WorkSpace::id, WorkSpace::layouts, LISTBASE_FOREACH, SpaceProperties::mainb, SpaceProperties::mainbo, SpaceProperties::mainbuser, View3DShading::matcap, ID::name, OB_MODE_PAINT_GREASE_PENCIL, WorkSpace::object_mode, SpaceSeq::regionbase, RGN_FLAG_HIDDEN, RGN_TYPE_UI, SEQ_VIEW_PREVIEW, View3D::shading, View3DShading::single_color, SPACE_PROPERTIES, SPACE_SEQ, SPACE_VIEW3D, STREQ, STRNCPY(), STRPREFIX, WorkSpace::tools, V3D_SHADING_CAVITY, and view.
Referenced by BLO_update_defaults_startup_blend(), and workspace_append_activate_exec().
| short BLO_version_from_file | ( | const char * | filepath | ) |
Does a very light reading of given .blend file to extract its version.
| filepath | The path of the blend file to extract version from. |
Definition at line 1483 of file readfile.cc.
References blo_filedata_free(), blo_filedata_from_file_minimal(), and FileData::fileversion.
Referenced by file_draw_tooltip_custom_func(), and uiTemplateRecentFiles_tooltip_func().