Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_surfacedeform.c
| Show First 20 Lines • Show All 1,391 Lines • ▼ Show 20 Lines | static bool isDisabled(const Scene *UNUSED(scene), ModifierData *md, bool UNUSED(useRenderParams)) | ||||
| * object assigned (because the library containing the mesh is missing). | * object assigned (because the library containing the mesh is missing). | ||||
| * | * | ||||
| * In other cases it should be impossible to have a type mismatch. | * In other cases it should be impossible to have a type mismatch. | ||||
| */ | */ | ||||
| return (smd->target == NULL || smd->target->type != OB_MESH) && | return (smd->target == NULL || smd->target->type != OB_MESH) && | ||||
| !(smd->verts != NULL && !(smd->flags & MOD_SDEF_BIND)); | !(smd->verts != NULL && !(smd->flags & MOD_SDEF_BIND)); | ||||
| } | } | ||||
| static void panel_draw(const bContext *C, Panel *panel) | static void panel_draw(const bContext *UNUSED(C), Panel *panel) | ||||
| { | { | ||||
| uiLayout *col; | uiLayout *col; | ||||
| 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); | ||||
| PointerRNA target_ptr = RNA_pointer_get(&ptr, "target"); | PointerRNA target_ptr = RNA_pointer_get(ptr, "target"); | ||||
| bool is_bound = RNA_boolean_get(&ptr, "is_bound"); | bool is_bound = RNA_boolean_get(ptr, "is_bound"); | ||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| col = uiLayoutColumn(layout, false); | col = uiLayoutColumn(layout, false); | ||||
| uiLayoutSetActive(col, !is_bound); | uiLayoutSetActive(col, !is_bound); | ||||
| uiItemR(col, &ptr, "target", 0, NULL, ICON_NONE); | uiItemR(col, ptr, "target", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, &ptr, "falloff", 0, NULL, ICON_NONE); | uiItemR(col, ptr, "falloff", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, &ptr, "strength", 0, NULL, ICON_NONE); | uiItemR(col, ptr, "strength", 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); | ||||
| uiItemS(layout); | uiItemS(layout); | ||||
| col = uiLayoutColumn(layout, false); | col = uiLayoutColumn(layout, false); | ||||
| if (is_bound) { | if (is_bound) { | ||||
| uiItemO(col, IFACE_("Unbind"), ICON_NONE, "OBJECT_OT_surfacedeform_bind"); | uiItemO(col, IFACE_("Unbind"), ICON_NONE, "OBJECT_OT_surfacedeform_bind"); | ||||
| } | } | ||||
| else { | else { | ||||
| uiLayoutSetActive(col, !RNA_pointer_is_null(&target_ptr)); | uiLayoutSetActive(col, !RNA_pointer_is_null(&target_ptr)); | ||||
| uiItemO(col, IFACE_("Bind"), ICON_NONE, "OBJECT_OT_surfacedeform_bind"); | uiItemO(col, IFACE_("Bind"), ICON_NONE, "OBJECT_OT_surfacedeform_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_SurfaceDeform, panel_draw); | modifier_panel_register(region_type, eModifierType_SurfaceDeform, panel_draw); | ||||
| } | } | ||||
| static void blendWrite(BlendWriter *writer, const ModifierData *md) | static void blendWrite(BlendWriter *writer, const ModifierData *md) | ||||
| ▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines | |||||