[Bf-blender-cvs] [fa1c214c5b2] master: Fix crash in Solidify modifier with Inner Crease

Sergey Sharybin noreply at git.blender.org
Mon Sep 26 11:55:39 CEST 2022


Commit: fa1c214c5b2147f0127e6abf6aa844530fd4b9a2
Author: Sergey Sharybin
Date:   Mon Sep 26 11:51:04 2022 +0200
Branches: master
https://developer.blender.org/rBfa1c214c5b2147f0127e6abf6aa844530fd4b9a2

Fix crash in Solidify modifier with Inner Crease

Since a8a454287a27 the simple case would crash:

- Add place
- Add Solidify modifier
- Set Inner Crease to something non-zero

Seems to be a mistake in the logic which was trying to access
existing custom data layer on a clean result while it is more
logical to create the layer.

Was initially reported by the studio who could not open
production files after the change.

===================================================================

M	source/blender/modifiers/intern/MOD_solidify_extrude.c

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_solidify_extrude.c b/source/blender/modifiers/intern/MOD_solidify_extrude.c
index f1758b91a91..a662d729f52 100644
--- a/source/blender/modifiers/intern/MOD_solidify_extrude.c
+++ b/source/blender/modifiers/intern/MOD_solidify_extrude.c
@@ -1034,7 +1034,8 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, const ModifierEvalContex
 
     float *result_edge_crease = NULL;
     if (crease_rim || crease_outer || crease_inner) {
-      result_edge_crease = (float *)CustomData_get_layer(&result->edata, CD_CREASE);
+      result_edge_crease = (float *)CustomData_add_layer(
+          &result->edata, CD_CREASE, CD_SET_DEFAULT, NULL, result->totedge);
     }
 
     /* add faces & edges */



More information about the Bf-blender-cvs mailing list