Blender V4.3
Main Struct Reference

#include <BKE_main.hh>

Public Attributes

Mainnext
 
Mainprev
 
char filepath [1024]
 
short versionfile
 
short subversionfile
 
short minversionfile
 
short minsubversionfile
 
bool has_forward_compatibility_issues
 
bool is_asset_edit_file
 
uint64_t build_commit_timestamp
 
char build_hash [16]
 
bool recovered
 
bool is_memfile_undo_written
 
bool is_memfile_undo_flush_needed
 
bool use_memfile_full_barrier
 
bool is_locked_for_linking
 
bool is_read_invalid
 
bool is_global_main
 
bool is_action_slot_to_id_map_dirty
 
BlendThumbnailblen_thumb
 
Librarycurlib
 
ListBase scenes
 
ListBase libraries
 
ListBase objects
 
ListBase meshes
 
ListBase curves
 
ListBase metaballs
 
ListBase materials
 
ListBase textures
 
ListBase images
 
ListBase lattices
 
ListBase lights
 
ListBase cameras
 
ListBase ipo
 
ListBase shapekeys
 
ListBase worlds
 
ListBase screens
 
ListBase fonts
 
ListBase texts
 
ListBase speakers
 
ListBase lightprobes
 
ListBase sounds
 
ListBase collections
 
ListBase armatures
 
ListBase actions
 
ListBase nodetrees
 
ListBase brushes
 
ListBase particles
 
ListBase palettes
 
ListBase paintcurves
 
ListBase wm
 
ListBase gpencils
 
ListBase grease_pencils
 
ListBase movieclips
 
ListBase masks
 
ListBase linestyles
 
ListBase cachefiles
 
ListBase workspaces
 
ListBase hair_curves
 
ListBase pointclouds
 
ListBase volumes
 
MainIDRelationsrelations
 
IDNameLib_Mapid_map
 
UniqueName_Mapname_map
 
UniqueName_Mapname_map_global
 
MainLock * lock
 

Detailed Description

Member Data Documentation

◆ actions

◆ armatures

◆ blen_thumb

◆ brushes

◆ build_commit_timestamp

uint64_t Main::build_commit_timestamp

Commit timestamp from buildinfo.

Definition at line 154 of file BKE_main.hh.

Referenced by read_global().

◆ build_hash

char Main::build_hash[16]

Commit Hash from buildinfo.

Definition at line 156 of file BKE_main.hh.

Referenced by read_global().

◆ cachefiles

◆ cameras

◆ collections

◆ curlib

◆ curves

◆ filepath

char Main::filepath[1024]

The file-path of this blend file, an empty string indicates an unsaved file.

Note
For the current loaded blend file this path must be absolute & normalized. This prevents redundant leading slashes or current-working-directory relative paths from causing problems with absolute/relative conversion which relies on this filepath being absolute. See BLI_path_canonicalize_native.

This rule is not strictly enforced as in some cases loading a Main is performed to read data temporarily (preferences & startup) for e.g. where the filepath is not persistent or used as a basis for other paths.

Definition at line 136 of file BKE_main.hh.

Referenced by are_ids_from_different_mains_matching(), AS_asset_library_find_suitable_root_path_from_main(), blender::ed::asset::asset_bundle_install_exec(), blender::ed::asset::asset_bundle_install_poll(), blender::ed::asset::asset_catalogs_save_poll(), blender::bke::asset_edit_id_from_weak_reference(), blender::bke::asset_main_create_from_ID(), BKE_main_blendfile_path(), BKE_main_free(), BKE_main_merge(), BKE_memfile_undo_decode(), BKE_modifier_path_relbase(), blo_find_main(), BLO_library_temp_load_id(), blo_read_file_internal(), BLO_write_file_impl(), bpy_lib_write(), blender::ed::asset::catalogs_save_from_main_path(), blender::io::obj::OBJExportRegressionTest::compare_obj_export_to_golden(), blender::ed::asset::could_be_asset_bundle(), blender::io::alembic::create_abc_metadata(), Freestyle::PythonInterpreter::interpretFile(), main_merge_add_id_to_move(), blender::asset_system::AssetLibrary::on_blend_save_post(), open_exec(), blender::bke::blendfile::PartialWriteContext::PartialWriteContext(), paste_material_exec(), pose_paste_exec(), blender::ed::space_node::preview_prepare_scene(), preview_prepare_scene(), reuse_bmain_data_remapper_ensure(), seq_disk_cache_is_enabled(), sequencer_write_copy_paste_file(), blender::ed::asset::set_filepath_for_asset_lib(), blender::bke::tests::BPathTest::SetUp(), setup_app_data(), split_main_newid(), wm_file_write(), wm_filepath_default(), wm_homefile_read_ex(), workspace_append_button(), and write_global().

