Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpencilmultiply.c
| Show First 20 Lines • Show All 309 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) | ||||
| { | { | ||||
| MultiplyGpencilModifierData *mmd = (MultiplyGpencilModifierData *)md; | MultiplyGpencilModifierData *mmd = (MultiplyGpencilModifierData *)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); | |||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiItemR(layout, &ptr, "duplicates", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "duplicates", 0, NULL, ICON_NONE); | ||||
| col = uiLayoutColumn(layout, false); | col = uiLayoutColumn(layout, false); | ||||
| uiLayoutSetActive(layout, RNA_int_get(&ptr, "duplicates") > 0); | uiLayoutSetActive(layout, RNA_int_get(ptr, "duplicates") > 0); | ||||
| uiItemR(col, &ptr, "distance", 0, NULL, ICON_NONE); | uiItemR(col, ptr, "distance", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, &ptr, "offset", UI_ITEM_R_SLIDER, NULL, ICON_NONE); | uiItemR(col, ptr, "offset", UI_ITEM_R_SLIDER, NULL, ICON_NONE); | ||||
| gpencil_modifier_panel_end(layout, &ptr); | gpencil_modifier_panel_end(layout, ptr); | ||||
| } | } | ||||
| static void fade_header_draw(const bContext *C, Panel *panel) | static void fade_header_draw(const bContext *UNUSED(C), Panel *panel) | ||||
| { | { | ||||
| 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); | |||||
| uiItemR(layout, &ptr, "use_fade", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "use_fade", 0, NULL, ICON_NONE); | ||||
| } | } | ||||
| static void fade_panel_draw(const bContext *C, Panel *panel) | static void fade_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); | |||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiLayoutSetActive(layout, RNA_boolean_get(&ptr, "use_fade")); | uiLayoutSetActive(layout, RNA_boolean_get(ptr, "use_fade")); | ||||
| col = uiLayoutColumn(layout, false); | col = uiLayoutColumn(layout, false); | ||||
| uiItemR(col, &ptr, "fading_center", 0, NULL, ICON_NONE); | uiItemR(col, ptr, "fading_center", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, &ptr, "fading_thickness", UI_ITEM_R_SLIDER, NULL, ICON_NONE); | uiItemR(col, ptr, "fading_thickness", UI_ITEM_R_SLIDER, NULL, ICON_NONE); | ||||
| uiItemR(col, &ptr, "fading_opacity", UI_ITEM_R_SLIDER, NULL, ICON_NONE); | uiItemR(col, ptr, "fading_opacity", UI_ITEM_R_SLIDER, NULL, ICON_NONE); | ||||
| } | } | ||||
| 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, false); | gpencil_modifier_masking_panel_draw(panel, true, false); | ||||
| } | } | ||||
| 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_Multiply, panel_draw); | region_type, eGpencilModifierType_Multiply, panel_draw); | ||||
| gpencil_modifier_subpanel_register( | gpencil_modifier_subpanel_register( | ||||
| region_type, "fade", "", fade_header_draw, fade_panel_draw, panel_type); | region_type, "fade", "", fade_header_draw, fade_panel_draw, panel_type); | ||||
| Show All 28 Lines | |||||