Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_defaults.c
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_appdir.h" | #include "BKE_appdir.h" | ||||
| #include "BKE_brush.h" | #include "BKE_brush.h" | ||||
| #include "BKE_colortools.h" | #include "BKE_colortools.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_paint.h" | |||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "BLO_readfile.h" | #include "BLO_readfile.h" | ||||
| /** | /** | ||||
| * Rename if the ID doesn't exist. | * Rename if the ID doesn't exist. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | if (app_template && STREQ(app_template, "Video_Editing")) { | ||||
| STRNCPY(scene->view_settings.view_transform, "Standard"); | STRNCPY(scene->view_settings.view_transform, "Standard"); | ||||
| STRNCPY(scene->view_settings.look, "None"); | STRNCPY(scene->view_settings.look, "None"); | ||||
| } | } | ||||
| else { | else { | ||||
| /* AV Sync break physics sim caching, disable until that is fixed. */ | /* AV Sync break physics sim caching, disable until that is fixed. */ | ||||
| scene->audio.flag &= ~AUDIO_SYNC; | scene->audio.flag &= ~AUDIO_SYNC; | ||||
| scene->flag &= ~SCE_FRAME_DROP; | scene->flag &= ~SCE_FRAME_DROP; | ||||
| } | } | ||||
| /* Change default selection mode for Grease Pencil. */ | |||||
| if (app_template && STREQ(app_template, "2D_Animation")) { | |||||
| ToolSettings *ts = scene->toolsettings; | |||||
| ts->gpencil_selectmode_edit = GP_SELECTMODE_STROKE; | |||||
| } | |||||
| } | } | ||||
| /* Objects */ | /* Objects */ | ||||
| rename_id_for_versioning(bmain, ID_OB, "Lamp", "Light"); | rename_id_for_versioning(bmain, ID_OB, "Lamp", "Light"); | ||||
| rename_id_for_versioning(bmain, ID_LA, "Lamp", "Light"); | rename_id_for_versioning(bmain, ID_LA, "Lamp", "Light"); | ||||
| if (app_template && STREQ(app_template, "2D_Animation")) { | if (app_template && STREQ(app_template, "2D_Animation")) { | ||||
| for (Object *object = bmain->objects.first; object; object = object->id.next) { | for (Object *object = bmain->objects.first; object; object = object->id.next) { | ||||
| ▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { | ||||
| /* Use the same tool icon color in the brush cursor */ | /* Use the same tool icon color in the brush cursor */ | ||||
| for (brush = bmain->brushes.first; brush; brush = brush->id.next) { | for (brush = bmain->brushes.first; brush; brush = brush->id.next) { | ||||
| if (brush->sculpt_tool) { | if (brush->sculpt_tool) { | ||||
| BKE_brush_sculpt_reset(brush); | BKE_brush_sculpt_reset(brush); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (app_template && STREQ(app_template, "2D_Animation")) { | |||||
| /* Update Grease Pencil brushes. */ | |||||
| Brush *brush; | |||||
| /* Pencil brush. */ | |||||
| brush = BLI_findstring(&bmain->brushes, "Draw Pencil", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| /* Change brush name. */ | |||||
| rename_id_for_versioning(bmain, ID_BR, "Draw Pencil", "Pencil"); | |||||
| } | |||||
| /* Pen brush. */ | |||||
| brush = BLI_findstring(&bmain->brushes, "Draw Pen", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| /* Change brush name. */ | |||||
| rename_id_for_versioning(bmain, ID_BR, "Draw Pen", "Pen"); | |||||
| } | |||||
| /* Pen Soft brush. */ | |||||
| brush = BLI_findstring(&bmain->brushes, "Draw Soft", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| brush->gpencil_settings->icon_id = GP_BRUSH_ICON_PEN; | |||||
| /* Change brush name. */ | |||||
| rename_id_for_versioning(bmain, ID_BR, "Draw Soft", "Pencil Soft"); | |||||
| } | |||||
| /* Ink Pen brush. */ | |||||
| brush = BLI_findstring(&bmain->brushes, "Draw Ink", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| /* Change brush name. */ | |||||
| rename_id_for_versioning(bmain, ID_BR, "Draw Ink", "Ink Pen"); | |||||
| } | |||||
| /* Ink Pen Rough brush. */ | |||||
| brush = BLI_findstring(&bmain->brushes, "Draw Noise", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| /* Change brush name. */ | |||||
| rename_id_for_versioning(bmain, ID_BR, "Draw Noise", "Ink Pen Rough"); | |||||
| } | |||||
| /* Marker Bold brush. */ | |||||
| brush = BLI_findstring(&bmain->brushes, "Draw Marker", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| /* Change brush name. */ | |||||
| rename_id_for_versioning(bmain, ID_BR, "Draw Marker", "Marker Bold"); | |||||
| } | |||||
| /* Marker Chisel brush. */ | |||||
| brush = BLI_findstring(&bmain->brushes, "Draw Block", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| /* Change brush name. */ | |||||
| rename_id_for_versioning(bmain, ID_BR, "Draw Block", "Marker Chisel"); | |||||
| } | |||||
| /* Remove useless Fill Area.001 brush. */ | |||||
| brush = BLI_findstring(&bmain->brushes, "Fill Area.001", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| BKE_id_delete(bmain, brush); | |||||
| } | |||||
| /* Reset all grease pencil brushes. */ | |||||
| Scene *scene = bmain->scenes.first; | |||||
| BKE_brush_gpencil_presets(bmain, scene->toolsettings); | |||||
| } | |||||
| } | } | ||||