◆ fonts

◆ gpencils

◆ grease_pencils

ListBase Main::grease_pencils

◆ hair_curves

ListBase Main::hair_curves
Note
The name hair_curves is chosen to be different than curves, but they are generic curve data-blocks, not just for hair.

Definition at line 251 of file BKE_main.hh.

Referenced by BKE_animdata_main_cb(), blo_do_versions_300(), fix_built_in_curve_attribute_defaults(), set_listbasepointers(), and which_libbase().

◆ has_forward_compatibility_issues

bool Main::has_forward_compatibility_issues

The currently opened .blend file was written from a newer version of Blender, and has forward compatibility issues (data loss).

Note
In practice currently this is only based on the version numbers, in the future it could try to use more refined detection on load.

Definition at line 144 of file BKE_main.hh.

Referenced by BKE_main_has_issues(), BKE_main_needs_overwrite_confirm(), blo_split_main(), block_create_save_file_overwrite_dialog(), file_overwrite_detailed_info_show(), read_global(), ui_template_status_tooltip(), uiTemplateStatusInfo(), wm_block_file_close_save(), and wm_save_as_mainfile_exec().

◆ id_map

◆ images

◆ ipo

◆ is_action_slot_to_id_map_dirty

bool Main::is_action_slot_to_id_map_dirty

True if the Action Slot-to-ID mapping is dirty.

If this flag is set, the next call to animrig::Slot::users(bmain) and related functions will trigger a rebuild of the Slot-to-ID mapping. Since constructing this mapping requires a full scan of the animatable IDs in this Main anyway, it is kept as a flag here.

Note
This flag should not be set directly. Use #animrig::Slot::users_invalidate() instead. That way the handling of this flag is limited to the code in #animrig::Slot.
See also
blender::animrig::Slot::users_invalidate(Main &bmain)

Definition at line 205 of file BKE_main.hh.

Referenced by blender::bke::action_foreach_id(), BKE_main_init(), blender::animrig::internal::rebuild_slot_user_cache(), blender::animrig::Slot::users(), and blender::animrig::Slot::users_invalidate().

◆ is_asset_edit_file

bool Main::is_asset_edit_file

This file was written by the asset system with the G_FILE_ASSET_EDIT_FILE flag (now cleared). It must not be overwritten, except by the asset system itself. Otherwise the file could end up with user created data that would be lost when the asset system regenerates the file.

Definition at line 151 of file BKE_main.hh.

Referenced by blender::bke::asset_main_create_from_ID(), BKE_main_has_issues(), BKE_main_needs_overwrite_confirm(), blo_join_main(), blo_split_main(), BLO_write_file_impl(), block_create_save_file_overwrite_dialog(), file_overwrite_detailed_info_show(), read_global(), save_set_filepath(), setup_app_data(), ui_template_status_tooltip(), and wm_file_write_check_with_report_on_failure().

◆ is_global_main

bool Main::is_global_main

True if this main is the 'GMAIN' of current Blender.

Note
There should always be only one global main, all others generated temporarily for various data management process must have this property set to false..

Definition at line 191 of file BKE_main.hh.

Referenced by BKE_blender_globals_main_replace(), BKE_blender_globals_main_swap(), and BKE_main_init().

◆ is_locked_for_linking

bool Main::is_locked_for_linking

◆ is_memfile_undo_flush_needed

◆ is_memfile_undo_written

◆ is_read_invalid

bool Main::is_read_invalid

When set, indicates that an unrecoverable error/data corruption was detected. Should only be set by readfile code, and used by upper-level code (typically setup_app_data) to cancel a file reading operation.

Definition at line 183 of file BKE_main.hh.

Referenced by add_main_to_main(), BKE_blendfile_read(), BKE_blendfile_read_from_memfile(), BKE_blendfile_read_from_memory(), BKE_blendfile_read_setup_readfile(), BLO_library_link_end(), BLO_library_link_named_part(), blo_read_file_checks(), blo_read_file_internal(), blo_readfile_invalidate(), expand_doit_library(), and library_link_end().

◆ lattices

◆ libraries

