Blender V4.3
versioning_defaults.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BLI_math_vector_types.hh"
#include "BLI_mempool.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "DNA_camera_types.h"
#include "DNA_curveprofile_types.h"
#include "DNA_defaults.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_light_types.h"
#include "DNA_mask_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_workspace_types.h"
#include "DNA_world_types.h"
#include "BKE_appdir.hh"
#include "BKE_attribute.hh"
#include "BKE_brush.hh"
#include "BKE_colortools.hh"
#include "BKE_curveprofile.h"
#include "BKE_customdata.hh"
#include "BKE_gpencil_legacy.h"
#include "BKE_idprop.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_main_namemap.hh"
#include "BKE_material.h"
#include "BKE_mesh.hh"
#include "BKE_node_runtime.hh"
#include "BKE_node_tree_update.hh"
#include "BKE_paint.hh"
#include "BKE_screen.hh"
#include "BKE_workspace.hh"
#include "BLO_readfile.hh"
#include "BLT_translation.hh"
#include "versioning_common.hh"

Go to the source code of this file.

Macros

#define DNA_DEPRECATED_ALLOW
 
#define U   (*((const UserDef *)&U))
 

Functions

static bool blo_is_builtin_template (const char *app_template)
 
static void blo_update_defaults_screen (bScreen *screen, const char *app_template, const char *workspace_name)
 
void BLO_update_defaults_workspace (WorkSpace *workspace, const char *app_template)
 
static void blo_update_defaults_scene (Main *bmain, Scene *scene)
 
void BLO_update_defaults_startup_blend (Main *bmain, const char *app_template)
 

Detailed Description

This file handles updating the startup.blend, this is used when reading old files.

Unlike regular versioning this makes changes that ensure the startup file has brushes and other presets setup to take advantage of newer features.

To update preference defaults see userdef_default.c.

Definition in file versioning_defaults.cc.

Macro Definition Documentation

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 16 of file versioning_defaults.cc.

◆ U

#define U   (*((const UserDef *)&U))

Definition at line 73 of file versioning_defaults.cc.

Function Documentation

◆ blo_is_builtin_template()

static bool blo_is_builtin_template ( const char * app_template)
static

◆ blo_update_defaults_scene()

◆ blo_update_defaults_screen()

static void blo_update_defaults_screen ( bScreen * screen,
const char * app_template,
const char * workspace_name )
static

Definition at line 83 of file versioning_defaults.cc.

