diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-08 12:17:34 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-08 12:17:34 +0400 |
commit | 87211a49ab1c249d5c885706ba9130ed3bd0e0b4 (patch) | |
tree | 1e7d2da418d98749206f64b44d2c0c1a4c35e68e /source/blender/modifiers | |
parent | 54297c8d133d2e144685c1820d7fbd2e01c8fe51 (diff) |
Fix #31743: Applying Smooth modifier to a curve crashes Blender
Actually there were two different issues involved here:
- Recently enabled Smooth modifier wasn't actually designed for curves, so
it in fact requires a bit bigger work to make it working.
For now added check for object's typy in this modifier and if it's not
mesh, it wouldn't try to use edges.
The reason why it worked in 3d viewport is that creating DM from curve while
displist is still ocntrcuting for would result in empty CDDM and that leads to
not taking edges into account, only vertexCos passed to modifier would be used.
This makes it behaving a bit differently from if it was a mesh, but still gives
quite reasonable result. Would leave actual fix for a guy who enabled smooth
modifier.
- Another issue is related on ensuring sculpt mask layer after applying modifier.
This shall happen only for meshes.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_smooth.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c index 1313f5aa3ef..7b230d7365d 100644 --- a/source/blender/modifiers/intern/MOD_smooth.c +++ b/source/blender/modifiers/intern/MOD_smooth.c @@ -118,8 +118,14 @@ static void smoothModifier_do( fac = smd->fac; facm = 1 - fac; - medges = dm->getEdgeArray(dm); - numDMEdges = dm->getNumEdges(dm); + if (ob->type == OB_MESH) { + medges = dm->getEdgeArray(dm); + numDMEdges = dm->getNumEdges(dm); + } + else { + medges = NULL; + numDMEdges = 0; + } modifier_get_vgroup(ob, dm, smd->defgrp_name, &dvert, &defgrp_index); |