diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 12 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 18 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 5 |
4 files changed, 35 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 424d15f6a7e..3bb62f817cd 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1220,10 +1220,20 @@ static ModifierData *curve_get_tesselate_point(Scene *scene, Object *ob, int for preTesselatePoint = NULL; for (; md; md=md->next) { + ModifierTypeInfo *mti = modifierType_getInfo(md->type); + if (!modifier_isEnabled(scene, md, required_mode)) continue; + if (mti->type == eModifierTypeType_Constructive) return preTesselatePoint; if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) { - preTesselatePoint = md; + preTesselatePoint = md; + + /* this modifiers are moving point of tesselation automatically + (some of them even can't be applied on tesselated curve), set flag + for incformation button in modifier's header */ + md->mode |= eModifierMode_ApplyOnSpline; + } else if(md->mode&eModifierMode_ApplyOnSpline) { + preTesselatePoint = md; } } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index e96740d6353..14d9773ef14 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -44,6 +44,7 @@ #include "BKE_material.h" #include "BKE_texture.h" #include "BKE_report.h" +#include "BKE_displist.h" #include "ED_screen.h" #include "ED_render.h" @@ -738,6 +739,23 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif uiButSetFlag(but, UI_BUT_DISABLED); uiButSetFunc(but, modifiers_setOnCage, ob, md); } + + /* tesselation point for curve-typed objects */ + if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { + ModifierTypeInfo *mti = modifierType_getInfo(md->type); + + /* some modifiers could work with pre-tesselated curves only */ + if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) { + /* add disabled pre-tesselated button, so users could have + message for this modifiers */ + but = uiDefIconButBitI(block, TOG, eModifierMode_ApplyOnSpline, 0, ICON_SURFACE_DATA, 0, 0, 16, 20, &md->mode, 0.0, 0.0, 0.0, 0.0, "This modifier could be applied on splines' points only"); + uiButSetFlag(but, UI_BUT_DISABLED); + } else if (mti->type != eModifierTypeType_Constructive) { + /* constructive modifiers tesselates curve before applying */ + uiItemR(row, &ptr, "use_apply_on_spline", 0, "", ICON_NULL); + } + } + uiBlockEndAlign(block); /* Up/Down + Delete ........................... */ diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 1c8610461be..914a980cd79 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -79,6 +79,7 @@ typedef enum ModifierMode { eModifierMode_OnCage = (1<<3), eModifierMode_Expanded = (1<<4), eModifierMode_Virtual = (1<<5), + eModifierMode_ApplyOnSpline = (1<<6), eModifierMode_DisableTemporary = (1 << 31) } ModifierMode; diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 11b0e8f995e..d94ce58b15f 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -2298,6 +2298,11 @@ void RNA_def_modifier(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface"); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); + prop= RNA_def_property(srna, "use_apply_on_spline", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_ApplyOnSpline); + RNA_def_property_ui_text(prop, "Apply on spline", "Apply this and all preceding deformation modifiers on splines' points rather than on filled curve/surface"); + RNA_def_property_ui_icon(prop, ICON_SURFACE_DATA, 0); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* types */ rna_def_modifier_subsurf(brna); |