Commit: 1111af5cb4964369963c587b5400ab784a4397c6 Author: Pablo Vazquez Date: Mon Oct 17 14:47:49 2022 +0200 Branches: master https://developer.blender.org/rB1111af5cb4964369963c587b5400ab784a4397c6
Sculpt: add versioning for Auto-masking cavity factor default Also remove automasking_cavity_factor default from RNA for brushes. Data-blocks set their defaults via `DNA_brush_defaults.h` Continuation from previous commit and rBdb40b6 Thanks to Dalai for the help! =================================================================== M source/blender/blenkernel/BKE_blender_version.h M source/blender/blenloader/intern/versioning_300.cc M source/blender/makesrna/intern/rna_brush.c =================================================================== diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 3c8f7d758b6..96df8f7a443 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -25,7 +25,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 3 +#define BLENDER_FILE_SUBVERSION 4 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --git a/source/blender/blenloader/intern/versioning_300.cc b/source/blender/blenloader/intern/versioning_300.cc index 5328107e1f2..e2b98b2283f 100644 --- a/source/blender/blenloader/intern/versioning_300.cc +++ b/source/blender/blenloader/intern/versioning_300.cc @@ -3623,6 +3623,13 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 304, 4)) { + /* Update brush sculpt settings. */ + LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) { + brush->automasking_cavity_factor = 1.0f; + } + } + /** * Versioning code until next subversion bump goes here. * diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index b44b0620329..35e01be366b 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -3242,7 +3242,6 @@ static void rna_def_brush(BlenderRNA *brna) prop = RNA_def_property(srna, "automasking_cavity_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "automasking_cavity_factor"); - RNA_def_property_float_default(prop, 1.0f); RNA_def_property_ui_text(prop, "Cavity Factor", "The contrast of the cavity mask"); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs