Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpenciltexture.c
| Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | |||||
| static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData) | static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData) | ||||
| { | { | ||||
| TextureGpencilModifierData *mmd = (TextureGpencilModifierData *)md; | TextureGpencilModifierData *mmd = (TextureGpencilModifierData *)md; | ||||
| walk(userData, ob, (ID **)&mmd->material, IDWALK_CB_USER); | walk(userData, ob, (ID **)&mmd->material, IDWALK_CB_USER); | ||||
| } | } | ||||
| 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 *ptr = gpencil_modifier_panel_get_property_pointers(panel, NULL); | ||||
| gpencil_modifier_panel_get_property_pointers(C, panel, NULL, &ptr); | |||||
| int mode = RNA_enum_get(&ptr, "mode"); | int mode = RNA_enum_get(ptr, "mode"); | ||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiItemR(layout, &ptr, "mode", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "mode", 0, NULL, ICON_NONE); | ||||
| if (ELEM(mode, STROKE, STROKE_AND_FILL)) { | if (ELEM(mode, STROKE, STROKE_AND_FILL)) { | ||||
| col = uiLayoutColumn(layout, false); | col = uiLayoutColumn(layout, false); | ||||
| uiItemR(col, &ptr, "fit_method", 0, IFACE_("Stroke Fit Method"), ICON_NONE); | uiItemR(col, ptr, "fit_method", 0, IFACE_("Stroke Fit Method"), ICON_NONE); | ||||
| uiItemR(col, &ptr, "uv_offset", 0, NULL, ICON_NONE); | uiItemR(col, ptr, "uv_offset", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, &ptr, "uv_scale", 0, IFACE_("Scale"), ICON_NONE); | uiItemR(col, ptr, "uv_scale", 0, IFACE_("Scale"), ICON_NONE); | ||||
| } | } | ||||
| if (mode == STROKE_AND_FILL) { | if (mode == STROKE_AND_FILL) { | ||||
| uiItemS(layout); | uiItemS(layout); | ||||
| } | } | ||||
| if (ELEM(mode, FILL, STROKE_AND_FILL)) { | if (ELEM(mode, FILL, STROKE_AND_FILL)) { | ||||
| col = uiLayoutColumn(layout, false); | col = uiLayoutColumn(layout, false); | ||||
| uiItemR(col, &ptr, "fill_rotation", 0, NULL, ICON_NONE); | uiItemR(col, ptr, "fill_rotation", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, &ptr, "fill_offset", 0, IFACE_("Offset"), ICON_NONE); | uiItemR(col, ptr, "fill_offset", 0, IFACE_("Offset"), ICON_NONE); | ||||
| uiItemR(col, &ptr, "fill_scale", 0, IFACE_("Scale"), ICON_NONE); | uiItemR(col, ptr, "fill_scale", 0, IFACE_("Scale"), ICON_NONE); | ||||
| } | } | ||||
| gpencil_modifier_panel_end(layout, &ptr); | gpencil_modifier_panel_end(layout, ptr); | ||||
| } | } | ||||
| static void mask_panel_draw(const bContext *C, Panel *panel) | static void mask_panel_draw(const bContext *UNUSED(C), Panel *panel) | ||||
| { | { | ||||
| gpencil_modifier_masking_panel_draw(C, panel, true, true); | gpencil_modifier_masking_panel_draw(panel, true, true); | ||||
| } | } | ||||
| static void panelRegister(ARegionType *region_type) | static void panelRegister(ARegionType *region_type) | ||||
| { | { | ||||
| PanelType *panel_type = gpencil_modifier_panel_register( | PanelType *panel_type = gpencil_modifier_panel_register( | ||||
| region_type, eGpencilModifierType_Texture, panel_draw); | region_type, eGpencilModifierType_Texture, panel_draw); | ||||
| gpencil_modifier_subpanel_register( | gpencil_modifier_subpanel_register( | ||||
| region_type, "mask", "Influence", NULL, mask_panel_draw, panel_type); | region_type, "mask", "Influence", NULL, mask_panel_draw, panel_type); | ||||
| Show All 26 Lines | |||||