Doversion: move (fix) 2.80 checks to 2.90

Some doversion checks were done in the wrong file, meaning they could potentially
be running in the wrong order if they require another fix to run prior to them.

This is technically is a cleanup. And technically a fixup for
9e0a4fcaad.
This commit is contained in:
Dalai Felinto 2020-08-31 12:34:47 +02:00
parent 834613a50e
commit defe21a7bb
2 changed files with 44 additions and 46 deletions

View file

@ -1737,27 +1737,6 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
}
}
if (!MAIN_VERSION_ATLEAST(bmain, 290, 8)) {
/* Paint Brush. This ensure that the brush paints by default. Used during the development and
* patch review of the initial Sculpt Vertex Colors implementation (D5975) */
LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
if (brush->ob_mode & OB_MODE_SCULPT && brush->sculpt_tool == SCULPT_TOOL_PAINT) {
brush->tip_roundness = 1.0f;
brush->flow = 1.0f;
brush->density = 1.0f;
brush->tip_scale_x = 1.0f;
}
}
/* Pose Brush with support for loose parts. */
LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
if (brush->sculpt_tool == SCULPT_TOOL_POSE && brush->disconnected_distance_max == 0.0f) {
brush->flag2 |= BRUSH_USE_CONNECTED_ONLY;
brush->disconnected_distance_max = 0.1f;
}
}
}
/**
* Versioning code until next subversion bump goes here.
*
@ -5083,31 +5062,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
if (!MAIN_VERSION_ATLEAST(bmain, 290, 8)) {
/* Set the cloth wind factor to 1 for old forces. */
if (!DNA_struct_elem_find(fd->filesdna, "PartDeflect", "float", "f_wind_factor")) {
LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
if (ob->pd) {
ob->pd->f_wind_factor = 1.0f;
}
}
LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) {
if (part->pd) {
part->pd->f_wind_factor = 1.0f;
}
if (part->pd2) {
part->pd2->f_wind_factor = 1.0f;
}
}
}
for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) {
/* Don't rotate light with the viewer by default, make it fixed. Shading settings can't be
* edited and this flag should always be set. So we can always execute this. */
wm->xr.session_settings.shading.flag |= V3D_SHADING_WORLD_ORIENTATION;
}
}
/**
* Versioning code until next subversion bump goes here.
*

View file

@ -30,7 +30,9 @@
#include "DNA_gpencil_modifier_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_force_types.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_screen_types.h"
#include "DNA_shader_fx_types.h"
@ -207,6 +209,25 @@ void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports))
}
if (!MAIN_VERSION_ATLEAST(bmain, 290, 8)) {
/* Paint Brush. This ensure that the brush paints by default. Used during the development and
* patch review of the initial Sculpt Vertex Colors implementation (D5975) */
LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
if (brush->ob_mode & OB_MODE_SCULPT && brush->sculpt_tool == SCULPT_TOOL_PAINT) {
brush->tip_roundness = 1.0f;
brush->flow = 1.0f;
brush->density = 1.0f;
brush->tip_scale_x = 1.0f;
}
}
/* Pose Brush with support for loose parts. */
LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
if (brush->sculpt_tool == SCULPT_TOOL_POSE && brush->disconnected_distance_max == 0.0f) {
brush->flag2 |= BRUSH_USE_CONNECTED_ONLY;
brush->disconnected_distance_max = 0.1f;
}
}
LISTBASE_FOREACH (Collection *, collection, &bmain->collections) {
if (BKE_collection_cycles_fix(bmain, collection)) {
printf(
@ -411,6 +432,29 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
if (!MAIN_VERSION_ATLEAST(bmain, 290, 8)) {
/* Set the cloth wind factor to 1 for old forces. */
if (!DNA_struct_elem_find(fd->filesdna, "PartDeflect", "float", "f_wind_factor")) {
LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
if (ob->pd) {
ob->pd->f_wind_factor = 1.0f;
}
}
LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) {
if (part->pd) {
part->pd->f_wind_factor = 1.0f;
}
if (part->pd2) {
part->pd2->f_wind_factor = 1.0f;
}
}
}
for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) {
/* Don't rotate light with the viewer by default, make it fixed. Shading settings can't be
* edited and this flag should always be set. So we can always execute this. */
wm->xr.session_settings.shading.flag |= V3D_SHADING_WORLD_ORIENTATION;
}
/* Initialize additional parameter of the Nishita sky model and change altitude unit. */
if (!DNA_struct_elem_find(fd->filesdna, "NodeTexSky", "float", "sun_intensity")) {
FOREACH_NODETREE_BEGIN (bmain, ntree, id) {