Todo item #19816: Wave modifier does not affect Curve Paths

Added new option for applyong modifiers on splines' points. This moves
tesselation point and path would be affected by modifiers which are applied on
splines' points.
This commit is contained in:
Sergey Sharybin 2011-01-14 16:57:53 +00:00
parent 9d8d25cc34
commit 439140d6ae
4 changed files with 35 additions and 1 deletions

@ -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;
}
}

@ -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 ........................... */

@ -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;

@ -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);