diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-11-13 18:21:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-11-13 18:21:55 +0400 |
commit | d94b2efbb96316a0b645fe8970c551b2d73e42dc (patch) | |
tree | 107f570f7783ebd2a10e49496e85173b3a8aa961 /source/blender/editors/object/object_modifier.c | |
parent | 054c6159de84e2c7adf55de6ab6e20c005b7cf63 (diff) |
disable applying constructive modifiers when in sculpt mode with multi-res data, since this would crash.
also rename modifier_sameTopology -> modifier_isSameTopology(), modifier_nonGeometrical -> modifier_isNonGeometrical()
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 3d2c4f95624..7d3d6861418 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -555,7 +555,7 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M Key *key = me->key; KeyBlock *kb; - if (!modifier_sameTopology(md) || mti->type == eModifierTypeType_NonGeometrical) { + if (!modifier_isSameTopology(md) || mti->type == eModifierTypeType_NonGeometrical) { BKE_report(reports, RPT_ERROR, "Only deforming modifiers can be applied to shapes"); return 0; } @@ -688,6 +688,13 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied to multi-user data"); return 0; } + else if ((ob->mode & OB_MODE_SCULPT) && + (find_multires_modifier_before(scene, md)) && + (modifier_isSameTopology(md) == FALSE)) + { + BKE_report(reports, RPT_ERROR, "Constructive modifier cannot be applied to multi-res data in sculpt mode"); + return 0; + } if (md != ob->modifiers.first) BKE_report(reports, RPT_INFO, "Applied modifier was not first, result may not be as expected"); @@ -1000,7 +1007,7 @@ static int modifier_apply_exec(bContext *C, wmOperator *op) Object *ob = ED_object_active_context(C); ModifierData *md = edit_modifier_property_get(op, ob, 0); int apply_as = RNA_enum_get(op->ptr, "apply_as"); - + if (!ob || !md || !ED_object_modifier_apply(op->reports, scene, ob, md, apply_as)) { return OPERATOR_CANCELLED; } |