◆ lightprobes

ListBase Main::lightprobes

◆ lights

◆ linestyles

◆ lock

◆ masks

◆ materials

◆ meshes

◆ metaballs

ListBase Main::metaballs

◆ minsubversionfile

short Main::minsubversionfile

Definition at line 138 of file BKE_main.hh.

Referenced by read_global().

◆ minversionfile

short Main::minversionfile

Definition at line 138 of file BKE_main.hh.

Referenced by read_global().

◆ movieclips

◆ name_map

UniqueName_Map* Main::name_map

Used for efficient calculations of unique names.

Definition at line 266 of file BKE_main.hh.

Referenced by BKE_main_clear(), get_namemap_for(), and main_namemap_validate_and_fix().

◆ name_map_global

◆ next

◆ nodetrees

◆ objects

ListBase Main::objects

Definition at line 212 of file BKE_main.hh.

Referenced by add_bevel_modifier_attribute_name_defaults(), blender::bke::tests::add_id_in_library(), blender::animrig::add_object_data_users(), applyarmature_fix_boneparents(), blender::ed::object::bake(), BKE_animdata_main_cb(), BKE_image_walk_all_users(), BKE_lib_override_library_main_operations_create(), BKE_lib_override_library_main_proxy_convert(), BKE_lib_override_library_update(), BKE_library_make_local(), BKE_main_lib_objects_recalc_all(), BKE_main_mesh_legacy_convert_auto_smooth(), BKE_mball_properties_copy(), BKE_mesh_legacy_face_map_to_generic(), BKE_object_exists_check(), BKE_object_material_slot_remove(), BKE_object_update_select_id(), BKE_objects_materials_test_all(), BKE_packedfile_count_all(), BKE_packedfile_pack_all(), BKE_packedfile_unpack_all(), BKE_scene_set_background(), blo_do_versions_250(), blo_do_versions_260(), blo_do_versions_270(), blo_do_versions_280(), blo_do_versions_290(), blo_do_versions_300(), blo_do_versions_pre250(), BLO_update_defaults_startup_blend(), bmesh_to_mesh_calc_object_remap(), blender::bke::tests::change_name_global(), clean_viewport_memory(), collection_instantiated_by_any_object(), CryptomatteSession::CryptomatteSession(), do_version_curvemapping_walker(), do_versions_after_linking_280(), do_versions_after_linking_290(), do_versions_after_linking_300(), do_versions_after_linking_400(), do_versions_idproperty_ui_data(), do_versions_ipos_to_animato(), ED_armature_bone_rename(), ED_armature_from_edit(), ED_editors_exit(), ED_editors_flush_edits_ex(), ED_editors_init(), blender::bke::NodeTreeRelations::ensure_modifier_users(), find_family_object(), blender::animrig::find_related_ids(), blender::ed::geometry::geometry_randomization_exec(), blender::ed::object::ignore_parent_tx(), blender::ed::object::iter_other(), joined_armature_fix_links(), blender::bke::greasepencil::convert::legacy_gpencil_sanitize_annotations(), blender::bke::greasepencil::convert::legacy_main(), lib_override_library_create_post_process(), lib_override_linked_group_tag(), lib_override_linked_group_tag_clear_boneshapes_objects(), libblock_remap_data_postprocess_object_update(), libblock_remap_foreach_idpair(), blender::ed::object::make_local_all__instance_indirect_unused(), blender::ed::object::mesh_needs_keyindex(), move_vertex_group_names_to_object_data(), blender::ed::object::object_convert_exec(), blender::ed::object::object_data_convert_curve_to_mesh(), blender::ed::object::object_origin_set_exec(), object_preview_scene_create(), blender::ed::outliner::outliner_batch_delete_object_hierarchy(), blender::ed::outliner::outliner_object_set_flag_recursive_fn(), placeholders_ensure_valid(), pose_paste_exec(), previews_clear_exec(), remap_hooks_and_vertex_parents(), scene_changed(), separated_armature_fix_links(), set_listbasepointers(), snap_selected_to_location(), blender::ed::object::tag_localizable_objects(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), blender::bke::tests::TEST(), text_refresh_pyconstraints_exec(), version_bonegroup_migrate_color(), version_bonegroups_to_bonecollections(), version_mesh_crease_generic(), version_vertex_weight_edit_preserve_threshold_exclusivity(), and which_libbase().

◆ paintcurves

ListBase Main::paintcurves