References SpaceAction::ads, ADS_FLAG_SUMMARY_COLLAPSED, app_template, SpaceClip::around, ARRAY_SIZE, View3DShading::background_color, View3DShading::background_type, BKE_appdir_folder_default(), BKE_area_region_panels_free(), MaskSpaceInfo::blend_factor, BLI_freelistN(), blo_is_builtin_template(), SpaceSeq::cache_overlay, View3DShading::cavity_type, View3D::clip_start, View3DShading::color_type, copy_qt_qt(), copy_v3_fl(), FileSelectParams::dir, MaskSpaceInfo::draw_flag, SpaceSeq::draw_flag, View3DOverlay::edit_flag, ELEM, equals_v4v4(), FileSelectParams::file, bDopeSheet::flag, SequencerCacheOverlay::flag, SequencerPreviewOverlay::flag, SequencerTimelineOverlay::flag, SpaceAction::flag, SpaceGraph::flag, SpaceNla::flag, SpaceSeq::flag, View3DShading::flag, View3D::flag2, SpaceText::flags, View3D::gp_flag, LISTBASE_FOREACH, MASK_DRAWFLAG_SPLINE, SpaceClip::mask_info, SpaceAction::mode, SpaceImage::mode, View3DOverlay::normals_constant_screen_size, RegionView3D::ofs, View3D::overlay, SpaceFile::params, SpaceSeq::preview_overlay, SpaceSeq::render_size, RGN_FLAG_HIDDEN, RGN_FLAG_HIDDEN_BY_USER, RGN_TYPE_CHANNELS, RGN_TYPE_TOOL_HEADER, RGN_TYPE_TOOL_PROPS, RGN_TYPE_TOOLS, RGN_TYPE_UI, RGN_TYPE_WINDOW, SACTCONT_TIMELINE, SACTION_SHOW_MARKERS, SACTION_SLIDERS, SEQ_CACHE_SHOW, SEQ_CACHE_SHOW_FINAL_OUT, SEQ_DRAW_TRANSFORM_PREVIEW, SEQ_PREVIEW_SHOW_OUTLINE_SELECTED, SEQ_RENDER_SIZE_PROXY_100, SEQ_SHOW_MARKERS, SEQ_SHOW_OVERLAY, SEQ_TIMELINE_SHOW_GRID, SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG, SEQ_TIMELINE_SHOW_STRIP_DURATION, SEQ_TIMELINE_SHOW_STRIP_NAME, SEQ_TIMELINE_SHOW_STRIP_RETIMING, SEQ_TIMELINE_SHOW_STRIP_SOURCE, SEQ_TIMELINE_SHOW_THUMBNAILS, SEQ_TIMELINE_WAVEFORMS_HALF, SEQ_USE_PROXIES, SEQ_ZOOM_TO_FIT, View3D::shading, SpaceText::showlinenrs, SpaceText::showsyntax, SI_MODE_UV, SI_MODE_VIEW, SIPO_SHOW_MARKERS, SNLA_SHOW_MARKERS, SPACE_ACTION, SPACE_CLIP, SPACE_FILE, SPACE_GRAPH, SPACE_IMAGE, SPACE_NLA, SPACE_SEQ, SPACE_TEXT, SPACE_VIEW3D, ST_FIND_WRAP, STREQ, STRNCPY, View3DOverlay::texture_paint_mode_opacity, SpaceSeq::timeline_overlay, V3D_AROUND_CENTER_MEDIAN, V3D_GP_SHOW_EDIT_LINES, V3D_SHADING_BACKGROUND_VIEWPORT, V3D_SHADING_CAVITY_CURVATURE, V3D_SHADING_MATERIAL_COLOR, V3D_SHADING_SPECULAR_HIGHLIGHT, V3D_SHOW_ANNOTATION, View3D::vertex_opacity, View3DOverlay::vertex_paint_mode_opacity, RegionView3D::viewquat, View3DOverlay::weight_paint_mode_opacity, View3DShading::xray_alpha_wire, and zero_v3().

Referenced by BLO_update_defaults_workspace().

◆ BLO_update_defaults_startup_blend()

void BLO_update_defaults_startup_blend ( Main * bmain,
const char * app_template )

Update defaults in startup.blend, without having to save and embed it.

Note
defaults for preferences are stored in userdef_default.c and can be updated there. Update defaults in startup.blend, without having to save and embed the file. This function can be emptied each time the startup.blend is updated.
Screen data may be cleared at this point, this will happen in the case an app-template's data needs to be versioned when read-file is called with "Load UI" disabled. Versioning the screen data can be safely skipped without "Load UI" since the screen data will have been versioned when it was first loaded.

Definition at line 449 of file versioning_defaults.cc.

References app_template, BKE_gpencil_material_add(), BKE_gpencil_palette_ensure(), BKE_id_delete(), BKE_libblock_rename(), BKE_ntree_update_tag_node_property(), BKE_paint_ensure_from_paintmode(), BKE_workspace_active_layout_for_workspace_get(), BKE_workspace_layout_remove(), BLI_findstring(), BLI_mempool_destroy(), blo_is_builtin_template(), blo_update_defaults_scene(), BLO_update_defaults_workspace(), Main::brushes, Main::cameras, CD_GRID_PAINT_MASK, copy_v4_fl(), CustomData_free_layers(), DEG2RADF, do_versions_rename_id(), Object::dtx, bGPdata::flag, MaterialGPencilStyle::flag, Paint::flags, GP_DATA_STROKE_PAINTMODE, GP_MATERIAL_MODE_DOT, GP_MATERIAL_MODE_SQUARE, ToolSettings::gp_paint, GP_SELECTMODE_STROKE, Material::gp_style, ToolSettings::gpencil_selectmode_edit, 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, 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, Main::scenes, WorkSpaceLayout::screen, Main::screens, SculptGPencil, SET_FLAG_FROM_TEST, SHD_GLOSSY_MULTI_GGX, SHD_SUBSURFACE_RANDOM_WALK, SOCK_IN, SPACE_OUTLINER, STR_ELEM, STREQ, STRNCPY, 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().

◆ BLO_update_defaults_workspace()