From 05dd9ca06cc13d0847dbd6115b26df9484019c1e Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Tue, 12 May 2020 03:10:22 +0200 Subject: Fix T75347: Update cloth brushes in versioning with a valid mass value The file attached in the report has a cloth brush saved with a particle mass of 0.0, which causes all sort of issues in the solver. I don't know how that brush was created, but it does not seems to be possible to do in the current version (reset values are correct, property limits are correct and a default brush is created in versioning_defaults). This resets all brushes with an invalid value to 1.0. Reviewed By: jbakker Maniphest Tasks: T75347 Differential Revision: https://developer.blender.org/D7698 --- source/blender/blenloader/intern/versioning_280.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index ff3909f5e1a..df6d1ee3c46 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -5071,5 +5071,14 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) */ { /* Keep this block, even when empty. */ + + /* Reset the cloth mass to 1.0 in brushes with an invalid value. */ + for (Brush *br = bmain->brushes.first; br; br = br->id.next) { + if (br->sculpt_tool == SCULPT_TOOL_CLOTH) { + if (br->cloth_mass == 0.0f) { + br->cloth_mass = 1.0f; + } + } + } } } -- cgit v1.2.3