Definition at line 238 of file BKE_main.hh.

Referenced by set_listbasepointers(), and which_libbase().

◆ palettes

ListBase Main::palettes

◆ particles

◆ pointclouds

ListBase Main::pointclouds

◆ prev

Main * Main::prev

◆ recovered

bool Main::recovered

Indicate the Main.filepath (file) is the recovered one.

Definition at line 158 of file BKE_main.hh.

Referenced by setup_app_data(), and wm_file_write().

◆ relations

◆ scenes

ListBase Main::scenes

Definition at line 210 of file BKE_main.hh.

Referenced by all_scenes_use(), ANIM_keyingset_info_unregister(), BKE_animdata_main_cb(), BKE_collections_child_remove_nulls(), BKE_collections_object_remove_invalids(), BKE_image_walk_all_users(), BKE_layer_collection_local_sync_all(), BKE_lib_override_library_main_proxy_convert(), BKE_main_collection_sync(), BKE_main_collection_sync_remap(), BKE_main_collections_object_cache_free(), BKE_main_collections_parent_relations_rebuild(), BKE_main_view_layers_synced_ensure(), BKE_object_scenes_users_get(), BKE_scene_can_be_removed(), BKE_scene_find_from_collection(), BKE_scene_undo_depsgraphs_extract(), BKE_scene_undo_depsgraphs_restore(), BKE_scene_validate_setscene(), blo_do_versions_250(), blo_do_versions_260(), blo_do_versions_270(), blo_do_versions_280(), blo_do_versions_290(), blo_do_versions_300(), blo_do_versions_400(), blo_do_versions_pre250(), BLO_update_defaults_startup_blend(), clean_paths(), do_version_curvemapping_walker(), do_versions_after_linking_280(), do_versions_after_linking_290(), do_versions_after_linking_300(), do_versions_after_linking_400(), do_versions_after_setup(), do_versions_idproperty_ui_data(), do_versions_ipos_to_animato(), DRW_cache_free_old_batches(), ed_marker_make_links_scene_exec(), ED_render_engine_changed(), IMB_colormanagement_check_file_config(), blender::bke::greasepencil::convert::legacy_gpencil_sanitize_annotations(), lib_link_scenes_check_set(), link_global(), blender::ed::object::make_links_scene_exec(), blender::ed::object::make_override_library_object_overridable_check(), blender::ed::space_node::node_read_viewlayers_exec(), blender::bke::node_tree_iterator_init(), blender::ed::object::object_delete_exec(), object_in_any_collection(), object_in_any_scene(), preview_get_scene(), blender::ed::space_node::preview_prepare_scene(), previews_ensure_exec(), screen_render_single_layer_set(), SEQ_relations_invalidate_movieclip_strips(), SEQ_relations_invalidate_scene_strips(), sequencer_add_scene_strip_exec(), sequencer_change_scene_exec(), sequencer_clipboard_paste_exec(), set_listbasepointers(), setup_app_data(), texture_changed(), uiTemplateRunningJobs(), update_paint_modes_for_brush_assets(), version_fix_image_format_copy(), version_nla_tweakmode_incomplete(), view3d_local_collections_reset(), view_layer_remove_unset_nodetrees(), which_libbase(), wm_block_autorun_warning_enable_scripts(), wm_file_read_report(), and write_renderinfo().

◆ screens

ListBase Main::screens

Definition at line 225 of file BKE_main.hh.

Referenced by add_image_editor_asset_shelf(), BKE_layer_collection_local_sync_all(), blo_do_versions_250(), blo_do_versions_260(), blo_do_versions_270(), blo_do_versions_280(), blo_do_versions_290(), blo_do_versions_300(), blo_do_versions_400(), blo_do_versions_pre250(), BLO_update_defaults_startup_blend(), do_version_workspaces_after_lib_link(), do_version_workspaces_create_from_screens(), do_versions_after_linking_280(), do_versions_after_linking_300(), do_versions_area_ensure_tool_region(), ED_armature_bone_rename(), ED_editors_init_for_undo(), ED_outliner_select_sync_flag_outliners(), ED_previews_tag_dirty_by_id(), ED_render_engine_changed(), ED_screens_init(), ED_update_for_newframe(), ED_view3d_local_collections_reset(), free_localcollection_bit(), free_localview_bit(), get_sequencer_render_size(), gizmotype_unlink(), blender::bke::greasepencil::convert::legacy_gpencil_sanitize_annotations(), screen_change_prepare(), screen_fullscreen_find_associated_normal_screen(), screen_temp_region_exists(), set_listbasepointers(), setup_app_data(), spacedata_cleanup_exec(), sync_viewport_camera_smoothview(), blender::ed::asset::shelf::type_unlink(), which_libbase(), wm_check_screen_exists(), wm_file_read_setup_wm_finalize(), WM_gizmo_group_remove_by_tool(), WM_gizmoconfig_update(), WM_gizmomaptype_group_init_runtime(), WM_gizmomaptype_group_unlink(), WM_main_remap_editor_id_reference(), WM_reinit_gizmomap_all(), wm_uilisttype_unlink(), and wm_xr_session_update_screen().

