|
Blender V4.3
|
Go to the source code of this file.
Classes | |
| struct | PackedFileCount |
Macros | |
| #define | RET_OK 0 |
| #define | RET_ERROR 1 |
Enumerations | |
| enum | ePF_FileCompare { PF_CMP_EQUAL = 0 , PF_CMP_DIFFERS = 1 , PF_CMP_NOFILE = 2 } |
| enum | ePF_FileStatus { PF_WRITE_ORIGINAL = 3 , PF_WRITE_LOCAL = 4 , PF_USE_LOCAL = 5 , PF_USE_ORIGINAL = 6 , PF_KEEP = 7 , PF_REMOVE = 8 , PF_ASK = 10 } |
| #define RET_ERROR 1 |
Definition at line 14 of file BKE_packedFile.hh.
Referenced by BKE_packedfile_unpack_all_libraries(), BKE_packedfile_unpack_image(), BKE_packedfile_unpack_sound(), BKE_packedfile_unpack_vfont(), BKE_packedfile_unpack_volume(), and BKE_packedfile_write_to_file().
| #define RET_OK 0 |
Definition at line 13 of file BKE_packedFile.hh.
Referenced by BKE_packedfile_unpack_all_libraries(), BKE_packedfile_unpack_image(), BKE_packedfile_unpack_sound(), BKE_packedfile_unpack_to_file(), BKE_packedfile_unpack_vfont(), BKE_packedfile_unpack_volume(), and BKE_packedfile_write_to_file().
| enum ePF_FileCompare |
| Enumerator | |
|---|---|
| PF_CMP_EQUAL | |
| PF_CMP_DIFFERS | |
| PF_CMP_NOFILE | |
Definition at line 27 of file BKE_packedFile.hh.
| enum ePF_FileStatus |
| Enumerator | |
|---|---|
| PF_WRITE_ORIGINAL | |
| PF_WRITE_LOCAL | |
| PF_USE_LOCAL | |
| PF_USE_ORIGINAL | |
| PF_KEEP | |
| PF_REMOVE | |
| PF_ASK | |
Definition at line 33 of file BKE_packedFile.hh.
| void BKE_packedfile_blend_read | ( | BlendDataReader * | reader, |
| PackedFile ** | pf_p, | ||
| blender::StringRefNull | filepath ) |
Definition at line 966 of file packedFile.cc.
References BLI_assert, BLO_read_shared(), BLO_read_struct, blender::StringRefNull::c_str(), CLOG_WARN, LOG, MEM_SAFE_FREE, pf, and PackedFile::sharing_info.
Referenced by blender::blend_read(), direct_link_library(), image_blend_read_data(), sound_blend_read_data(), vfont_blend_read_data(), and volume_blend_read_data().
| void BKE_packedfile_blend_write | ( | BlendWriter * | writer, |
| const PackedFile * | pf ) |
Definition at line 955 of file packedFile.cc.
References BLO_write_shared(), BLO_write_struct, and pf.
Referenced by blender::blend_write(), image_blend_write(), sound_blend_write(), vfont_blend_write(), volume_blend_write(), and write_libraries().
| ePF_FileCompare BKE_packedfile_compare_to_file | ( | const char * | ref_file_name, |
| const char * | filepath_rel, | ||
| const PackedFile * | pf ) |
This function compares a packed file to a 'real' file. It returns an integer indicating if:
Definition at line 420 of file packedFile.cc.
References BLI_open(), BLI_path_abs(), BLI_read(), BLI_stat(), FILE_MAX, len, O_BINARY, pf, PF_CMP_DIFFERS, PF_CMP_EQUAL, PF_CMP_NOFILE, and STRNCPY.
Referenced by unpack_menu().
| PackedFileCount BKE_packedfile_count_all | ( | Main * | bmain | ) |
Definition at line 118 of file packedFile.cc.
References NodesModifierData::bakes, NodesModifierData::bakes_num, BKE_image_has_packedfile(), count, eModifierType_Nodes, ListBase::first, Main::fonts, bSound::id, Image::id, VFont::id, ID_IS_LINKED, Main::images, PackedFileCount::individual_files, LISTBASE_FOREACH, ID::next, Main::objects, bSound::packedfile, VFont::packedfile, Main::sounds, and Main::volumes.
Referenced by unpack_all_invoke().
| PackedFile * BKE_packedfile_duplicate | ( | const PackedFile * | pf_src | ) |
Definition at line 191 of file packedFile.cc.
References BLI_assert, PackedFile::data, MEM_dupallocN, and PackedFile::sharing_info.
Referenced by blender::copy_data(), copy_image_packedfiles(), library_copy_data(), sound_copy_data(), vfont_copy_data(), vfont_get_data(), and volume_copy_data().
| void BKE_packedfile_free | ( | PackedFile * | pf | ) |
Definition at line 177 of file packedFile.cc.
References BLI_assert, MEM_freeN(), pf, and printf.
Referenced by BKE_image_signal(), BKE_packedfile_unpack_all_libraries(), BKE_packedfile_unpack_image(), BKE_packedfile_unpack_sound(), BKE_packedfile_unpack_vfont(), BKE_packedfile_unpack_volume(), BKE_vfont_free_data(), BKE_vfont_load(), image_free_packedfiles(), library_free_data(), blender::nodes_modifier_packed_bake_free(), sound_free_data(), vfont_free_data(), vfont_get_data(), vfont_init_data(), and volume_free_data().
| bool BKE_packedfile_id_check | ( | const ID * | id | ) |
ID should be not NULL, return true if there's a packed file.
Definition at line 880 of file packedFile.cc.
References BKE_image_has_packedfile(), GS, ID_IM, ID_LI, ID_SO, ID_VF, ID_VO, bSound::packedfile, Library::packedfile, VFont::packedfile, and Volume::packedfile.
Referenced by template_ID().
| void BKE_packedfile_id_unpack | ( | Main * | bmain, |
| ID * | id, | ||
| ReportList * | reports, | ||
| enum ePF_FileStatus | how ) |
ID should be not NULL, throws error when ID is Library.
Definition at line 909 of file packedFile.cc.
References BKE_image_has_packedfile(), BKE_packedfile_unpack_image(), BKE_packedfile_unpack_sound(), BKE_packedfile_unpack_vfont(), BKE_packedfile_unpack_volume(), BKE_reportf(), Library::filepath, GS, ID_IM, ID_IS_EDITABLE, ID_LI, ID_SO, ID_VF, ID_VO, bSound::packedfile, VFont::packedfile, and RPT_ERROR.
Referenced by unpack_item_exec().
| PackedFile * BKE_packedfile_new | ( | ReportList * | reports, |
| const char * | filepath_rel, | ||
| const char * | basepath ) |
Definition at line 222 of file packedFile.cc.
References BKE_packedfile_new_from_memory(), BKE_reportf(), BLI_file_descriptor_size(), BLI_open(), BLI_path_abs(), BLI_read(), FILE_MAX, MEM_freeN(), MEM_mallocN, O_BINARY, pf, RPT_ERROR, and STRNCPY.
Referenced by BKE_image_packfiles(), BKE_image_signal(), BKE_packedfile_pack_all(), BKE_packedfile_pack_all_libraries(), BKE_vfont_load(), load_image_single(), blender::bke::bake::pack_files_from_directory(), sound_pack_exec(), and vfont_get_data().
| PackedFile * BKE_packedfile_new_from_memory | ( | const void * | mem, |
| int | memlen, | ||
| const blender::ImplicitSharingInfo * | sharing_info = nullptr ) |
Definition at line 204 of file packedFile.cc.
References BLI_assert, PackedFile::data, blender::implicit_sharing::info_for_mem_free(), MEM_callocN, and pf.
Referenced by blender::ed::object::bake_simulation::bake_geometry_nodes_startjob(), BKE_image_packfiles_from_mem(), BKE_packedfile_new(), get_builtin_packedfile(), and image_memorypack_imbuf().
| void BKE_packedfile_pack_all | ( | Main * | bmain, |
| ReportList * | reports, | ||
| bool | verbose ) |
No libraries for now.
Definition at line 275 of file packedFile.cc.
References NodesModifierData::bakes, NodesModifierData::bakes_num, BKE_image_has_packedfile(), BKE_image_packfiles(), BKE_main_blendfile_path(), BKE_packedfile_new(), BKE_report(), BKE_reportf(), BKE_vfont_is_builtin(), ELEM, eModifierType_Nodes, bSound::filepath, VFont::filepath, ListBase::first, Main::fonts, bSound::id, Image::id, VFont::id, ID_BLEND_PATH, ID_IS_EDITABLE, ID_IS_LINKED, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, IMA_SRC_TILED, Main::images, LISTBASE_FOREACH, ID::name, ID::next, Main::objects, blender::bke::bake::pack_geometry_nodes_bake(), bSound::packedfile, VFont::packedfile, RPT_INFO, RPT_WARNING, Main::sounds, Image::source, verbose, and Main::volumes.
Referenced by blender::bke::asset_write_in_library(), autopack_toggle_exec(), pack_all_exec(), and wm_file_write().
| void BKE_packedfile_pack_all_libraries | ( | Main * | bmain, |
| ReportList * | reports ) |
Definition at line 800 of file packedFile.cc.
References BKE_main_blendfile_path(), BKE_packedfile_new(), BKE_reportf(), BLI_path_is_rel(), ListBase::first, lib, Main::libraries, and RPT_ERROR.
Referenced by pack_libraries_exec().
| int BKE_packedfile_read | ( | PackedFile * | pf, |
| void * | data, | ||
| int | size ) |
Definition at line 95 of file packedFile.cc.
| void BKE_packedfile_rewind | ( | PackedFile * | pf | ) |
Definition at line 90 of file packedFile.cc.
References BKE_packedfile_seek(), and pf.
| int BKE_packedfile_seek | ( | PackedFile * | pf, |
| int | offset, | ||
| int | whence ) |
| char * BKE_packedfile_unpack | ( | Main * | bmain, |
| ReportList * | reports, | ||
| ID * | id, | ||
| const char * | orig_file_path, | ||
| PackedFile * | pf, | ||
| enum ePF_FileStatus | how ) |
Definition at line 620 of file packedFile.cc.
References BKE_main_blendfile_path(), BKE_packedfile_unpack_to_file(), FILE_MAX, pf, and unpack_generate_paths().
Referenced by BKE_packedfile_unpack_image(), BKE_packedfile_unpack_sound(), BKE_packedfile_unpack_vfont(), and BKE_packedfile_unpack_volume().
| void BKE_packedfile_unpack_all | ( | Main * | bmain, |
| ReportList * | reports, | ||
| enum ePF_FileStatus | how ) |
Definition at line 827 of file packedFile.cc.
References NodesModifierData::bakes, NodesModifierData::bakes_num, BKE_image_has_packedfile(), BKE_packedfile_unpack_image(), BKE_packedfile_unpack_sound(), BKE_packedfile_unpack_vfont(), BKE_packedfile_unpack_volume(), eModifierType_Nodes, ListBase::first, Main::fonts, bSound::id, Image::id, VFont::id, ID_IS_LINKED, Main::images, LISTBASE_FOREACH, ID::next, Main::objects, bSound::packedfile, VFont::packedfile, Main::sounds, blender::bke::bake::unpack_geometry_nodes_bake(), and Main::volumes.
Referenced by unpack_all_exec().
| int BKE_packedfile_unpack_all_libraries | ( | Main * | bmain, |
| ReportList * | reports ) |
Definition at line 767 of file packedFile.cc.
References BKE_main_blendfile_path(), BKE_packedfile_free(), BKE_packedfile_unpack_to_file(), ListBase::first, lib, Main::libraries, MEM_freeN(), PF_WRITE_ORIGINAL, printf, RET_ERROR, and RET_OK.
Referenced by unpack_libraries_exec().
| int BKE_packedfile_unpack_image | ( | Main * | bmain, |
| ReportList * | reports, | ||
| Image * | ima, | ||
| enum ePF_FileStatus | how ) |
Definition at line 688 of file packedFile.cc.
References BKE_image_ensure_tile_token(), BKE_image_signal(), BKE_packedfile_free(), BKE_packedfile_unpack(), BLI_findstring(), BLI_remlink(), ImagePackedFile::filepath, ImageView::filepath, IMA_SIGNAL_RELOAD, IMA_SRC_TILED, ListBase::last, MEM_freeN(), offsetof, ImagePackedFile::packedfile, Image::packedfiles, PF_REMOVE, RET_ERROR, RET_OK, and STRNCPY.
Referenced by BKE_packedfile_id_unpack(), BKE_packedfile_unpack_all(), and image_unpack_exec().
| int BKE_packedfile_unpack_sound | ( | Main * | bmain, |
| ReportList * | reports, | ||
| bSound * | sound, | ||
| enum ePF_FileStatus | how ) |
Definition at line 662 of file packedFile.cc.
References BKE_packedfile_free(), BKE_packedfile_unpack(), BKE_sound_load(), MEM_freeN(), RET_ERROR, RET_OK, and STRNCPY.
Referenced by BKE_packedfile_id_unpack(), BKE_packedfile_unpack_all(), and sound_unpack_exec().
| char * BKE_packedfile_unpack_to_file | ( | ReportList * | reports, |
| const char * | ref_file_name, | ||
| const char * | abs_name, | ||
| const char * | local_name, | ||
| PackedFile * | pf, | ||
| enum ePF_FileStatus | how ) |
BKE_packedfile_unpack_to_file() looks at the existing files (abs_name, local_name) and a packed file.
It returns a char *to the existing file name / new file name or NULL when there was an error or when the user decides to cancel the operation.
Definition at line 473 of file packedFile.cc.
References ATTR_FALLTHROUGH, BKE_packedfile_write_to_file(), BKE_reportf(), BLI_exists(), BLI_path_abs(), BLI_strdup(), FILE_MAX, pf, PF_KEEP, PF_REMOVE, PF_USE_LOCAL, PF_USE_ORIGINAL, PF_WRITE_LOCAL, PF_WRITE_ORIGINAL, printf, RET_OK, RPT_INFO, and STRNCPY.
Referenced by BKE_packedfile_unpack(), BKE_packedfile_unpack_all_libraries(), and blender::io::hydra::cache_or_get_image_file().
| int BKE_packedfile_unpack_vfont | ( | Main * | bmain, |
| ReportList * | reports, | ||
| VFont * | vfont, | ||
| enum ePF_FileStatus | how ) |
Definition at line 640 of file packedFile.cc.
References BKE_packedfile_free(), BKE_packedfile_unpack(), MEM_freeN(), RET_ERROR, RET_OK, and STRNCPY.
Referenced by BKE_packedfile_id_unpack(), and BKE_packedfile_unpack_all().
| int BKE_packedfile_unpack_volume | ( | Main * | bmain, |
| ReportList * | reports, | ||
| Volume * | volume, | ||
| enum ePF_FileStatus | how ) |
Definition at line 741 of file packedFile.cc.
References BKE_packedfile_free(), BKE_packedfile_unpack(), BKE_volume_unload(), MEM_freeN(), RET_ERROR, RET_OK, and STRNCPY.
Referenced by BKE_packedfile_id_unpack(), and BKE_packedfile_unpack_all().
| int BKE_packedfile_write_to_file | ( | ReportList * | reports, |
| const char * | ref_file_name, | ||
| const char * | filepath_rel, | ||
| PackedFile * | pf ) |
Definition at line 354 of file packedFile.cc.
References BKE_reportf(), BLI_copy(), BLI_delete(), BLI_exists(), BLI_file_ensure_parent_dir_exists(), BLI_open(), BLI_path_abs(), BLI_rename_overwrite(), file, FILE_MAX, O_BINARY, pf, RET_ERROR, RET_OK, RPT_ERROR, RPT_INFO, SNPRINTF, and STRNCPY.
Referenced by BKE_packedfile_unpack_to_file().