DNA: add defaults for UnifiedPaintSettings

Newly created scenes had unified paint settings zeroed. see T80164

Ref D10658
This commit is contained in:
Siddhartha Jejurkar
2021-03-10 21:41:55 +11:00
committed by Campbell Barton
parent 3dab6f8b7b
commit 122fefcc85
3 changed files with 12 additions and 2 deletions

View File

@@ -284,6 +284,15 @@
.count = 10, \
}
#define _DNA_DEFAULTS_UnifiedPaintSettings \
{ \
.size = 50, \
.unprojected_radius = 0.29, \
.alpha = 0.5f, \
.weight = 0.5f, \
.flag = UNIFIED_PAINT_SIZE | UNIFIED_PAINT_ALPHA, \
}
#define _DNA_DEFAULTS_ParticleEditSettings \
{ \
.flag = PE_KEEP_LENGTHS | PE_LOCK_FIRST | PE_DEFLECT_EMITTER | PE_AUTO_VELOCITY, \
@@ -345,6 +354,8 @@
.snap_transform_mode_flag = SCE_SNAP_TRANSFORM_MODE_TRANSLATE, \
\
.curve_paint_settings = _DNA_DEFAULTS_CurvePaintSettings, \
\
.unified_paint_settings = _DNA_DEFAULTS_UnifiedPaintSettings, \
\
.statvis = _DNA_DEFAULTS_MeshStatVis, \
\

View File

@@ -425,6 +425,7 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = {
SDNA_DEFAULT_DECL(ToolSettings),
SDNA_DEFAULT_DECL_EX(CurvePaintSettings, ToolSettings.curve_paint_settings),
SDNA_DEFAULT_DECL_EX(ImagePaintSettings, ToolSettings.imapaint),
SDNA_DEFAULT_DECL_EX(UnifiedPaintSettings, ToolSettings.unified_paint_settings),
SDNA_DEFAULT_DECL_EX(ParticleEditSettings, ToolSettings.particle),
SDNA_DEFAULT_DECL_EX(ParticleBrushData, ToolSettings.particle.brush[0]),
SDNA_DEFAULT_DECL_EX(MeshStatVis, ToolSettings.statvis),

View File

@@ -3569,7 +3569,6 @@ static void rna_def_unified_paint_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 10.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
RNA_def_property_ui_text(
@@ -3579,7 +3578,6 @@ static void rna_def_unified_paint_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "weight");
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_float_default(prop, 0.5f);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
RNA_def_property_ui_text(prop, "Weight", "Weight to assign in vertex groups");