◆ shapekeys

◆ sounds

◆ speakers

ListBase Main::speakers

Definition at line 228 of file BKE_main.hh.

Referenced by BKE_animdata_main_cb(), set_listbasepointers(), and which_libbase().

◆ subversionfile

◆ texts

◆ textures

◆ use_memfile_full_barrier

bool Main::use_memfile_full_barrier

Indicates that next memfile undo step should not allow reusing old bmain when re-read, but instead do a complete full re-read/update from stored memfile.

Definition at line 170 of file BKE_main.hh.

Referenced by memfile_undosys_step_encode().

◆ versionfile

◆ volumes

◆ wm

ListBase Main::wm

Definition at line 239 of file BKE_main.hh.

Referenced by blender::ed::viewer_path::activate_geometry_node(), blender::ed::object::base_active_refresh(), BKE_image_editors_update_frame(), BKE_image_walk_all_users(), BKE_view_layer_rename(), BKE_workspace_id_tag_all_visible(), Freestyle::BlenderStrokeRenderer::BlenderStrokeRenderer(), blo_do_versions_270(), blo_do_versions_280(), blo_do_versions_290(), blo_do_versions_300(), blo_read_file_checks(), BLO_update_defaults_startup_blend(), bpy_rna_context_temp_override_enter(), check_rendered_viewport_visible(), clean_viewport_memory(), current_screen_compat(), do_version_workspaces_after_lib_link(), do_versions_after_linking_280(), ED_clip_update_frame(), ED_editors_init_for_undo(), ED_render_engine_area_exit(), ED_render_engine_changed(), ED_render_scene_update(), ED_render_view3d_update(), ED_scene_delete(), ED_scene_view_layer_delete(), ED_space_image_sync(), ED_text_undo_push_init(), ED_view3d_shade_update(), blender::find_side_effect_nodes(), blender::ed::geometry::find_socket_log_contexts(), blender::find_socket_log_contexts(), format_stats(), blender::ed::sculpt_paint::object_sculpt_mode_enter(), render_image_restore_layer(), render_image_update_pass_and_layer(), set_listbasepointers(), setup_app_data(), sound_jack_sync_callback(), swap_wm_data_for_blendfile(), toolsystem_brush_activate_from_toolref_for_object_paint(), toolsystem_brush_activate_from_toolref_for_object_particle(), toolsystem_refresh_screen_from_active_tool(), track_markers_endjob(), blender::ed::outliner::tree_element_camera_activate(), blender::ed::viewer_path::update_active_geometry_nodes_viewer(), which_libbase(), wm_block_file_close_save(), WM_check(), wm_check_window_exists(), wm_clear_default_size(), WM_event_remove_modal_handler_all(), wm_file_read_report(), wm_file_read_setup_wm_finalize(), wm_file_read_setup_wm_init(), WM_gizmomaptype_group_init_runtime_keymap(), wm_homefile_read_ex(), WM_main_add_notifier(), WM_main_remap_editor_id_reference(), WM_main_remove_notifier_reference(), wm_read_callback_post_wrapper(), WM_report_banners_cancel(), WM_toolsystem_do_msg_notify_tag_refresh(), WM_toolsystem_ref_sync_from_context(), WM_toolsystem_refresh_active(), WM_toolsystem_refresh_screen_all(), WM_toolsystem_update_from_context_view3d(), wm_uilisttype_unlink(), wm_userpref_read_exec(), WM_window_set_active_view_layer(), wm_xr_session_create_cb(), wm_xr_session_update_screen(), workspace_blend_read_after_liblink(), and Freestyle::BlenderStrokeRenderer::~BlenderStrokeRenderer().

◆ workspaces

◆ worlds


The documentation for this struct was generated from the following file: