diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_modifier.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 12 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index 65038c7f09c..3275adf79fa 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -321,6 +321,7 @@ void modifier_unique_name(struct ListBase *modifiers, struct ModifierDa void modifier_copyData(struct ModifierData *md, struct ModifierData *target); bool modifier_dependsOnTime(struct ModifierData *md); bool modifier_supportsMapping(struct ModifierData *md); +bool modifier_supportsCage(struct Scene *scene, struct ModifierData *md); bool modifier_couldBeCage(struct Scene *scene, struct ModifierData *md); bool modifier_isCorrectableDeformed(struct ModifierData *md); bool modifier_isSameTopology(ModifierData *md); diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 4871b9bf3bf..9f82fa8c84f 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -263,6 +263,18 @@ void modifier_copyData(ModifierData *md, ModifierData *target) mti->copyData(md, target); } + +bool modifier_supportsCage(struct Scene *scene, ModifierData *md) +{ + ModifierTypeInfo *mti = modifierType_getInfo(md->type); + + md->scene = scene; + + return ((!mti->isDisabled || !mti->isDisabled(md, 0)) && + (mti->flags & eModifierTypeFlag_SupportsEditmode) && + modifier_supportsMapping(md)); +} + bool modifier_couldBeCage(struct Scene *scene, ModifierData *md) { ModifierTypeInfo *mti = modifierType_getInfo(md->type); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 5b208a3b0c2..ad3dd536032 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -908,7 +908,7 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, uiButSetFlag(but, UI_BUT_DISABLED); uiButSetFunc(but, modifiers_setOnCage, ob, md); } - else { + else if (modifier_supportsCage(scene, md)) { uiBlockEndAlign(block); /* place holder button */ |