diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weightvgmix.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgmix.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c index a71b1d9d0e8..e089720b3e3 100644 --- a/source/blender/modifiers/intern/MOD_weightvgmix.c +++ b/source/blender/modifiers/intern/MOD_weightvgmix.c @@ -26,23 +26,34 @@ #include "BLI_listbase.h" #include "BLI_math.h" +#include "BLT_translation.h" + #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" +#include "DNA_screen_types.h" +#include "BKE_context.h" #include "BKE_customdata.h" #include "BKE_deform.h" #include "BKE_lib_query.h" #include "BKE_modifier.h" +#include "BKE_screen.h" #include "BKE_texture.h" /* Texture masking. */ +#include "UI_interface.h" +#include "UI_resources.h" + +#include "RNA_access.h" + #include "DEG_depsgraph_build.h" #include "DEG_depsgraph_query.h" #include "MEM_guardedalloc.h" #include "MOD_modifiertypes.h" +#include "MOD_ui_common.h" #include "MOD_util.h" #include "MOD_weightvg_util.h" @@ -449,6 +460,54 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return mesh; } +static void panel_draw(const bContext *C, Panel *panel) +{ + uiLayout *layout = panel->layout; + + PointerRNA ptr; + PointerRNA ob_ptr; + modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + + uiLayoutSetPropSep(layout, true); + + modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group_a", "invert_vertex_group_a", NULL); + modifier_vgroup_ui( + layout, &ptr, &ob_ptr, "vertex_group_b", "invert_vertex_group_b", IFACE_("B")); + + uiItemS(layout); + + uiItemR(layout, &ptr, "default_weight_a", 0, NULL, ICON_NONE); + uiItemR(layout, &ptr, "default_weight_b", 0, IFACE_("B"), ICON_NONE); + + uiItemS(layout); + + uiItemR(layout, &ptr, "mix_set", 0, NULL, ICON_NONE); + uiItemR(layout, &ptr, "mix_mode", 0, NULL, ICON_NONE); + + uiItemR(layout, &ptr, "normalize", 0, NULL, ICON_NONE); + + modifier_panel_end(layout, &ptr); +} + +static void influence_panel_draw(const bContext *C, Panel *panel) +{ + uiLayout *layout = panel->layout; + + PointerRNA ptr; + PointerRNA ob_ptr; + modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); + + weightvg_ui_common(C, &ob_ptr, &ptr, layout); +} + +static void panelRegister(ARegionType *region_type) +{ + PanelType *panel_type = modifier_panel_register( + region_type, eModifierType_WeightVGMix, panel_draw); + modifier_subpanel_register( + region_type, "influence", "Influence", NULL, influence_panel_draw, panel_type); +} + ModifierTypeInfo modifierType_WeightVGMix = { /* name */ "VertexWeightMix", /* structName */ "WeightVGMixModifierData", @@ -479,4 +538,5 @@ ModifierTypeInfo modifierType_WeightVGMix = { /* foreachIDLink */ foreachIDLink, /* foreachTexLink */ foreachTexLink, /* freeRuntimeData */ NULL, + /* panelRegister */ panelRegister, }; |