Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
| Show First 20 Lines • Show All 274 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) | ||||
| { | { | ||||
| NoiseGpencilModifierData *mmd = (NoiseGpencilModifierData *)md; | NoiseGpencilModifierData *mmd = (NoiseGpencilModifierData *)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); | ||||
| col = uiLayoutColumn(layout, false); | col = uiLayoutColumn(layout, false); | ||||
| uiItemR(col, &ptr, "factor", 0, IFACE_("Position"), ICON_NONE); | uiItemR(col, ptr, "factor", 0, IFACE_("Position"), ICON_NONE); | ||||
| uiItemR(col, &ptr, "factor_strength", 0, IFACE_("Strength"), ICON_NONE); | uiItemR(col, ptr, "factor_strength", 0, IFACE_("Strength"), ICON_NONE); | ||||
| uiItemR(col, &ptr, "factor_thickness", 0, IFACE_("Thickness"), ICON_NONE); | uiItemR(col, ptr, "factor_thickness", 0, IFACE_("Thickness"), ICON_NONE); | ||||
| uiItemR(col, &ptr, "factor_uvs", 0, IFACE_("UV"), ICON_NONE); | uiItemR(col, ptr, "factor_uvs", 0, IFACE_("UV"), ICON_NONE); | ||||
| uiItemR(col, &ptr, "noise_scale", 0, NULL, ICON_NONE); | uiItemR(col, ptr, "noise_scale", 0, NULL, ICON_NONE); | ||||
| gpencil_modifier_panel_end(layout, &ptr); | gpencil_modifier_panel_end(layout, ptr); | ||||
| } | } | ||||
| static void random_header_draw(const bContext *C, Panel *panel) | static void random_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, "random", 0, IFACE_("Randomize"), ICON_NONE); | uiItemR(layout, ptr, "random", 0, IFACE_("Randomize"), ICON_NONE); | ||||
| } | } | ||||
| static void random_panel_draw(const bContext *C, Panel *panel) | static void random_panel_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); | |||||
| uiLayoutSetPropSep(layout, true); | uiLayoutSetPropSep(layout, true); | ||||
| uiLayoutSetActive(layout, RNA_boolean_get(&ptr, "random")); | uiLayoutSetActive(layout, RNA_boolean_get(ptr, "random")); | ||||
| uiItemR(layout, &ptr, "step", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "step", 0, NULL, ICON_NONE); | ||||
| uiItemR(layout, &ptr, "seed", 0, NULL, ICON_NONE); | uiItemR(layout, ptr, "seed", 0, 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, 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_Noise, panel_draw); | region_type, eGpencilModifierType_Noise, panel_draw); | ||||
| gpencil_modifier_subpanel_register( | gpencil_modifier_subpanel_register( | ||||
| region_type, "randomize", "", random_header_draw, random_panel_draw, panel_type); | region_type, "randomize", "", random_header_draw, random_panel_draw, panel_type); | ||||
| Show All 34 Lines | |||||