[Bf-blender-cvs] [05dd9ca06cc] blender-v2.83-release: Fix T75347: Update cloth brushes in versioning with a valid mass value
Pablo Dobarro
noreply at git.blender.org
Wed May 13 02:56:04 CEST 2020
Commit: 05dd9ca06cc13d0847dbd6115b26df9484019c1e
Author: Pablo Dobarro
Date: Tue May 12 03:10:22 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB05dd9ca06cc13d0847dbd6115b26df9484019c1e
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
===================================================================
M source/blender/blenloader/intern/versioning_280.c
===================================================================
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;
+ }
+ }
+ }
}
}
More information about the Bf-blender-cvs
mailing list