* Sculpt: fix clay defaults again

This commit is contained in:
Joseph Eagar 2021-10-05 02:43:46 -07:00
parent 19e4c235ba
commit 73bd469fe0
5 changed files with 11 additions and 6 deletions

View File

@ -1015,12 +1015,14 @@ class SCULPT_OT_set_dyntopo_mode(Operator):
if not brush.channels["dyntopo_mode"].inherit and ch.inherit_if_unset:
finalch = context.tool_settings.sculpt.channels["dyntopo_mode"]
pass
oldf = set()
for f in finalch.flags_value:
if f not in ["SUBDIVIDE", "COLLAPSE"]:
oldf.add(f)
print("OLDF", oldf)
if self.mode == "SC":
finalch.flags_value = oldf.union({"SUBDIVIDE", "COLLAPSE"})
elif self.mode == "S":

View File

@ -39,7 +39,7 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 31
#define BLENDER_FILE_SUBVERSION 32
/* 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

View File

@ -881,6 +881,7 @@ void reset_clay_mappings(BrushChannelSet *chset, bool strips)
CurveMap *cuma = curve->cm;
if (!strips) { //[[0,0.200], [0.354,0.200], [0.595,0.210], [0.806,0.523], [1,1.000]
#if 0
cuma->curve[0].x = 0.0f;
cuma->curve[0].y = 0.2f;
@ -889,9 +890,9 @@ void reset_clay_mappings(BrushChannelSet *chset, bool strips)
BKE_curvemap_insert(cuma, 0.8f, 0.525f);
BKE_curvemapping_changed(curve, true);
#endif
}
else {
#if 0 // dunno if I've interpreted the original code's math right - joeedh
//[[0,0], [0.250,0.050], [0.500,0.125], [0.750,0.422], [1,1]
cuma->curve[0].x = 0.0f;
cuma->curve[0].y = 0.55f;
@ -899,7 +900,6 @@ void reset_clay_mappings(BrushChannelSet *chset, bool strips)
cuma->curve[2].x = 1.0f;
cuma->curve[2].y = 1.0f;
BKE_curvemapping_changed(curve, true);
#endif
}
mp = BRUSHSET_LOOKUP(chset, strength)->mappings + BRUSH_MAPPING_PRESSURE;

View File

@ -1749,7 +1749,7 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
if (!MAIN_VERSION_ATLEAST(bmain, 300, 27)) {
if (MAIN_VERSION_OLDER(bmain, 300, 20) && !MAIN_VERSION_ATLEAST(bmain, 300, 32)) {
LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) {
if (ELEM(brush->sculpt_tool, SCULPT_TOOL_CLAY, SCULPT_TOOL_CLAY_STRIPS) && brush->channels) {
BRUSHSET_SET_BOOL(brush->channels, autosmooth_use_spacing, true);
@ -1761,7 +1761,10 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
BRUSH_MAPPING_ENABLED;
if (brush->sculpt_tool == SCULPT_TOOL_CLAY_STRIPS) {
BRUSHSET_SET_FLOAT(brush->channels, tip_roundness, 0.18f);
if (BRUSHSET_GET_FLOAT(brush->channels, tip_roundness, NULL) == 0.0f) {
BRUSHSET_SET_FLOAT(brush->channels, tip_roundness, 0.18f);
}
BRUSHSET_LOOKUP(brush->channels, tip_roundness)->flag |= BRUSH_CHANNEL_SHOW_IN_WORKSPACE;
BRUSHSET_SET_BOOL(brush->channels, use_space_attenuation, false);
}

View File

@ -134,7 +134,7 @@ static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *UNUSED(op))
SCULPT_dyntopo_automasking_init(ss, sd, NULL, ob, &mask_cb, &mask_cb_data);
const int max_steps = 10;
const int max_steps = 2;
const int max_dyntopo_steps_coll = 1 << 13;
const int max_dyntopo_steps_subd = 1 << 15;