Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_correctivesmooth.c
| Show First 20 Lines • Show All 777 Lines • ▼ Show 20 Lines | static void deformVertsEM(ModifierData *md, | ||||
| correctivesmooth_modifier_do( | correctivesmooth_modifier_do( | ||||
| md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (uint)numVerts, editData); | md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, (uint)numVerts, editData); | ||||
| if (!ELEM(mesh_src, NULL, mesh)) { | if (!ELEM(mesh_src, NULL, mesh)) { | ||||
| BKE_id_free(NULL, mesh_src); | BKE_id_free(NULL, mesh_src); | ||||
| } | } | ||||
| } | } | ||||
| static void panel_draw(const bContext *C, Panel *panel) | static void panel_draw(const bContext *UNUSED(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); | ||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiItemR(layout, &ptr, "factor", 0, IFACE_("Factor"), ICON_NONE); | uiItemR(layout, ptr, "factor", 0, IFACE_("Factor"), ICON_NONE); | ||||
| uiItemR(layout, &ptr, "iterations", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "iterations", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "scale", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "scale", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "smooth_type", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "smooth_type", 0, NULL, ICON_NONE); | ||||
| modifier_vgroup_ui(layout, &ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); | modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); | ||||
| uiItemR(layout, &ptr, "use_only_smooth", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "use_only_smooth", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "use_pin_boundary", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "use_pin_boundary", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "rest_source", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "rest_source", 0, NULL, ICON_NONE); | ||||
| if (RNA_enum_get(&ptr, "rest_source") == MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND) { | if (RNA_enum_get(ptr, "rest_source") == MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND) { | ||||
| uiItemO(layout, | uiItemO(layout, | ||||
| (RNA_boolean_get(&ptr, "is_bind") ? IFACE_("Unbind") : IFACE_("Bind")), | (RNA_boolean_get(ptr, "is_bind") ? IFACE_("Unbind") : IFACE_("Bind")), | ||||
| ICON_NONE, | ICON_NONE, | ||||
| "OBJECT_OT_correctivesmooth_bind"); | "OBJECT_OT_correctivesmooth_bind"); | ||||
| } | } | ||||
| modifier_panel_end(layout, &ptr); | modifier_panel_end(layout, ptr); | ||||
| } | } | ||||
| static void panelRegister(ARegionType *region_type) | static void panelRegister(ARegionType *region_type) | ||||
| { | { | ||||
| modifier_panel_register(region_type, eModifierType_CorrectiveSmooth, panel_draw); | modifier_panel_register(region_type, eModifierType_CorrectiveSmooth, panel_draw); | ||||
| } | } | ||||
| static void blendWrite(BlendWriter *writer, const ModifierData *md) | static void blendWrite(BlendWriter *writer, const ModifierData *md) | ||||
| ▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines | |||||