diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_smooth.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_smooth.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c index 7ac6690e3a7..21313746ce3 100644 --- a/source/blender/modifiers/intern/MOD_smooth.c +++ b/source/blender/modifiers/intern/MOD_smooth.c @@ -27,16 +27,27 @@ #include "BLI_math.h" +#include "BLT_translation.h" + #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" +#include "DNA_screen_types.h" +#include "BKE_context.h" #include "BKE_deform.h" #include "BKE_editmesh.h" #include "BKE_lib_id.h" #include "BKE_mesh.h" #include "BKE_particle.h" +#include "BKE_screen.h" + +#include "UI_interface.h" +#include "UI_resources.h" + +#include "RNA_access.h" #include "MOD_modifiertypes.h" +#include "MOD_ui_common.h" #include "MOD_util.h" static void initData(ModifierData *md) @@ -226,6 +237,37 @@ static void deformVertsEM(ModifierData *md, } } +static void panel_draw(const bContext *C, Panel *panel) +{ + uiLayout *row, *col; + uiLayout *layout = panel->layout; + int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE; + + PointerRNA ptr; + PointerRNA ob_ptr; + modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + + uiLayoutSetPropSep(layout, true); + + row = uiLayoutRowWithHeading(layout, true, IFACE_("Axis")); + uiItemR(row, &ptr, "use_x", toggles_flag, NULL, ICON_NONE); + uiItemR(row, &ptr, "use_y", toggles_flag, NULL, ICON_NONE); + uiItemR(row, &ptr, "use_z", toggles_flag, NULL, ICON_NONE); + + col = uiLayoutColumn(layout, false); + uiItemR(col, &ptr, "factor", 0, NULL, ICON_NONE); + uiItemR(col, &ptr, "iterations", 0, NULL, ICON_NONE); + + modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); + + modifier_panel_end(layout, &ptr); +} + +static void panelRegister(ARegionType *region_type) +{ + modifier_panel_register(region_type, eModifierType_Smooth, panel_draw); +} + ModifierTypeInfo modifierType_Smooth = { /* name */ "Smooth", /* structName */ "SmoothModifierData", @@ -256,4 +298,5 @@ ModifierTypeInfo modifierType_Smooth = { /* foreachIDLink */ NULL, /* foreachTexLink */ NULL, /* freeRuntimeData */ NULL, + /* panelRegister */ panelRegister, }; |