diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_laplaciansmooth.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_laplaciansmooth.c | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.c b/source/blender/modifiers/intern/MOD_laplaciansmooth.c index 643afc5b5fc..130c280c5f2 100644 --- a/source/blender/modifiers/intern/MOD_laplaciansmooth.c +++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.c @@ -25,18 +25,29 @@ #include "BLI_math.h" +#include "BLT_translation.h" + #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" +#include "DNA_screen_types.h" #include "MEM_guardedalloc.h" +#include "BKE_context.h" #include "BKE_deform.h" #include "BKE_editmesh.h" #include "BKE_lib_id.h" #include "BKE_mesh.h" #include "BKE_modifier.h" +#include "BKE_screen.h" + +#include "UI_interface.h" +#include "UI_resources.h" + +#include "RNA_access.h" +#include "MOD_ui_common.h" #include "MOD_util.h" #include "eigen_capi.h" @@ -572,8 +583,43 @@ static void deformVertsEM(ModifierData *md, } } +static void panel_draw(const bContext *C, Panel *panel) +{ + uiLayout *row; + 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); + + uiItemR(layout, &ptr, "iterations", 0, NULL, ICON_NONE); + + 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); + + uiItemR(layout, &ptr, "lambda_factor", 0, NULL, ICON_NONE); + uiItemR(layout, &ptr, "lambda_border", 0, NULL, ICON_NONE); + + uiItemR(layout, &ptr, "use_volume_preserve", 0, NULL, ICON_NONE); + uiItemR(layout, &ptr, "use_normalized", 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_LaplacianSmooth, panel_draw); +} + ModifierTypeInfo modifierType_LaplacianSmooth = { - /* name */ "Laplacian Smooth", + /* name */ "LaplacianSmooth", /* structName */ "LaplacianSmoothModifierData", /* structSize */ sizeof(LaplacianSmoothModifierData), /* type */ eModifierTypeType_OnlyDeform, @@ -601,4 +647,5 @@ ModifierTypeInfo modifierType_LaplacianSmooth = { /* foreachIDLink */ NULL, /* foreachTexLink */ NULL, /* freeRuntimeData */ NULL, + /* panelRegister */ panelRegister, }; |