Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c
| Show First 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| TintGpencilModifierData *mmd = (TintGpencilModifierData *)md; | TintGpencilModifierData *mmd = (TintGpencilModifierData *)md; | ||||
| walk(userData, ob, (ID **)&mmd->material, IDWALK_CB_USER); | walk(userData, ob, (ID **)&mmd->material, IDWALK_CB_USER); | ||||
| foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData); | foreachObjectLink(md, ob, (ObjectWalkFunc)walk, userData); | ||||
| } | } | ||||
| 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 tint_type = RNA_enum_get(&ptr, "tint_type"); | int tint_type = RNA_enum_get(ptr, "tint_type"); | ||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiItemR(layout, &ptr, "vertex_mode", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "vertex_mode", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "factor", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "factor", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "tint_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | uiItemR(layout, ptr, "tint_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE); | ||||
| if (tint_type == GP_TINT_UNIFORM) { | if (tint_type == GP_TINT_UNIFORM) { | ||||
| uiItemR(layout, &ptr, "color", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "color", 0, NULL, ICON_NONE); | ||||
| } | } | ||||
| else { | else { | ||||
| col = uiLayoutColumn(layout, false); | col = uiLayoutColumn(layout, false); | ||||
| uiLayoutSetPropSep(col, false); | uiLayoutSetPropSep(col, false); | ||||
| uiTemplateColorRamp(col, &ptr, "colors", true); | uiTemplateColorRamp(col, ptr, "colors", true); | ||||
| uiItemS(layout); | uiItemS(layout); | ||||
| uiItemR(layout, &ptr, "object", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "object", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "radius", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "radius", 0, NULL, 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_Tint, panel_draw); | region_type, eGpencilModifierType_Tint, panel_draw); | ||||
| PanelType *mask_panel_type = gpencil_modifier_subpanel_register( | PanelType *mask_panel_type = 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 32 Lines | |||||