|
Blender V5.0
|
#include "DNA_sdna_type_ids.hh"#include "BLI_function_ref.hh"#include "BLI_implicit_sharing.hh"#include "BLI_memory_utils.hh"Go to the source code of this file.
Classes | |
| struct | BLO_Write_IDBuffer |
Namespaces | |
| namespace | blender |
Functions | |
Blend Read Lib API | |
This API does almost the same as the Blend Read Data API. However, now only pointers to ID data blocks are updated. | |
| ID * | BLO_read_get_new_id_address (BlendLibReader *reader, ID *self_id, const bool is_linked_only, ID *id) ATTR_NONNULL(2) |
| ID * | BLO_read_get_new_id_address_from_session_uid (BlendLibReader *reader, uint session_uid) ATTR_NONNULL(1) |
| bool | BLO_read_lib_is_undo (BlendLibReader *reader) |
| Main * | BLO_read_lib_get_main (BlendLibReader *reader) |
| BlendFileReadReport * | BLO_read_lib_reports (BlendLibReader *reader) |
Report API | |
| void | BLO_reportf_wrap (BlendFileReadReport *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3 |
Blend Write API | |
Most functions fall into one of two categories. Either they write a DNA struct or a raw memory buffer to the .blend file. It is safe to pass NULL as data_ptr. In this case nothing will be stored. DNA Struct WritingFunctions dealing with DNA structs begin with BLO_write_struct_*. DNA struct types can be identified in different ways:
Often only a single instance of a struct is written at once. However, sometimes it is necessary to write arrays or linked lists. Separate functions for that are provided as well. There is a special macro for writing id structs: BLO_write_id_struct. Those are handled differently from other structs. Raw Data WritingAt the core there is BLO_write_raw, which can write arbitrary memory buffers to the file. The code that reads this data might have to correct its byte-order. For the common cases there are convenience functions that write and read arrays of simple types such as int32. Those will correct endianness automatically. | |
| #define | BLO_write_struct(writer, struct_name, data_ptr) |
| #define | BLO_write_struct_at_address(writer, struct_name, address, data_ptr) |
| #define | BLO_write_struct_at_address_with_filecode(writer, filecode, struct_name, address, data_ptr) |
| #define | BLO_write_struct_array(writer, struct_name, array_size, data_ptr) |
| #define | BLO_write_struct_array_at_address(writer, struct_name, array_size, address, data_ptr) |
| #define | BLO_write_struct_list(writer, struct_name, list_ptr) |
| #define | BLO_write_id_struct(writer, struct_name, id_address, id) |
| int | BLO_get_struct_id_by_name (const BlendWriter *writer, const char *struct_name) |
| void | BLO_write_struct_by_name (BlendWriter *writer, const char *struct_name, const void *data_ptr) |
| void | BLO_write_struct_by_id (BlendWriter *writer, int struct_id, const void *data_ptr) |
| void | BLO_write_struct_at_address_by_id (BlendWriter *writer, int struct_id, const void *address, const void *data_ptr) |
| void | BLO_write_struct_at_address_by_id_with_filecode (BlendWriter *writer, int filecode, int struct_id, const void *address, const void *data_ptr) |
| void | BLO_write_struct_array_by_name (BlendWriter *writer, const char *struct_name, int64_t array_size, const void *data_ptr) |
| void | BLO_write_struct_array_by_id (BlendWriter *writer, int struct_id, int64_t array_size, const void *data_ptr) |
| void | BLO_write_struct_array_at_address_by_id (BlendWriter *writer, int struct_id, int64_t array_size, const void *address, const void *data_ptr) |
| void | BLO_write_struct_list_by_name (BlendWriter *writer, const char *struct_name, ListBase *list) |
| void | BLO_write_struct_list_by_id (BlendWriter *writer, int struct_id, const ListBase *list) |
| void | blo_write_id_struct (BlendWriter *writer, int struct_id, const void *id_address, const ID *id) |
| void | BLO_write_raw (BlendWriter *writer, size_t size_in_bytes, const void *data_ptr) |
| void | BLO_write_char_array (BlendWriter *writer, int64_t num, const char *data_ptr) |
| void | BLO_write_int8_array (BlendWriter *writer, int64_t num, const int8_t *data_ptr) |
| void | BLO_write_int16_array (BlendWriter *writer, int64_t num, const int16_t *data_ptr) |
| void | BLO_write_uint8_array (BlendWriter *writer, int64_t num, const uint8_t *data_ptr) |
| void | BLO_write_int32_array (BlendWriter *writer, int64_t num, const int32_t *data_ptr) |
| void | BLO_write_uint32_array (BlendWriter *writer, int64_t num, const uint32_t *data_ptr) |
| void | BLO_write_float_array (BlendWriter *writer, int64_t num, const float *data_ptr) |
| void | BLO_write_double_array (BlendWriter *writer, int64_t num, const double *data_ptr) |
| void | BLO_write_float3_array (BlendWriter *writer, int64_t num, const float *data_ptr) |
| void | BLO_write_pointer_array (BlendWriter *writer, int64_t num, const void *data_ptr) |
| void | BLO_write_string (BlendWriter *writer, const char *data_ptr) |
| void | BLO_write_shared (BlendWriter *writer, const void *data, size_t approximate_size_in_bytes, const blender::ImplicitSharingInfo *sharing_info, blender::FunctionRef< void()> write_fn) |
| void | BLO_write_shared_tag (BlendWriter *writer, const void *data) |
| bool | BLO_write_is_undo (BlendWriter *writer) |
Blend Read Data API | |
Generally, for every BLO_write_* call there should be a corresponding BLO_read_* call. Most BLO_read_* functions get a pointer to a pointer as argument. That allows the function to update the pointer to its new value. When the given pointer points to a memory buffer that was not stored in the file, the pointer is updated to be NULL. When it was pointing to NULL before, it will stay that way. Examples of matching calls: BLO_write_struct(writer, ClothSimSettings, clmd->sim_parms);
BLO_read_struct(reader, ClothSimSettings, &clmd->sim_parms);
BLO_write_struct_list(writer, TimeMarker, &action->markers);
BLO_read_struct_list(reader, TimeMarker, &action->markers);
BLO_write_int32_array(writer, hmd->totindex, hmd->indexar);
BLO_read_int32_array(reader, hmd->totindex, &hmd->indexar);
void BLO_write_int32_array(BlendWriter *writer, int64_t num, const int32_t *data_ptr) Definition writefile.cc:2287 void BLO_read_int32_array(BlendDataReader *reader, int64_t array_size, int32_t **ptr_p) Definition readfile.cc:5795 #define BLO_write_struct(writer, struct_name, data_ptr) Definition BLO_read_write.hh:96 #define BLO_read_struct_list(reader, struct_name, list) Definition BLO_read_write.hh:335 #define BLO_write_struct_list(writer, struct_name, list_ptr) Definition BLO_read_write.hh:152 Definition DNA_cloth_types.h:24 Definition DNA_scene_types.h:1065 Avoid using the generic BLO_read_data_address (and low-level API like BLO_read_get_new_data_address) when possible, use the typed functions instead. Only data written with BLO_write_raw should typically be read with BLO_read_data_address. | |
| #define | BLO_read_data_address(reader, ptr_p) |
| #define | BLO_read_struct(reader, struct_name, ptr_p) |
| #define | BLO_read_struct_array(reader, struct_name, array_size, ptr_p) |
| #define | BLO_read_struct_list(reader, struct_name, list) |
| void * | BLO_read_get_new_data_address (BlendDataReader *reader, const void *old_address) |
| void * | BLO_read_get_new_data_address_no_us (BlendDataReader *reader, const void *old_address, size_t expected_size) |
| void * | BLO_read_struct_array_with_size (BlendDataReader *reader, const void *old_address, size_t expected_size) |
| void * | BLO_read_struct_by_name_array (BlendDataReader *reader, const char *struct_name, int64_t items_num, const void *old_address) |
| void | BLO_read_struct_list_with_size (BlendDataReader *reader, size_t expected_elem_size, ListBase *list) |
| void | BLO_read_char_array (BlendDataReader *reader, int64_t array_size, char **ptr_p) |
| void | BLO_read_int8_array (BlendDataReader *reader, int64_t array_size, int8_t **ptr_p) |
| void | BLO_read_uint8_array (BlendDataReader *reader, int64_t array_size, uint8_t **ptr_p) |
| void | BLO_read_int16_array (BlendDataReader *reader, const int64_t array_size, int16_t **ptr_p) |
| void | BLO_read_int32_array (BlendDataReader *reader, int64_t array_size, int32_t **ptr_p) |
| void | BLO_read_uint32_array (BlendDataReader *reader, int64_t array_size, uint32_t **ptr_p) |
| void | BLO_read_float_array (BlendDataReader *reader, int64_t array_size, float **ptr_p) |
| void | BLO_read_float3_array (BlendDataReader *reader, int64_t array_size, float **ptr_p) |
| void | BLO_read_double_array (BlendDataReader *reader, int64_t array_size, double **ptr_p) |
| void | BLO_read_pointer_array (BlendDataReader *reader, int64_t array_size, void **ptr_p) |
| void | BLO_read_string (BlendDataReader *reader, char **ptr_p) |
| void | BLO_read_string (BlendDataReader *reader, char *const *ptr_p) |
| blender::ImplicitSharingInfoAndData | blo_read_shared_impl (BlendDataReader *reader, const void **ptr_p, blender::FunctionRef< const blender::ImplicitSharingInfo *()> read_fn) |
| template<typename T> | |
| const blender::ImplicitSharingInfo * | BLO_read_shared (BlendDataReader *reader, T **data_ptr, blender::FunctionRef< const blender::ImplicitSharingInfo *()> read_fn) |
| int | BLO_read_fileversion_get (BlendDataReader *reader) |
| bool | BLO_read_data_is_undo (BlendDataReader *reader) |
| void | BLO_read_data_globmap_add (BlendDataReader *reader, void *oldaddr, void *newaddr) |
| void | BLO_read_glob_list (BlendDataReader *reader, ListBase *list) |
| BlendFileReadReport * | BLO_read_data_reports (BlendDataReader *reader) |
| struct Library * | BLO_read_data_current_library (BlendDataReader *reader) |
This file contains an API that allows different parts of Blender to define what data is stored in .blend files.
Four callbacks have to be provided to fully implement .blend I/O for a piece of data. One of those is related to file writing and three for file reading. Reading requires multiple callbacks, due to the way linking between files works.
Brief description of the individual callbacks:
Each of these callbacks uses a different API functions.
Some parts of Blender, e.g. modifiers, don't require you to implement all four callbacks. Instead only the first two are necessary. The other two are handled by general ID management. In the future, we might want to get rid of those two callbacks entirely, but for now they are necessary.
Definition in file BLO_read_write.hh.
| #define BLO_read_data_address | ( | reader, | |
| ptr_p ) |
Definition at line 283 of file BLO_read_write.hh.
Referenced by BLO_read_string(), blender::bke::direct_link_node_socket_default_value(), blender::bke::node_blend_read_data_storage(), scene_blend_read_data(), shapekey_blend_read_data(), blender::bke::node_interface::socket_types::socket_data_read_data_impl(), blender::bke::node_interface::socket_types::socket_data_read_data_impl(), and workspace_blend_read_data().
| #define BLO_read_struct | ( | reader, | |
| struct_name, | |||
| ptr_p ) |
Definition at line 308 of file BLO_read_write.hh.
Referenced by blender::bke::action_blend_read_data(), armature_blend_read_data(), BKE_animdata_blend_read_data(), BKE_asset_metadata_read(), BKE_collection_blend_read_data(), BKE_color_managed_view_settings_blend_read_data(), BKE_fcurve_blend_read_data(), BKE_gpencil_blend_read_data(), BKE_gpencil_modifier_blend_read_data(), BKE_lightprobe_cache_blend_read(), BKE_modifier_blend_read_data(), BKE_packedfile_blend_read(), BKE_paint_blend_read_data(), BKE_particle_system_blend_read_data(), BKE_pose_blend_read_data(), BKE_ptcache_blend_read_data(), BKE_screen_area_map_blend_read_data(), BKE_screen_blend_read_data(), BKE_screen_view3d_shading_blend_read_data(), BKE_time_markers_blend_read(), BKE_view_layer_blend_read_data(), blend_read(), blend_read(), blend_read(), blend_read(), blend_read(), blend_read(), blender::blend_read(), blo_read_asset_data_block(), brush_blend_read_data(), curve_blend_read_data(), CustomData_blend_read(), direct_link_area(), direct_link_bone_collection(), direct_link_bones(), direct_link_id_common(), direct_link_id_embedded_id(), direct_link_keymapitem(), direct_link_layer_collections(), direct_link_linestyle_alpha_modifier(), direct_link_linestyle_color_modifier(), direct_link_linestyle_thickness_modifier(), direct_link_moviePlaneTracks(), blender::bke::direct_link_node_socket(), blender::bke::direct_link_node_socket_default_value(), blender::bke::direct_link_node_socket_storage(), direct_link_paint_helper(), direct_link_region(), file_space_blend_read_data(), graph_space_blend_read_data(), image_blend_read_data(), blender::bke::node_interface::item_types::item_read_data(), light_blend_read_data(), linestyle_blend_read_data(), mask_blend_read_data(), material_blend_read_data(), blender::seq::modifier_blend_read_data(), movieclip_blend_read_data(), nla_space_blend_read_data(), blender::ed::space_node::node_space_blend_read_data(), blender::bke::node_tree_blend_read_data(), object_blend_read_data(), particle_settings_blend_read_data(), blender::bke::read_attr_data(), blender::bke::read_channelbag(), read_drawing_array(), blender::modifier::greasepencil::read_influence_data(), read_layer_tree(), blender::bke::read_layers(), blender::bke::read_slots(), blender::bke::read_strip_keyframe_data(), blender::bke::read_strip_keyframe_data_array(), read_ui_data(), read_userdef(), blender::ed::asset::shelf::regiondata_blend_read_data(), scene_blend_read_data(), shapekey_blend_read_data(), blender::ed::spreadsheet::spreadsheet_blend_read_data(), blender::ed::spreadsheet::spreadsheet_column_blend_read(), blender::ed::spreadsheet::spreadsheet_table_blend_read(), blender::seq::strip_read_data_cb(), text_blend_read_data(), texture_blend_read_data(), view3d_space_blend_read_data(), window_manager_blend_read_data(), workspace_blend_read_data(), and world_blend_read_data().
| #define BLO_read_struct_array | ( | reader, | |
| struct_name, | |||
| array_size, | |||
| ptr_p ) |
Definition at line 311 of file BLO_read_write.hh.
Referenced by animviz_motionpath_blend_read_data(), BKE_curvemapping_blend_read(), BKE_curveprofile_blend_read(), BKE_defvert_blend_read(), BKE_fcurve_blend_read_data(), BKE_fmodifiers_blend_read_data(), BKE_gpencil_blend_read_data(), BKE_gpencil_modifier_blend_read_data(), BKE_particle_system_blend_read_data(), blender::bke::AttributeStorage::blend_read(), blender::blend_read(), blend_read_layer_data(), curve_blend_read_data(), CustomData_blend_read(), direct_link_moviePlaneTracks(), direct_link_movieReconstruction(), direct_link_movieTracks(), direct_link_pointcache_mem(), IDP_DirectLinkIDPArray(), lattice_blend_read_data(), lightprobe_grid_cache_frame_blend_read(), mask_blend_read_data(), mesh_blend_read_data(), blender::bke::node_tree_blend_read_data(), paint_curve_blend_read_data(), blender::bke::read_array_data(), read_layer(), read_ui_data(), blender::ed::spreadsheet::spreadsheet_table_id_blend_read(), and blender::seq::strip_read_data_cb().
| #define BLO_read_struct_list | ( | reader, | |
| struct_name, | |||
| list ) |
Definition at line 335 of file BLO_read_write.hh.
Referenced by blender::bke::action_blend_read_data(), armature_blend_read_data(), BKE_animdata_blend_read_data(), BKE_asset_catalog_path_list_blend_read_data(), BKE_asset_metadata_read(), BKE_collection_blend_read_data(), BKE_constraint_blend_read_data(), BKE_fcurve_blend_read_data(), BKE_gpencil_blend_read_data(), BKE_gpencil_modifier_blend_read_data(), BKE_keyingsets_blend_read_data(), BKE_modifier_blend_read_data(), BKE_nla_blend_read_data(), BKE_paint_blend_read_data(), BKE_particle_system_blend_read_data(), BKE_pose_blend_read_data(), BKE_ptcache_blend_read_data(), BKE_screen_area_map_blend_read_data(), BKE_shaderfx_blend_read_data(), BKE_time_markers_blend_read(), BKE_view_layer_blend_read_data(), BKE_viewer_path_blend_read_data(), blend_data_read_nla_strips(), blender::bke::CurvesGeometry::blend_read(), cache_file_blend_read_data(), camera_blend_read_data(), console_blend_read_data(), curve_blend_read_data(), direct_link_area(), direct_link_bone_collection(), direct_link_bones(), direct_link_id_common(), direct_link_id_override_property(), direct_link_layer_collections(), direct_link_moviePlaneTracks(), direct_link_movieTracks(), direct_link_panel_list(), direct_link_pointcache(), direct_link_pointcache_mem(), direct_link_region(), grease_pencil_blend_read_data(), IDP_DirectLinkGroup(), image_blend_read_data(), lattice_blend_read_data(), linestyle_blend_read_data(), link_recurs_seq(), mask_blend_read_data(), mesh_blend_read_data(), metaball_blend_read_data(), blender::seq::modifier_blend_read_data(), movieclip_blend_read_data(), blender::bke::node_blend_read_data_storage(), blender::ed::space_node::node_space_blend_read_data(), blender::bke::node_tree_blend_read_data(), object_blend_read_data(), palette_blend_read_data(), particle_settings_blend_read_data(), read_bone_collections(), read_layer(), read_layer_tree_group(), read_userdef(), blender::ed::asset::shelf::regiondata_blend_read_data(), scene_blend_read_data(), shapekey_blend_read_data(), blender::seq::sound_equalizermodifier_read(), blender::ed::spreadsheet::spreadsheet_blend_read_data(), blender::seq::strip_read_data_cb(), text_blend_read_data(), window_manager_blend_read_data(), and workspace_blend_read_data().
| #define BLO_write_id_struct | ( | writer, | |
| struct_name, | |||
| id_address, | |||
| id ) |
Definition at line 159 of file BLO_read_write.hh.
Referenced by blender::bke::action_blend_write(), armature_blend_write(), brush_blend_write(), cache_file_blend_write(), camera_blend_write(), collection_blend_write(), curve_blend_write(), curves_blend_write(), grease_pencil_blend_write(), greasepencil_blend_write(), image_blend_write(), lattice_blend_write(), library_blend_write_data(), light_blend_write(), lightprobe_blend_write(), linestyle_blend_write(), mask_blend_write(), material_blend_write(), mesh_blend_write(), metaball_blend_write(), movieclip_blend_write(), blender::bke::ntree_blend_write(), object_blend_write(), paint_curve_blend_write(), palette_blend_write(), particle_settings_blend_write(), pointcloud_blend_write(), scene_blend_write(), shapekey_blend_write(), sound_blend_write(), speaker_blend_write(), text_blend_write(), texture_blend_write(), vfont_blend_write(), volume_blend_write(), window_manager_blend_write(), workspace_blend_write(), and world_blend_write().
| #define BLO_write_struct | ( | writer, | |
| struct_name, | |||
| data_ptr ) |
Definition at line 96 of file BLO_read_write.hh.
Referenced by blender::bke::action_blend_write(), action_space_blend_write(), animviz_motionpath_blend_write(), BKE_animdata_blend_write(), BKE_asset_catalog_path_list_blend_write(), BKE_asset_metadata_write(), BKE_asset_weak_reference_write(), BKE_collection_blend_write_nolib(), BKE_constraint_blend_write(), BKE_curvemapping_blend_write(), BKE_curveprofile_blend_write(), BKE_defbase_blend_write(), BKE_fcurve_blend_write_data(), BKE_id_blend_write(), BKE_keyingsets_blend_write(), BKE_lightprobe_cache_blend_write(), BKE_modifier_blend_write(), BKE_nla_blend_write(), BKE_packedfile_blend_write(), BKE_particle_system_blend_write(), BKE_pose_blend_write(), BKE_ptcache_blend_write(), BKE_screen_area_map_blend_write(), BKE_time_markers_blend_write(), BKE_view_layer_blend_write(), BKE_viewer_path_blend_write(), blend_write(), blend_write(), blend_write(), blend_write(), blend_write(), blender::bke::AttributeStorage::blend_write(), blender::blend_write(), brush_blend_write(), buttons_space_blend_write(), cache_file_blend_write(), camera_blend_write(), clip_space_blend_write(), console_space_blend_write(), curve_blend_write(), CustomData_blend_write(), file_space_blend_write(), graph_space_blend_write(), greasepencil_blend_write(), IDP_BlendWrite(), image_blend_write(), image_space_blend_write(), info_space_blend_write(), blender::bke::node_interface::item_types::item_write_struct(), linestyle_blend_write(), mask_blend_write(), material_blend_write(), metaball_blend_write(), blender::seq::modifier_blend_write(), movieclip_blend_write(), nla_space_blend_write(), blender::bke::node_blend_write_storage(), blender::ed::space_node::node_space_blend_write(), blender::bke::node_tree_blend_write(), object_blend_write(), particle_settings_blend_write(), blender::ed::asset::shelf::regiondata_blend_write(), scene_blend_write(), script_space_blend_write(), blender::ed::vse::sequencer_space_blend_write(), blender::ed::asset::shelf::settings_blend_write(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::bke::node_interface::socket_types::socket_data_write_impl(), blender::ed::spreadsheet::spreadsheet_blend_write(), blender::ed::spreadsheet::spreadsheet_column_blend_write(), blender::ed::spreadsheet::spreadsheet_column_id_blend_write(), blender::ed::spreadsheet::spreadsheet_table_blend_write(), blender::ed::spreadsheet::spreadsheet_table_id_blend_write(), statusbar_space_blend_write(), blender::seq::strip_write_data_cb(), text_blend_write(), text_space_blend_write(), texture_blend_write(), topbar_space_blend_write(), userpref_space_blend_write(), view3d_space_blend_write(), window_manager_blend_write(), world_blend_write(), write_area(), write_boid_state(), write_bone(), write_bone_collection(), blender::bke::write_channelbag(), write_drawing_array(), write_keymapitem(), write_layer(), write_layer_collections(), write_layer_tree_group(), blender::bke::write_layers(), write_linestyle_color_modifiers(), write_moviePlaneTracks(), write_movieTracks(), blender::bke::write_node_socket(), blender::bke::write_node_socket_default_value(), write_region(), blender::ed::outliner::write_space_outliner(), blender::bke::write_strip_keyframe_data(), blender::bke::write_strips(), write_ui_data(), write_uilist(), and write_userdef().
| #define BLO_write_struct_array | ( | writer, | |
| struct_name, | |||
| array_size, | |||
| data_ptr ) |
Definition at line 131 of file BLO_read_write.hh.
Referenced by animviz_motionpath_blend_write(), BKE_curvemapping_curves_blend_write(), BKE_curveprofile_blend_write(), BKE_defvert_blend_write(), BKE_fcurve_blend_write_data(), BKE_fmodifiers_blend_write(), BKE_particle_system_blend_write(), BKE_ptcache_blend_write(), blender::blend_write(), curve_blend_write(), greasepencil_blend_write(), IDP_WriteIDPArray(), lattice_blend_write(), lightprobe_grid_cache_frame_blend_write(), mask_blend_write(), mesh_blend_write(), blender::bke::node_tree_blend_write(), paint_curve_blend_write(), blender::ed::spreadsheet::spreadsheet_table_id_blend_write_content_geometry(), blender::seq::strip_write_data_cb(), blender::bke::write_array_data(), write_grid_paint_mask(), write_layer(), write_mdisps(), write_moviePlaneTracks(), write_movieReconstruction(), write_movieTracks(), and write_ui_data().
| #define BLO_write_struct_array_at_address | ( | writer, | |
| struct_name, | |||
| array_size, | |||
| address, | |||
| data_ptr ) |
Definition at line 143 of file BLO_read_write.hh.
Referenced by CustomData_blend_write(), and blender::ed::outliner::write_space_outliner().
| #define BLO_write_struct_at_address | ( | writer, | |
| struct_name, | |||
| address, | |||
| data_ptr ) |
Definition at line 106 of file BLO_read_write.hh.
Referenced by BKE_previewimg_blend_write(), blend_write(), blend_write(), blend_write(), light_blend_write(), linestyle_blend_write(), material_blend_write(), scene_blend_write(), shapekey_blend_write(), texture_blend_write(), world_blend_write(), write_drawing_array(), write_panel_list(), write_region(), blender::bke::write_slots(), and blender::ed::outliner::write_space_outliner().
| #define BLO_write_struct_at_address_with_filecode | ( | writer, | |
| filecode, | |||
| struct_name, | |||
| address, | |||
| data_ptr ) |
Definition at line 115 of file BLO_read_write.hh.
Referenced by screen_blend_write().
| #define BLO_write_struct_list | ( | writer, | |
| struct_name, | |||
| list_ptr ) |
Definition at line 152 of file BLO_read_write.hh.
Referenced by BKE_fcurve_blend_write_data(), BKE_fcurve_blend_write_listbase(), BKE_fmodifiers_blend_write(), BKE_id_blend_write(), BKE_paint_blend_write(), BKE_screen_area_map_blend_write(), BKE_view_layer_blend_write(), blend_write_nla_strips(), greasepencil_blend_write(), image_blend_write(), object_blend_write(), palette_blend_write(), workspace_blend_write(), write_bone_collection(), write_layer(), and write_panel_list().
| int BLO_get_struct_id_by_name | ( | const BlendWriter * | writer, |
| const char * | struct_name ) |
Mapping between names and ids.
Definition at line 2261 of file writefile.cc.
References DNA_struct_find_with_alias(), WriteData::sdna, and BlendWriter::wd.
Referenced by BLO_write_struct_array_by_name(), and BLO_write_struct_list_by_name().
| void BLO_read_char_array | ( | BlendDataReader * | reader, |
| int64_t | array_size, | ||
| char ** | ptr_p ) |
Definition at line 5770 of file readfile.cc.
References BLO_read_struct_array_with_size().
Referenced by console_blend_read_data(), IDP_DirectLinkString(), and object_blend_read_data().
| struct Library * BLO_read_data_current_library | ( | BlendDataReader * | reader | ) |
| void BLO_read_data_globmap_add | ( | BlendDataReader * | reader, |
| void * | oldaddr, | ||
| void * | newaddr ) |
Definition at line 5968 of file readfile.cc.
References BlendDataReader::fd, FileData::globmap, and oldnewmap_insert().
Referenced by window_manager_blend_read_data().
| bool BLO_read_data_is_undo | ( | BlendDataReader * | reader | ) |
Definition at line 5963 of file readfile.cc.
References BlendDataReader::fd, FD_FLAGS_IS_MEMFILE, and FileData::flags.
Referenced by BKE_previewimg_blend_read(), blo_read_shared_impl(), direct_link_id_common(), image_blend_read_data(), object_blend_read_data(), and sound_blend_read_data().
| BlendFileReadReport * BLO_read_data_reports | ( | BlendDataReader * | reader | ) |
Definition at line 5978 of file readfile.cc.
References BlendDataReader::fd, and FileData::reports.
Referenced by BKE_fmodifiers_blend_read_data(), BKE_modifier_blend_read_data(), and link_recurs_seq().
| void BLO_read_double_array | ( | BlendDataReader * | reader, |
| int64_t | array_size, | ||
| double ** | ptr_p ) |
Definition at line 5821 of file readfile.cc.
References BLI_assert, BLO_read_struct_array_with_size(), BlendDataReader::fd, FD_FLAGS_SWITCH_ENDIAN, and FileData::flags.
Referenced by IDP_DirectLinkArray(), and read_ui_data().
| int BLO_read_fileversion_get | ( | BlendDataReader * | reader | ) |
Definition at line 5744 of file readfile.cc.
References BlendDataReader::fd, and FileData::fileversion.
Referenced by BKE_collection_blend_read_data(), blender::bke::direct_link_node_socket_default_value(), and blender::bke::node_tree_blend_read_data().
| void BLO_read_float3_array | ( | BlendDataReader * | reader, |
| int64_t | array_size, | ||
| float ** | ptr_p ) |
Definition at line 5816 of file readfile.cc.
References BLO_read_float_array().
Referenced by blend_read(), blend_read_mdisps(), lightprobe_grid_cache_frame_blend_read(), and blender::bke::read_array_data().
| void BLO_read_float_array | ( | BlendDataReader * | reader, |
| int64_t | array_size, | ||
| float ** | ptr_p ) |
Definition at line 5809 of file readfile.cc.
References BLI_assert, BLO_read_struct_array_with_size(), BlendDataReader::fd, FD_FLAGS_SWITCH_ENDIAN, and FileData::flags.
Referenced by BKE_constraint_blend_read_data(), BKE_fmodifiers_blend_read_data(), blend_read(), blender::bke::CurvesGeometry::blend_read(), blend_read_layer_data(), blend_read_paint_mask(), BLO_read_float3_array(), curve_blend_read_data(), direct_link_pointcache_mem(), IDP_DirectLinkArray(), lightprobe_grid_cache_frame_blend_read(), mask_blend_read_data(), and blender::bke::read_array_data().
| void * BLO_read_get_new_data_address | ( | BlendDataReader * | reader, |
| const void * | old_address ) |
Definition at line 5698 of file readfile.cc.
References BlendDataReader::fd, and newdataadr().
| void * BLO_read_get_new_data_address_no_us | ( | BlendDataReader * | reader, |
| const void * | old_address, | ||
| size_t | expected_size ) |
Does not consider the read data as 'used'. It will still be freed by readfile code at the end of the reading process, if no other 'real' usage was detected for it.
Typical valid usages include:
Definition at line 5703 of file readfile.cc.
References blo_verify_data_address(), BlendDataReader::fd, and newdataadr_no_us().
Referenced by BKE_modifier_blend_read_data(), modifier_replace_with_fluid(), blender::ed::outliner::outliner_space_blend_read_data(), and scene_blend_read_data().
| ID * BLO_read_get_new_id_address | ( | BlendLibReader * | reader, |
| ID * | self_id, | ||
| const bool | is_linked_only, | ||
| ID * | id ) |
Search for the new address of given id, during library linking part of blend-file reading process.
| self_id | the ID owner of the given id pointer. Note that it may be an embedded ID. |
| is_linked_only | If true, only return found pointer if it is a linked ID. Used to prevent linked data to point to local IDs. |
Definition at line 5731 of file readfile.cc.
References BlendLibReader::fd, and newlibadr().
Referenced by lib_link_cb().
| ID * BLO_read_get_new_id_address_from_session_uid | ( | BlendLibReader * | reader, |
| uint | session_uid ) |
Search for the new address of the ID for the given session_uid.
Only IDs existing in the newly read Main will be returned. If no matching session_uid in new main can be found, nullptr is returned.
This expected to be used during library-linking and/or 'undo_preserve' processes in undo case (i.e. memfile reading), typically to find a valid value (or nullptr) for ID pointers values coming from the previous, existing Main data, when it is preserved in newly read Main. See e.g. the scene_undo_preserve code-path.
Definition at line 5739 of file readfile.cc.
References BKE_main_idmap_lookup_uid(), BlendLibReader::fd, and FileData::new_idmap_uid.
Referenced by scene_foreach_toolsettings_id_pointer_process().
| void BLO_read_glob_list | ( | BlendDataReader * | reader, |
| ListBase * | list ) |
Definition at line 5973 of file readfile.cc.
References BlendDataReader::fd, and link_glob_list().
Referenced by scene_blend_read_data().
| void BLO_read_int16_array | ( | BlendDataReader * | reader, |
| const int64_t | array_size, | ||
| int16_t ** | ptr_p ) |
Definition at line 5788 of file readfile.cc.
References BLI_assert, BLO_read_struct_array_with_size(), BlendDataReader::fd, FD_FLAGS_SWITCH_ENDIAN, and FileData::flags.
Referenced by blender::bke::read_array_data().
| void BLO_read_int32_array | ( | BlendDataReader * | reader, |
| int64_t | array_size, | ||
| int32_t ** | ptr_p ) |
Definition at line 5795 of file readfile.cc.
References BLI_assert, BLO_read_struct_array_with_size(), BlendDataReader::fd, FD_FLAGS_SWITCH_ENDIAN, and FileData::flags.
Referenced by blend_read(), blender::bke::CurvesGeometry::blend_read(), IDP_DirectLinkArray(), object_blend_read_data(), blender::bke::read_array_data(), read_layer(), and read_ui_data().
| void BLO_read_int8_array | ( | BlendDataReader * | reader, |
| int64_t | array_size, | ||
| int8_t ** | ptr_p ) |
Definition at line 5782 of file readfile.cc.
References BLO_read_struct_array_with_size().
Referenced by blend_read_mdisps(), IDP_DirectLinkArray(), lightprobe_grid_cache_frame_blend_read(), blender::bke::read_array_data(), and read_ui_data().
| Main * BLO_read_lib_get_main | ( | BlendLibReader * | reader | ) |
Definition at line 5988 of file readfile.cc.
References BlendLibReader::main.
Referenced by BKE_pose_blend_read_after_liblink(), object_blend_read_after_liblink(), and workspace_blend_read_after_liblink().
| bool BLO_read_lib_is_undo | ( | BlendLibReader * | reader | ) |
Definition at line 5983 of file readfile.cc.
References BlendLibReader::fd, FD_FLAGS_IS_MEMFILE, and FileData::flags.
Referenced by BKE_pose_blend_read_after_liblink(), and blender::bke::ntree_blend_read_after_liblink().
| BlendFileReadReport * BLO_read_lib_reports | ( | BlendLibReader * | reader | ) |
Definition at line 5993 of file readfile.cc.
References BlendLibReader::fd, and FileData::reports.
Referenced by object_blend_read_after_liblink(), and scene_blend_read_after_liblink().
| void BLO_read_pointer_array | ( | BlendDataReader * | reader, |
| int64_t | array_size, | ||
| void ** | ptr_p ) |
Definition at line 5880 of file readfile.cc.
References BLI_assert_unreachable, convert_pointer_array_32_to_64(), convert_pointer_array_64_to_32(), BlendDataReader::fd, FileData::filesdna, MEM_freeN(), MEM_malloc_arrayN(), FileData::memsdna, newdataadr(), and SDNA::pointer_size.
Referenced by BKE_gpencil_blend_read_data(), curve_blend_read_data(), curves_blend_read_data(), direct_link_moviePlaneTracks(), grease_pencil_blend_read_data(), IDP_DirectLinkArray(), blender::bke::node_interface::item_types::item_read_data(), mesh_blend_read_data(), metaball_blend_read_data(), object_blend_read_data(), pointcloud_blend_read_data(), blender::bke::read_channelbag(), read_drawing_array(), blender::bke::read_layers(), blender::bke::read_slots(), blender::bke::read_strip_keyframe_data(), blender::bke::read_strip_keyframe_data_array(), blender::ed::spreadsheet::spreadsheet_blend_read_data(), blender::ed::spreadsheet::spreadsheet_table_blend_read(), and volume_blend_read_data().
| const blender::ImplicitSharingInfo * BLO_read_shared | ( | BlendDataReader * | reader, |
| T ** | data_ptr, | ||
| blender::FunctionRef< const blender::ImplicitSharingInfo *()> | read_fn ) |
Check if there is any shared data for the given data pointer. If yes, return the existing sharing-info. If not, call the provided function to actually read the data now.
Definition at line 369 of file BLO_read_write.hh.
References blo_read_shared_impl(), blender::ImplicitSharingInfoAndData::data, blender::ImplicitSharingInfoAndData::sharing_info, and T.
Referenced by BKE_packedfile_blend_read(), blend_read(), blend_read(), blend_read(), blend_read(), blender::bke::CurvesGeometry::blend_read(), CustomData_blend_read(), mesh_blend_read_data(), and blender::bke::read_shared_array().
| blender::ImplicitSharingInfoAndData blo_read_shared_impl | ( | BlendDataReader * | reader, |
| const void ** | ptr_p, | ||
| blender::FunctionRef< const blender::ImplicitSharingInfo *()> | read_fn ) |
Referenced by BLO_read_shared().
| void BLO_read_string | ( | BlendDataReader * | reader, |
| char ** | ptr_p ) |
Definition at line 5828 of file readfile.cc.
References BLI_assert_msg, BLO_read_data_address, len, MEM_allocN_len, and str.
Referenced by BKE_asset_catalog_path_list_blend_read_data(), BKE_asset_metadata_read(), BKE_asset_weak_reference_read(), BKE_constraint_blend_read_data(), BKE_fcurve_blend_read_data(), BKE_keyingsets_blend_read_data(), BKE_paint_blend_read_data(), BKE_preferences_extension_repo_read_data(), BKE_viewer_path_blend_read_data(), blender::bke::AttributeStorage::blend_read(), blender::blend_read(), blender::nodes::BakeItemsAccessor::blend_read_data_item(), blender::nodes::CaptureAttributeItemsAccessor::blend_read_data_item(), blender::nodes::ClosureInputItemsAccessor::blend_read_data_item(), blender::nodes::ClosureOutputItemsAccessor::blend_read_data_item(), blender::nodes::CombineBundleItemsAccessor::blend_read_data_item(), blender::nodes::EvaluateClosureInputItemsAccessor::blend_read_data_item(), blender::nodes::EvaluateClosureOutputItemsAccessor::blend_read_data_item(), blender::nodes::FieldToGridItemsAccessor::blend_read_data_item(), blender::nodes::FileOutputItemsAccessor::blend_read_data_item(), blender::nodes::ForeachGeometryElementGenerationItemsAccessor::blend_read_data_item(), blender::nodes::ForeachGeometryElementInputItemsAccessor::blend_read_data_item(), blender::nodes::ForeachGeometryElementMainItemsAccessor::blend_read_data_item(), blender::nodes::FormatStringItemsAccessor::blend_read_data_item(), blender::nodes::GeoViewerItemsAccessor::blend_read_data_item(), blender::nodes::MenuSwitchItemsAccessor::blend_read_data_item(), blender::nodes::RepeatItemsAccessor::blend_read_data_item(), blender::nodes::SeparateBundleItemsAccessor::blend_read_data_item(), blender::nodes::SimulationItemsAccessor::blend_read_data_item(), BLO_read_string(), camera_blend_read_data(), curve_blend_read_data(), curves_blend_read_data(), direct_link_id_override_property(), blender::bke::direct_link_node_socket(), direct_link_panel_list(), blender::bke::node_interface::item_types::item_read_data(), mesh_blend_read_data(), blender::nodes::node_composite_file_output_cc::node_blend_read(), blender::nodes::node_fn_input_string_cc::node_blend_read(), blender::bke::node_blend_read_data_storage(), blender::bke::node_tree_blend_read_data(), read_layer(), read_layer_tree_group(), read_ui_data(), blender::ed::asset::shelf::settings_blend_read_data(), blender::ed::spreadsheet::spreadsheet_blend_read_data(), blender::ed::spreadsheet::spreadsheet_column_blend_read(), blender::ed::spreadsheet::spreadsheet_column_id_blend_read(), blender::ed::spreadsheet::spreadsheet_table_id_blend_read(), blender::seq::strip_read_data_cb(), and text_blend_read_data().
| void BLO_read_string | ( | BlendDataReader * | reader, |
| char *const * | ptr_p ) |
Definition at line 5852 of file readfile.cc.
References BLO_read_string().
| void * BLO_read_struct_array_with_size | ( | BlendDataReader * | reader, |
| const void * | old_address, | ||
| size_t | expected_size ) |
The 'main' read function and helper macros for non-basic data types.
NOTE: Currently the usage of the type info is very minimal/basic, it merely does a lose check on the data size.
Definition at line 5711 of file readfile.cc.
References blo_verify_data_address(), BlendDataReader::fd, and newdataadr().
Referenced by blender::nodes::socket_items::blend_read_data(), BLO_read_char_array(), BLO_read_double_array(), BLO_read_float_array(), BLO_read_int16_array(), BLO_read_int32_array(), BLO_read_int8_array(), BLO_read_struct_by_name_array(), BLO_read_struct_list_with_size(), BLO_read_uint32_array(), and BLO_read_uint8_array().
| void * BLO_read_struct_by_name_array | ( | BlendDataReader * | reader, |
| const char * | struct_name, | ||
| int64_t | items_num, | ||
| const void * | old_address ) |
Similar to BLO_read_struct_array_with_size, but can use a (DNA) type name instead of the type itself to find the expected data size.
Somewhat mirrors BLO_write_struct_array_by_name.
Definition at line 5719 of file readfile.cc.
References BLI_assert, BLO_read_struct_array_with_size(), DNA_struct_find_with_alias(), DNA_struct_identifier(), DNA_struct_size(), BlendDataReader::fd, FileData::memsdna, and STREQ.
Referenced by BKE_constraint_blend_read_data(), BKE_fmodifiers_blend_read_data(), BKE_pose_blend_read_data(), blend_read_layer_data(), and blender::bke::node_blend_read_data_storage().
| void BLO_read_struct_list_with_size | ( | BlendDataReader * | reader, |
| size_t | expected_elem_size, | ||
| ListBase * | list ) |
Definition at line 5749 of file readfile.cc.
References BLI_listbase_is_empty(), BLO_read_struct_array_with_size(), ListBase::first, ListBase::last, Link::next, and Link::prev.
| void BLO_read_uint32_array | ( | BlendDataReader * | reader, |
| int64_t | array_size, | ||
| uint32_t ** | ptr_p ) |
Definition at line 5802 of file readfile.cc.
References BLI_assert, BLO_read_struct_array_with_size(), BlendDataReader::fd, FD_FLAGS_SWITCH_ENDIAN, and FileData::flags.
Referenced by BKE_previewimg_blend_read(), and direct_link_pointcache_mem().
| void BLO_read_uint8_array | ( | BlendDataReader * | reader, |
| int64_t | array_size, | ||
| uint8_t ** | ptr_p ) |
Definition at line 5776 of file readfile.cc.
References BLO_read_struct_array_with_size().
Referenced by blend_read_layer_data(), and blender::bke::read_array_data().
| void BLO_reportf_wrap | ( | BlendFileReadReport * | reports, |
| eReportType | type, | ||
| const char * | format, | ||
| ... ) |
This function ensures that reports are printed, in the case of library linking errors this is important!
NOTE(@ideasman42) a kludge but better than doubling up on prints, we could alternatively have a versions of a report function which forces printing.
References ATTR_PRINTF_FORMAT.
Referenced by BKE_fmodifiers_blend_read_data(), BKE_modifier_blend_read_data(), blo_do_versions_420(), do_version_remove_lzo_and_lzma_compression(), do_versions_after_linking_400(), do_versions_after_linking_420(), object_blend_read_after_liblink(), repair_node_link_node_pointers(), scene_blend_read_after_liblink(), and setup_app_data().
| void BLO_write_char_array | ( | BlendWriter * | writer, |
| int64_t | num, | ||
| const char * | data_ptr ) |
Slightly 'safer' code to write arrays of basic types data.
Definition at line 2267 of file writefile.cc.
References BLO_write_raw(), and num.
Referenced by console_space_blend_write(), IDP_WriteString(), and object_blend_write().
| void BLO_write_double_array | ( | BlendWriter * | writer, |
| int64_t | num, | ||
| const double * | data_ptr ) |
Definition at line 2302 of file writefile.cc.
References BLO_write_raw(), and num.
Referenced by IDP_WriteArray(), and write_ui_data().
| void BLO_write_float3_array | ( | BlendWriter * | writer, |
| int64_t | num, | ||
| const float * | data_ptr ) |
Definition at line 2320 of file writefile.cc.
References BLO_write_raw(), and num.
Referenced by lightprobe_grid_cache_frame_blend_write(), blender::bke::write_array_data(), and write_mdisps().
| void BLO_write_float_array | ( | BlendWriter * | writer, |
| int64_t | num, | ||
| const float * | data_ptr ) |
Definition at line 2297 of file writefile.cc.
References BLO_write_raw(), and num.
Referenced by BKE_constraint_blend_write(), BKE_fmodifiers_blend_write(), BKE_ptcache_blend_write(), blend_write_layer_data(), curve_blend_write(), IDP_WriteArray(), lightprobe_grid_cache_frame_blend_write(), mask_blend_write(), blender::bke::write_array_data(), and write_grid_paint_mask().
| void blo_write_id_struct | ( | BlendWriter * | writer, |
| int | struct_id, | ||
| const void * | id_address, | ||
| const ID * | id ) |
Write id struct.
Definition at line 2253 of file writefile.cc.
References GS, ID::name, BlendWriter::wd, and writestruct_at_address_nr().
| void BLO_write_int16_array | ( | BlendWriter * | writer, |
| int64_t | num, | ||
| const int16_t * | data_ptr ) |
Definition at line 2277 of file writefile.cc.
References BLO_write_raw(), and num.
Referenced by blender::bke::write_array_data().
| void BLO_write_int32_array | ( | BlendWriter * | writer, |
| int64_t | num, | ||
| const int32_t * | data_ptr ) |
Definition at line 2287 of file writefile.cc.
References BLO_write_raw(), and num.
Referenced by blend_write(), IDP_WriteArray(), blender::bke::write_array_data(), write_layer(), and write_ui_data().
| void BLO_write_int8_array | ( | BlendWriter * | writer, |
| int64_t | num, | ||
| const int8_t * | data_ptr ) |
Definition at line 2272 of file writefile.cc.
References BLO_write_raw(), and num.
Referenced by IDP_WriteArray(), lightprobe_grid_cache_frame_blend_write(), blender::bke::write_array_data(), write_mdisps(), and write_ui_data().
| bool BLO_write_is_undo | ( | BlendWriter * | writer | ) |
Sometimes different data is written depending on whether the file is saved to disk or used for undo. This function returns true when the current file-writing is done for undo.
Definition at line 2385 of file writefile.cc.
References WriteData::use_memfile, and BlendWriter::wd.
Referenced by blender::bke::action_blend_write(), blend_write(), blend_write(), blend_write(), blend_write(), blender::blend_write(), blend_write_layer_data(), BLO_Write_IDBuffer::BLO_Write_IDBuffer(), BLO_write_shared(), BLO_write_shared_tag(), camera_blend_write(), CustomData_blend_write(), image_blend_write(), library_blend_write_data(), mesh_blend_write(), blender::bke::node_blend_write_storage(), blender::bke::node_tree_blend_write(), object_blend_write(), scene_blend_write(), shapekey_blend_write(), sound_blend_write(), blender::seq::strip_write_data_cb(), vfont_blend_write(), and volume_blend_write().
| void BLO_write_pointer_array | ( | BlendWriter * | writer, |
| int64_t | num, | ||
| const void * | data_ptr ) |
Definition at line 2307 of file writefile.cc.
References BLO_CODE_DATA, data, get_address_id(), i, num, BlendWriter::wd, and writedata().
Referenced by curve_blend_write(), curves_blend_write(), grease_pencil_blend_write(), greasepencil_blend_write(), IDP_WriteArray(), blender::bke::node_interface::item_types::item_write_data(), mesh_blend_write(), metaball_blend_write(), object_blend_write(), pointcloud_blend_write(), blender::ed::spreadsheet::spreadsheet_blend_write(), blender::ed::spreadsheet::spreadsheet_table_blend_write(), volume_blend_write(), blender::bke::write_channelbag(), write_drawing_array(), blender::bke::write_layers(), write_moviePlaneTracks(), blender::bke::write_slots(), blender::bke::write_strip_keyframe_data(), blender::bke::write_strip_keyframe_data_array(), and blender::bke::write_strips().
| void BLO_write_raw | ( | BlendWriter * | writer, |
| size_t | size_in_bytes, | ||
| const void * | data_ptr ) |
Write raw data.
Definition at line 2175 of file writefile.cc.
References BLO_CODE_DATA, BlendWriter::wd, and writedata().
Referenced by BLO_write_char_array(), BLO_write_double_array(), BLO_write_float3_array(), BLO_write_float_array(), BLO_write_int16_array(), BLO_write_int32_array(), BLO_write_int8_array(), BLO_write_string(), BLO_write_uint32_array(), BLO_write_uint8_array(), and shapekey_blend_write().
| void BLO_write_shared | ( | BlendWriter * | writer, |
| const void * | data, | ||
| size_t | approximate_size_in_bytes, | ||
| const blender::ImplicitSharingInfo * | sharing_info, | ||
| blender::FunctionRef< void()> | write_fn ) |
Check if the data can be written more efficiently by making use of implicit-sharing. If yes, the user count of the sharing-info is increased making the data immutable. The provided callback should serialize the potentially shared data. It is only called when necessary.
This should be called before the data is referenced in other written data (there is an assert that checks for this). If that's not possible, at least BLO_write_shared_tag needs to be called before the pointer is first written.
| approximate_size_in_bytes | Used to be able to approximate how large the undo step is in total. |
| write_fn | Use the #BlendWrite to serialize the potentially shared data. |
Definition at line 2347 of file writefile.cc.
References Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), Set< Key, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::ImplicitSharingInfo::add_user(), BLO_write_is_undo(), BLO_write_shared_tag(), data, get_address_id_int(), WriteData::mem, WriteData::per_id_written_shared_addresses, MemFile::shared_storage, MemFileSharedStorage::sharing_info_by_address_id, MemFile::size, blender::ImplicitSharingInfo::strong_users(), BlendWriter::wd, and MemFileWriteData::written_memfile.
Referenced by BKE_packedfile_blend_write(), blend_write(), blend_write(), blend_write(), blend_write(), blender::bke::CurvesGeometry::blend_write(), CustomData_blend_write(), mesh_blend_write(), and blender::bke::write_shared_array().
| void BLO_write_shared_tag | ( | BlendWriter * | writer, |
| const void * | data ) |
Needs to be called if the pointer is somewhere written before the call to BLO_write_shared.
Definition at line 2332 of file writefile.cc.
References Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), BLI_assert, BLO_write_is_undo(), data, get_address_id_for_implicit_sharing_data(), Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup_default(), WriteData::pointer_map, WriteData::stable_address_ids, and BlendWriter::wd.
Referenced by BLO_write_shared(), curves_blend_write(), mesh_blend_write(), and write_drawing_array().
| void BLO_write_string | ( | BlendWriter * | writer, |
| const char * | data_ptr ) |
Write a null terminated string.
Definition at line 2325 of file writefile.cc.
References BLO_write_raw().
Referenced by BKE_animdata_blend_write(), BKE_asset_catalog_path_list_blend_write(), BKE_asset_metadata_write(), BKE_asset_weak_reference_write(), BKE_constraint_blend_write(), BKE_fcurve_blend_write_data(), BKE_id_blend_write(), BKE_keyingsets_blend_write(), BKE_paint_blend_write(), BKE_preferences_extension_repo_write_data(), BKE_viewer_path_blend_write(), blender::bke::AttributeStorage::blend_write(), blender::blend_write(), blender::nodes::BakeItemsAccessor::blend_write_item(), blender::nodes::CaptureAttributeItemsAccessor::blend_write_item(), blender::nodes::ClosureInputItemsAccessor::blend_write_item(), blender::nodes::ClosureOutputItemsAccessor::blend_write_item(), blender::nodes::CombineBundleItemsAccessor::blend_write_item(), blender::nodes::EvaluateClosureInputItemsAccessor::blend_write_item(), blender::nodes::EvaluateClosureOutputItemsAccessor::blend_write_item(), blender::nodes::FieldToGridItemsAccessor::blend_write_item(), blender::nodes::FileOutputItemsAccessor::blend_write_item(), blender::nodes::ForeachGeometryElementGenerationItemsAccessor::blend_write_item(), blender::nodes::ForeachGeometryElementInputItemsAccessor::blend_write_item(), blender::nodes::ForeachGeometryElementMainItemsAccessor::blend_write_item(), blender::nodes::FormatStringItemsAccessor::blend_write_item(), blender::nodes::GeoViewerItemsAccessor::blend_write_item(), blender::nodes::MenuSwitchItemsAccessor::blend_write_item(), blender::nodes::RepeatItemsAccessor::blend_write_item(), blender::nodes::SeparateBundleItemsAccessor::blend_write_item(), blender::nodes::SimulationItemsAccessor::blend_write_item(), camera_blend_write(), curve_blend_write(), curves_blend_write(), blender::bke::node_interface::item_types::item_write_data(), mesh_blend_write(), blender::nodes::node_composite_file_output_cc::node_blend_write(), blender::nodes::node_fn_input_string_cc::node_blend_write(), blender::bke::node_blend_write_storage(), blender::bke::node_tree_blend_write(), blender::ed::asset::shelf::settings_blend_write(), blender::ed::spreadsheet::spreadsheet_blend_write(), blender::ed::spreadsheet::spreadsheet_column_blend_write(), blender::ed::spreadsheet::spreadsheet_column_id_blend_write(), blender::ed::spreadsheet::spreadsheet_table_id_blend_write_content_geometry(), blender::seq::strip_write_data_cb(), text_blend_write(), write_layer(), write_layer_tree_group(), write_panel_list(), and write_ui_data().
| void BLO_write_struct_array_at_address_by_id | ( | BlendWriter * | writer, |
| int | struct_id, | ||
| int64_t | array_size, | ||
| const void * | address, | ||
| const void * | data_ptr ) |
Write struct array at address.
Definition at line 2229 of file writefile.cc.
References BLO_CODE_DATA, BlendWriter::wd, and writestruct_at_address_nr().
| void BLO_write_struct_array_by_id | ( | BlendWriter * | writer, |
| int | struct_id, | ||
| int64_t | array_size, | ||
| const void * | data_ptr ) |
Definition at line 2221 of file writefile.cc.
References BLO_CODE_DATA, BlendWriter::wd, and writestruct_nr().
Referenced by blender::nodes::socket_items::blend_write(), and BLO_write_struct_array_by_name().
| void BLO_write_struct_array_by_name | ( | BlendWriter * | writer, |
| const char * | struct_name, | ||
| int64_t | array_size, | ||
| const void * | data_ptr ) |
Write struct array.
Definition at line 2185 of file writefile.cc.
References BLO_get_struct_id_by_name(), BLO_write_struct_array_by_id(), CLOG_ERROR, LOG, and UNLIKELY.
Referenced by blender::bke::AttributeStorage::blend_write(), blend_write_layer_data(), and BLO_write_struct_by_name().
| void BLO_write_struct_at_address_by_id | ( | BlendWriter * | writer, |
| int | struct_id, | ||
| const void * | address, | ||
| const void * | data_ptr ) |
Write single struct at address.
Definition at line 2203 of file writefile.cc.
References BLO_CODE_DATA, and BLO_write_struct_at_address_by_id_with_filecode().
| void BLO_write_struct_at_address_by_id_with_filecode | ( | BlendWriter * | writer, |
| int | filecode, | ||
| int | struct_id, | ||
| const void * | address, | ||
| const void * | data_ptr ) |
Write single struct at address and specify a file-code.
Definition at line 2212 of file writefile.cc.
References BlendWriter::wd, and writestruct_at_address_nr().
Referenced by BLO_write_struct_at_address_by_id().
| void BLO_write_struct_by_id | ( | BlendWriter * | writer, |
| int | struct_id, | ||
| const void * | data_ptr ) |
Definition at line 2198 of file writefile.cc.
References BLO_CODE_DATA, BlendWriter::wd, and writestruct_nr().
Referenced by write_linestyle_alpha_modifiers(), write_linestyle_color_modifiers(), write_linestyle_geometry_modifiers(), and write_linestyle_thickness_modifiers().
| void BLO_write_struct_by_name | ( | BlendWriter * | writer, |
| const char * | struct_name, | ||
| const void * | data_ptr ) |
Write single struct.
Definition at line 2180 of file writefile.cc.
References BLO_write_struct_array_by_name().
Referenced by BKE_constraint_blend_write(), BKE_fmodifiers_blend_write(), BKE_modifier_blend_write(), BKE_pose_blend_write(), BKE_shaderfx_blend_write(), blender::seq::modifier_blend_write(), blender::bke::node_blend_write_storage(), and blender::seq::sound_equalizermodifier_write().
| void BLO_write_struct_list_by_id | ( | BlendWriter * | writer, |
| int | struct_id, | ||
| const ListBase * | list ) |
Definition at line 2238 of file writefile.cc.
References BLO_CODE_DATA, BlendWriter::wd, and writelist_nr().
Referenced by BLO_write_struct_list_by_name().
| void BLO_write_struct_list_by_name | ( | BlendWriter * | writer, |
| const char * | struct_name, | ||
| ListBase * | list ) |
Write struct list.
Definition at line 2243 of file writefile.cc.
References BLO_get_struct_id_by_name(), BLO_write_struct_list_by_id(), CLOG_ERROR, LOG, and UNLIKELY.
| void BLO_write_uint32_array | ( | BlendWriter * | writer, |
| int64_t | num, | ||
| const uint32_t * | data_ptr ) |
Definition at line 2292 of file writefile.cc.
References BLO_write_raw(), and num.
Referenced by BKE_previewimg_blend_write(), and BKE_ptcache_blend_write().
| void BLO_write_uint8_array | ( | BlendWriter * | writer, |
| int64_t | num, | ||
| const uint8_t * | data_ptr ) |
Definition at line 2282 of file writefile.cc.
References BLO_write_raw(), and num.
Referenced by blend_write_layer_data(), and blender::bke::write_array_data().