Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-06-08 12:17:34 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-06-08 12:17:34 +0400
commit87211a49ab1c249d5c885706ba9130ed3bd0e0b4 (patch)
tree1e7d2da418d98749206f64b44d2c0c1a4c35e68e /source
parent54297c8d133d2e144685c1820d7fbd2e01c8fe51 (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')
-rw-r--r--source/blender/editors/object/object_modifier.c6
-rw-r--r--source/blender/modifiers/intern/MOD_smooth.c10
2 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 7dd17e59f6f..d6b5fb9fc10 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -642,8 +642,10 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi
BLI_remlink(&ob->modifiers, md);
modifier_free(md);
- /* ensure mesh paint mask layer remains after applying */
- ED_sculpt_mask_layers_ensure(ob, NULL);
+ if (ob->type == OB_MESH) {
+ /* ensure mesh paint mask layer remains after applying */
+ ED_sculpt_mask_layers_ensure(ob, NULL);
+ }
return 1;
}
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);