From 627141082b12f266adb43478402edd1900240765 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Sat, 12 Nov 2016 16:14:09 +0100 Subject: Sculpt UI: Make DynTopo constant detail a resolution value This should make it easier to sculpt in high resolutions, downside is that the new way to calculate maximum edge length is a bit less intuitive. Maximum edge length used to be calculated as blender_unit * percentage_value, now it's blender_unit / value. Reused old DNA struct member, but had to bump subversion to ensure correct compatibility conversion. Also changed default value slightly (would have had to set to 3.333... otherwise). Was Requested by @monio (see https://rightclickselect.com/p/sculpting/zpbbbc/dyntopo-better-scale-input-in-constant-detail-mode) and I think it's worth testing. --- source/blender/blenloader/intern/versioning_270.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 8e855eb56b8..8133d0496fa 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -1427,7 +1427,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } - { + if (!MAIN_VERSION_ATLEAST(main, 278, 3)) { for (Scene *scene = main->scene.first; scene != NULL; scene = scene->id.next) { if (scene->toolsettings != NULL) { ToolSettings *ts = scene->toolsettings; @@ -1454,5 +1454,16 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } + + /* constant detail for sculpting is now a resolution value instead of + * a percentage, we reuse old DNA struct member but convert it */ + for (Scene *scene = main->scene.first; scene != NULL; scene = scene->id.next) { + if (scene->toolsettings != NULL) { + ToolSettings *ts = scene->toolsettings; + if (ts->sculpt && ts->sculpt->constant_detail != 0.0f) { + ts->sculpt->constant_detail = 100.0f / ts->sculpt->constant_detail; + } + } + } } } -- cgit v1.2.3