From 7bab7155ad09f44f0da28608448a03dc0df7d464 Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Thu, 24 Jul 2025 21:59:38 +0200 Subject: [PATCH] Fix #142151: Scrape brush 'Plane Offset' not versioned correctly The general Plane brush is a replacement for the Flatten, Fill, and Scrape brushes that formerly existed. When the old brush types were converted to the new type, the 'Plane Offset' usecase was missed due to the field not being used for the bundled essential brushes. To preserve brush behavior across 4.4 and 4.5, Scrape brushes with a given 'Plane Offset' need to have this signed distance inverted. Unfortunately, as this was discovered after 4.5 was officially released, and the versioning having no clear indicators that can be used to fix this with a subsequent version bump, this commit cannot address users who have already started using 4.5. The best we can do in this case is fix the incorrect versioning and make a note of the issue in the release notes so that future users will not continue to experience this issue. Pull Request: https://projects.blender.org/blender/blender/pulls/143020 --- source/blender/blenloader/intern/versioning_450.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/blender/blenloader/intern/versioning_450.cc b/source/blender/blenloader/intern/versioning_450.cc index c96ab52249e..d0448ad1254 100644 --- a/source/blender/blenloader/intern/versioning_450.cc +++ b/source/blender/blenloader/intern/versioning_450.cc @@ -4942,6 +4942,20 @@ static void version_convert_sculpt_planar_brushes(Main *bmain) brush->plane_inversion_mode = brush->flag & BRUSH_INVERT_TO_SCRAPE_FILL ? BRUSH_PLANE_SWAP_HEIGHT_AND_DEPTH : BRUSH_PLANE_INVERT_DISPLACEMENT; + + /* Note, this fix was committed after some users had already run the versioning after + * 4.5 was released. Since 4.5 is an LTS and will be used for the foreseeable future to + * transition between 4.x and 5.x the fix has been added here, even though that does + * not fix the issue for some users with custom brush assets who have started using 4.5 + * already. + * + * Since the `sculpt_brush_type` field changed from 'SCULPT_BRUSH_TYPE_SCRAPE' to + * 'SCULPT_BRUSH_TYPE_PLANE', we do not have a value that can be used to definitively apply + * a corrective versioning step along with a subversion bump without potentially affecting + * some false positives. + * + * See #142151 for more details. */ + brush->plane_offset *= -1.0f; } if (brush->flag & BRUSH_PLANE_TRIM) {