Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_weightvgedit.c
| Show First 20 Lines • Show All 312 Lines • ▼ Show 20 Lines | #endif | ||||
| MEM_freeN(dw); | MEM_freeN(dw); | ||||
| mesh->runtime.is_original = false; | mesh->runtime.is_original = false; | ||||
| /* Return the vgroup-modified mesh. */ | /* Return the vgroup-modified mesh. */ | ||||
| return mesh; | return mesh; | ||||
| } | } | ||||
| static void panel_draw(const bContext *C, Panel *panel) | static void panel_draw(const bContext *UNUSED(C), Panel *panel) | ||||
| { | { | ||||
| uiLayout *sub, *col, *row; | uiLayout *sub, *col, *row; | ||||
| uiLayout *layout = panel->layout; | uiLayout *layout = panel->layout; | ||||
| PointerRNA ptr; | |||||
| PointerRNA ob_ptr; | PointerRNA ob_ptr; | ||||
| modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); | PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); | ||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| col = uiLayoutColumn(layout, true); | col = uiLayoutColumn(layout, true); | ||||
| uiItemPointerR(col, &ptr, "vertex_group", &ob_ptr, "vertex_groups", NULL, ICON_NONE); | uiItemPointerR(col, ptr, "vertex_group", &ob_ptr, "vertex_groups", NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "default_weight", UI_ITEM_R_SLIDER, NULL, ICON_NONE); | uiItemR(layout, ptr, "default_weight", UI_ITEM_R_SLIDER, NULL, ICON_NONE); | ||||
| col = uiLayoutColumnWithHeading(layout, false, IFACE_("Group Add")); | col = uiLayoutColumnWithHeading(layout, false, IFACE_("Group Add")); | ||||
| row = uiLayoutRow(col, true); | row = uiLayoutRow(col, true); | ||||
| uiLayoutSetPropDecorate(row, false); | uiLayoutSetPropDecorate(row, false); | ||||
| sub = uiLayoutRow(row, true); | sub = uiLayoutRow(row, true); | ||||
| uiItemR(sub, &ptr, "use_add", 0, "", ICON_NONE); | uiItemR(sub, ptr, "use_add", 0, "", ICON_NONE); | ||||
| sub = uiLayoutRow(sub, true); | sub = uiLayoutRow(sub, true); | ||||
| uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_add")); | uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_add")); | ||||
| uiLayoutSetPropSep(sub, false); | uiLayoutSetPropSep(sub, false); | ||||
| uiItemR(sub, &ptr, "add_threshold", UI_ITEM_R_SLIDER, "Threshold", ICON_NONE); | uiItemR(sub, ptr, "add_threshold", UI_ITEM_R_SLIDER, "Threshold", ICON_NONE); | ||||
| uiItemDecoratorR(row, &ptr, "add_threshold", 0); | uiItemDecoratorR(row, ptr, "add_threshold", 0); | ||||
| col = uiLayoutColumnWithHeading(layout, false, IFACE_("Group Remove")); | col = uiLayoutColumnWithHeading(layout, false, IFACE_("Group Remove")); | ||||
| row = uiLayoutRow(col, true); | row = uiLayoutRow(col, true); | ||||
| uiLayoutSetPropDecorate(row, false); | uiLayoutSetPropDecorate(row, false); | ||||
| sub = uiLayoutRow(row, true); | sub = uiLayoutRow(row, true); | ||||
| uiItemR(sub, &ptr, "use_remove", 0, "", ICON_NONE); | uiItemR(sub, ptr, "use_remove", 0, "", ICON_NONE); | ||||
| sub = uiLayoutRow(sub, true); | sub = uiLayoutRow(sub, true); | ||||
| uiLayoutSetActive(sub, RNA_boolean_get(&ptr, "use_remove")); | uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_remove")); | ||||
| uiLayoutSetPropSep(sub, false); | uiLayoutSetPropSep(sub, false); | ||||
| uiItemR(sub, &ptr, "remove_threshold", UI_ITEM_R_SLIDER, "Threshold", ICON_NONE); | uiItemR(sub, ptr, "remove_threshold", UI_ITEM_R_SLIDER, "Threshold", ICON_NONE); | ||||
| uiItemDecoratorR(row, &ptr, "remove_threshold", 0); | uiItemDecoratorR(row, ptr, "remove_threshold", 0); | ||||
| uiItemR(layout, &ptr, "normalize", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "normalize", 0, NULL, ICON_NONE); | ||||
| modifier_panel_end(layout, &ptr); | modifier_panel_end(layout, ptr); | ||||
| } | } | ||||
| static void falloff_panel_draw(const bContext *C, Panel *panel) | static void falloff_panel_draw(const bContext *UNUSED(C), Panel *panel) | ||||
| { | { | ||||
| uiLayout *row, *sub; | uiLayout *row, *sub; | ||||
| uiLayout *layout = panel->layout; | uiLayout *layout = panel->layout; | ||||
| PointerRNA ptr; | |||||
| PointerRNA ob_ptr; | PointerRNA ob_ptr; | ||||
| modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); | PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); | ||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| row = uiLayoutRow(layout, true); | row = uiLayoutRow(layout, true); | ||||
| uiItemR(row, &ptr, "falloff_type", 0, IFACE_("Type"), ICON_NONE); | uiItemR(row, ptr, "falloff_type", 0, IFACE_("Type"), ICON_NONE); | ||||
| sub = uiLayoutRow(row, true); | sub = uiLayoutRow(row, true); | ||||
| uiLayoutSetPropSep(sub, false); | uiLayoutSetPropSep(sub, false); | ||||
| uiItemR(row, &ptr, "invert_falloff", 0, "", ICON_ARROW_LEFTRIGHT); | uiItemR(row, ptr, "invert_falloff", 0, "", ICON_ARROW_LEFTRIGHT); | ||||
| if (RNA_enum_get(&ptr, "falloff_type") == MOD_WVG_MAPPING_CURVE) { | if (RNA_enum_get(ptr, "falloff_type") == MOD_WVG_MAPPING_CURVE) { | ||||
| uiTemplateCurveMapping(layout, &ptr, "map_curve", 0, false, false, false, false); | uiTemplateCurveMapping(layout, ptr, "map_curve", 0, false, false, false, false); | ||||
| } | } | ||||
| } | } | ||||
| static void influence_panel_draw(const bContext *C, Panel *panel) | static void influence_panel_draw(const bContext *C, Panel *panel) | ||||
| { | { | ||||
| uiLayout *layout = panel->layout; | uiLayout *layout = panel->layout; | ||||
| PointerRNA ptr; | |||||
| PointerRNA ob_ptr; | PointerRNA ob_ptr; | ||||
| modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr); | PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr); | ||||
| weightvg_ui_common(C, &ob_ptr, &ptr, layout); | weightvg_ui_common(C, &ob_ptr, ptr, layout); | ||||
| } | } | ||||
| static void panelRegister(ARegionType *region_type) | static void panelRegister(ARegionType *region_type) | ||||
| { | { | ||||
| PanelType *panel_type = modifier_panel_register( | PanelType *panel_type = modifier_panel_register( | ||||
| region_type, eModifierType_WeightVGEdit, panel_draw); | region_type, eModifierType_WeightVGEdit, panel_draw); | ||||
| modifier_subpanel_register( | modifier_subpanel_register( | ||||
| region_type, "falloff", "Falloff", NULL, falloff_panel_draw, panel_type); | region_type, "falloff", "Falloff", NULL, falloff_panel_draw, panel_type); | ||||
| ▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines | |||||