Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_brush.c
| Context not available. | |||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_workspace_types.h" | #include "DNA_workspace_types.h" | ||||
| #include "DNA_gpencil_types.h" | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| Context not available. | |||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| static EnumPropertyItem rna_enum_gpencil_brush_types_items[] = { | |||||
| { GP_BRUSH_TYPE_DRAW, "DRAW", ICON_GREASEPENCIL_STROKE_PAINT, "Draw", "The brush is of type used for drawing strokes" }, | |||||
| { GP_BRUSH_TYPE_FILL, "FILL", ICON_COLOR, "Fill", "The brush is of type used for filling areas" }, | |||||
| { GP_BRUSH_TYPE_ERASE, "ERASE", ICON_PANEL_CLOSE, "Erase", "The brush is used for erasing strokes" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[] = { | |||||
| { GP_BRUSH_ERASER_SOFT, "SOFT", 0, "Soft", "Use soft eraser" }, | |||||
| { GP_BRUSH_ERASER_HARD, "HARD", 0, "Hard", "Use hard eraser" }, | |||||
| { GP_BRUSH_ERASER_STROKE, "STROKE", 0, "Stroke", "Use stroke eraser" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| static EnumPropertyItem rna_enum_gpencil_fill_draw_modes_items[] = { | |||||
| { GP_FILL_DMODE_STROKE, "STROKE", 0, "Strokes", "Use visible strokes as fill boundary limits" }, | |||||
| { GP_FILL_DMODE_CONTROL, "CONTROL", 0, "Control", "Use internal control lines as fill boundary limits" }, | |||||
| { GP_FILL_DMODE_BOTH, "BOTH", 0, "Both", "Use visible strokes and control lines as fill boundary limits" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| static EnumPropertyItem rna_enum_gpencil_brush_icons_items[] = { | |||||
| { GPBRUSH_CUSTOM, "CUSTOM", ICON_GPBRUSH_CUSTOM, "Custom", "" }, | |||||
| { GPBRUSH_PENCIL, "PENCIL", ICON_GPBRUSH_PENCIL, "Pencil", "" }, | |||||
| { GPBRUSH_PEN, "PEN", ICON_GPBRUSH_PEN, "Pen", "" }, | |||||
| { GPBRUSH_INK, "INK", ICON_GPBRUSH_INK, "Ink", "" }, | |||||
| { GPBRUSH_INKNOISE, "INKNOISE", ICON_GPBRUSH_INKNOISE, "Ink Noise", "" }, | |||||
| { GPBRUSH_BLOCK, "BLOCK", ICON_GPBRUSH_BLOCK, "Block", "" }, | |||||
| { GPBRUSH_MARKER, "MARKER", ICON_GPBRUSH_MARKER, "Marker", "" }, | |||||
| { GPBRUSH_FILL, "FILL", ICON_GPBRUSH_FILL, "Fill", "" }, | |||||
| { GPBRUSH_ERASE_SOFT, "SOFT", ICON_GPBRUSH_ERASE_SOFT, "Eraser Soft", "" }, | |||||
| { GPBRUSH_ERASE_HARD, "HARD", ICON_GPBRUSH_ERASE_HARD, "Eraser Hard", "" }, | |||||
| { GPBRUSH_ERASE_STROKE, "STROKE", ICON_GPBRUSH_ERASE_STROKE, "Eraser Stroke", "" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| Context not available. | |||||
| return brush_stroke_method_items; | return brush_stroke_method_items; | ||||
| } | } | ||||
| } | } | ||||
| /* Grease pencil Drawing Brushes */ | |||||
| static void rna_brush_gpencil_default_eraser(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) | |||||
| { | |||||
| ToolSettings *ts = scene->toolsettings; | |||||
| Paint *paint = &ts->gp_paint->paint; | |||||
| Brush *brush_cur = paint->brush; | |||||
| /* disable default eraser in all brushes */ | |||||
| for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { | |||||
| if ((brush != brush_cur) && | |||||
| (brush->ob_mode == OB_MODE_GPENCIL_PAINT) && | |||||
| (brush->gp_brush_type == GP_BRUSH_TYPE_ERASE)) | |||||
| { | |||||
| brush->gp_flag &= ~GP_BRUSH_DEFAULT_ERASER; | |||||
| } | |||||
| } | |||||
| } | |||||
| static void rna_brush_gpencil_eraser_mode(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) | |||||
| { | |||||
| ToolSettings *ts = scene->toolsettings; | |||||
| Paint *paint = &ts->gp_paint->paint; | |||||
| Brush *brush = paint->brush; | |||||
| /* set eraser icon */ | |||||
| if ((brush) && (brush->gp_brush_type == GP_BRUSH_TYPE_ERASE)) { | |||||
| switch (brush->gp_eraser_mode) { | |||||
| case GP_BRUSH_ERASER_SOFT: | |||||
| brush->gp_icon_id = GPBRUSH_ERASE_SOFT; | |||||
| break; | |||||
| case GP_BRUSH_ERASER_HARD: | |||||
| brush->gp_icon_id = GPBRUSH_ERASE_HARD; | |||||
| break; | |||||
| case GP_BRUSH_ERASER_STROKE: | |||||
| brush->gp_icon_id = GPBRUSH_ERASE_STROKE; | |||||
| break; | |||||
| default: | |||||
| brush->gp_icon_id = GPBRUSH_ERASE_SOFT; | |||||
| break; | |||||
| } | |||||
| } | |||||
| } | |||||
| static void rna_BrushPalette_colorname_reset(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | |||||
| { | |||||
| /* reset colorname */ | |||||
| Brush *brush = ptr->data; | |||||
| Palette *palette = brush->palette; | |||||
| PaletteColor *palcolor = BKE_palette_color_getbyname(palette, brush->colorname); | |||||
| if (palcolor == NULL) { | |||||
| brush->colorname[0] = '\0'; | |||||
| } | |||||
| } | |||||
| /* check the current color is valid */ | |||||
| static int rna_Brush_color_valid(PointerRNA *ptr) | |||||
| { | |||||
| Brush *brush = ptr->data; | |||||
| Palette *palette = brush->palette; | |||||
| PaletteColor *palcolor = BKE_palette_color_getbyname(palette, brush->colorname); | |||||
| if (palcolor) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| #else | #else | ||||
| static void rna_def_brush_texture_slot(BlenderRNA *brna) | static void rna_def_brush_texture_slot(BlenderRNA *brna) | ||||
campbellbarton: This can be moved into RNA sub-struct. (like userprefs does) | |||||
| Context not available. | |||||
| RNA_def_property_struct_type(prop, "ImapaintToolCapabilities"); | RNA_def_property_struct_type(prop, "ImapaintToolCapabilities"); | ||||
| RNA_def_property_pointer_funcs(prop, "rna_Imapaint_tool_capabilities_get", NULL, NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_Imapaint_tool_capabilities_get", NULL, NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Image Painting Capabilities", "Brush's capabilities in image paint mode"); | RNA_def_property_ui_text(prop, "Image Painting Capabilities", "Brush's capabilities in image paint mode"); | ||||
| /* grease pencil drawing brushes */ | |||||
| /* Line Thickness */ | |||||
| prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_PIXEL); | |||||
| RNA_def_property_int_sdna(prop, NULL, "thickness"); | |||||
| RNA_def_property_range(prop, 1, 1000); | |||||
| RNA_def_property_ui_range(prop, 1, 500, 1, 0); | |||||
| RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Sensitivity factor for new strokes */ | |||||
| prop = RNA_def_property(srna, "pen_sensitivity_factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "draw_sensitivity"); | |||||
| RNA_def_property_range(prop, 0.1f, 3.0f); | |||||
| RNA_def_property_ui_text(prop, "Sensitivity", "Pressure sensitivity factor for new strokes"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Strength factor for new strokes */ | |||||
| prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "draw_strength"); | |||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Strength", "Color strength for new strokes (affect alpha factor of color)"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Jitter factor for new strokes */ | |||||
| prop = RNA_def_property(srna, "pen_jitter", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "draw_jitter"); | |||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Jitter", "Jitter factor for new strokes"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Randomnes factor for pressure */ | |||||
| prop = RNA_def_property(srna, "random_pressure", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "draw_random_press"); | |||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Pressure Randomness", "Randomness factor for pressure in new strokes"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Randomnes factor for strength */ | |||||
| prop = RNA_def_property(srna, "random_strength", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "draw_random_strength"); | |||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Strength Randomness", "Randomness factor strength in new strokes"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Randomnes factor for subdivision */ | |||||
| prop = RNA_def_property(srna, "random_subdiv", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "draw_random_sub"); | |||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Random Subdivision", "Randomness factor for new strokes after subdivision"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Angle when brush is full size */ | |||||
| prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "draw_angle"); | |||||
| RNA_def_property_range(prop, -M_PI_2, M_PI_2); | |||||
| RNA_def_property_ui_text(prop, "Angle", | |||||
| "Direction of the stroke at which brush gives maximal thickness " | |||||
| "(0° for horizontal)"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Factor to change brush size depending of angle */ | |||||
| prop = RNA_def_property(srna, "angle_factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "draw_angle_factor"); | |||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Angle Factor", | |||||
| "Reduce brush thickness by this factor when stroke is perpendicular to 'Angle' direction"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Smoothing factor for new strokes */ | |||||
| prop = RNA_def_property(srna, "pen_smooth_factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "draw_smoothfac"); | |||||
| RNA_def_property_range(prop, 0.0, 2.0f); | |||||
| RNA_def_property_ui_text(prop, "Smooth", | |||||
| "Amount of smoothing to apply after finish newly created strokes, to reduce jitter/noise"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Iterations of the Smoothing factor */ | |||||
| prop = RNA_def_property(srna, "pen_smooth_steps", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "draw_smoothlvl"); | |||||
| RNA_def_property_range(prop, 1, 3); | |||||
| RNA_def_property_ui_text(prop, "Iterations", | |||||
| "Number of times to smooth newly created strokes"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Thickness smoothing factor for new strokes */ | |||||
| prop = RNA_def_property(srna, "pen_thick_smooth_factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "gp_thick_smoothfac"); | |||||
| RNA_def_property_range(prop, 0.0, 2.0f); | |||||
| RNA_def_property_ui_text(prop, "Smooth Thickness", | |||||
| "Amount of thickness smoothing to apply after finish newly created strokes, to reduce jitter/noise"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Thickness iterations of the Smoothing factor */ | |||||
| prop = RNA_def_property(srna, "pen_thick_smooth_steps", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "gp_thick_smoothlvl"); | |||||
| RNA_def_property_range(prop, 1, 3); | |||||
| RNA_def_property_ui_text(prop, "Iterations Thickness", | |||||
| "Number of times to smooth thickness for newly created strokes"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Subdivision level for new strokes */ | |||||
| prop = RNA_def_property(srna, "pen_subdivision_steps", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "draw_subdivide"); | |||||
| RNA_def_property_range(prop, 0, 3); | |||||
| RNA_def_property_ui_text(prop, "Subdivision Steps", | |||||
| "Number of times to subdivide newly created strokes, for less jagged strokes"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* Curves for pressure */ | |||||
| prop = RNA_def_property(srna, "curve_sensitivity", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_pointer_sdna(prop, NULL, "cur_sensitivity"); | |||||
| RNA_def_property_struct_type(prop, "CurveMapping"); | |||||
| RNA_def_property_ui_text(prop, "Curve Sensitivity", "Curve used for the sensitivity"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "curve_strength", PROP_POINTER, PROP_NONE); | |||||
Not Done Inline Actionslvl -> level campbellbarton: lvl -> level | |||||
| RNA_def_property_pointer_sdna(prop, NULL, "cur_strength"); | |||||
| RNA_def_property_struct_type(prop, "CurveMapping"); | |||||
| RNA_def_property_ui_text(prop, "Curve Strength", "Curve used for the strength"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "curve_jitter", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_pointer_sdna(prop, NULL, "cur_jitter"); | |||||
Not Done Inline Actionsname stabilize for RNA names (DNA could stay). campbellbarton: name `stabilize` for RNA names (DNA could stay). | |||||
| RNA_def_property_struct_type(prop, "CurveMapping"); | |||||
| RNA_def_property_ui_text(prop, "Curve Jitter", "Curve used for the jitter effect"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* fill threshold for transparence */ | |||||
| prop = RNA_def_property(srna, "gpencil_fill_threshold", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "gp_fill_threshold"); | |||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Threshold", | |||||
| "Threshold to consider color transparent for filling"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* fill leak size */ | |||||
| prop = RNA_def_property(srna, "gpencil_fill_leak", PROP_INT, PROP_PIXEL); | |||||
| RNA_def_property_int_sdna(prop, NULL, "gp_fill_leak"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text(prop, "Leak Size", | |||||
| "Size in pixels to consider the leak closed"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* fill simplify steps */ | |||||
| prop = RNA_def_property(srna, "gpencil_fill_simplyfy_lvl", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "gp_fill_simplylvl"); | |||||
| RNA_def_property_range(prop, 0, 10); | |||||
| RNA_def_property_ui_text(prop, "Simplify", | |||||
| "Number of simplify steps (large values reduce fill accuracy)"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "lazy_radius", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "gp_lazy_radius"); | |||||
| RNA_def_property_range(prop, 1, 200); | |||||
| RNA_def_property_ui_text(prop, "Distance", "Minimum distance from last point before stroke continues"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "lazy_factor", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_sdna(prop, NULL, "gp_lazy_factor"); | |||||
| RNA_def_property_range(prop, 0.5, 0.99); | |||||
| RNA_def_property_ui_text(prop, "Factor", "Higher values give a smoother stroke"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "uv_random", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_sdna(prop, NULL, "gp_uv_random"); | |||||
| RNA_def_property_range(prop, 0.0, 1.0); | |||||
| RNA_def_property_ui_text(prop, "UV Random", "Random factor for autogenerated UV rotation"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "gp_input_samples"); | |||||
| RNA_def_property_range(prop, 0, GP_MAX_INPUT_SAMPLES); | |||||
| RNA_def_property_ui_text(prop, "Input Samples", "Generate intermediate points for very fast mouse movements. Set to 0 to disable"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* active smooth factor while drawing */ | |||||
| prop = RNA_def_property(srna, "active_smooth_factor", PROP_FLOAT, PROP_NONE); | |||||
| RNA_def_property_float_sdna(prop, NULL, "gp_active_smooth"); | |||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | |||||
| RNA_def_property_ui_text(prop, "Active Smooth", | |||||
| "Amount of smoothing while drawing "); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* brush standard icon */ | |||||
| prop = RNA_def_property(srna, "gp_icon", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "gp_icon_id"); | |||||
| RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_icons_items); | |||||
| RNA_def_property_ui_text(prop, "Grease Pencil Icon", ""); | |||||
| /* Flags */ | |||||
| prop = RNA_def_property(srna, "use_pressure", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", GP_BRUSH_USE_PRESSURE); | |||||
| RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); | |||||
| RNA_def_property_ui_text(prop, "Use Pressure", "Use tablet pressure"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "use_strength_pressure", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", GP_BRUSH_USE_STENGTH_PRESSURE); | |||||
| RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); | |||||
| RNA_def_property_ui_text(prop, "Use Pressure Strength", "Use tablet pressure for color strength"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "use_jitter_pressure", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", GP_BRUSH_USE_JITTER_PRESSURE); | |||||
| RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); | |||||
| RNA_def_property_ui_text(prop, "Use Pressure Jitter", "Use tablet pressure for jitter"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "use_stabilizer", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", GP_BRUSH_STABILIZE_MOUSE); | |||||
| RNA_def_property_boolean_default(prop, true); | |||||
| RNA_def_property_ui_text(prop, "Stabilizer", | |||||
| "Draw lines with a delay to allow smooth strokes. Press Shift key to override while drawing"); | |||||
| prop = RNA_def_property(srna, "use_cursor", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", GP_BRUSH_ENABLE_CURSOR); | |||||
| RNA_def_property_boolean_default(prop, true); | |||||
| RNA_def_property_ui_text(prop, "Enable Cursor", "Enable cursor on screen"); | |||||
| prop = RNA_def_property(srna, "gpencil_brush_type", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "gp_brush_type"); | |||||
| RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_types_items); | |||||
| RNA_def_property_ui_text(prop, "Type", "Category of the brush"); | |||||
| prop = RNA_def_property(srna, "eraser_mode", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "gp_eraser_mode"); | |||||
| RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_eraser_modes_items); | |||||
| RNA_def_property_ui_text(prop, "Mode", "Eraser Mode"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_brush_gpencil_eraser_mode"); | |||||
| prop = RNA_def_property(srna, "gpencil_fill_draw_mode", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "gp_fill_draw_mode"); | |||||
| RNA_def_property_enum_items(prop, rna_enum_gpencil_fill_draw_modes_items); | |||||
| RNA_def_property_ui_text(prop, "Mode", "Mode to draw boundary limits"); | |||||
| /* Palette */ | |||||
| prop = RNA_def_property(srna, "palette", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_struct_type(prop, "Palette"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); | |||||
| RNA_def_property_ui_text(prop, "Palette", "Palette used when enable this brush"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushPalette_colorname_reset"); | |||||
| /* Color Name */ | |||||
| prop = RNA_def_property(srna, "colorname", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_sdna(prop, NULL, "colorname"); | |||||
| RNA_def_property_ui_text(prop, "Color", "Name of the color used when enable this brush"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "is_color_valid", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_funcs(prop, "rna_Brush_color_valid", NULL); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_ui_text(prop, "Color valid", "Flag to check if color name exist in current palette"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_SELECTED, NULL); | |||||
| prop = RNA_def_property(srna, "gpencil_fill_show_boundary", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", GP_BRUSH_FILL_SHOW_HELPLINES); | |||||
| RNA_def_property_boolean_default(prop, true); | |||||
| RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries"); | |||||
| prop = RNA_def_property(srna, "gpencil_fill_hide", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", GP_BRUSH_FILL_HIDE); | |||||
| RNA_def_property_boolean_default(prop, true); | |||||
| RNA_def_property_ui_text(prop, "Hide", "Hide transparent lines to use as boundary for filling"); | |||||
| prop = RNA_def_property(srna, "default_eraser", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", GP_BRUSH_DEFAULT_ERASER); | |||||
| RNA_def_property_boolean_default(prop, true); | |||||
| RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); | |||||
| RNA_def_property_ui_text(prop, "Default Eraser", "Use this brush when enable eraser with fast switch key"); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_brush_gpencil_default_eraser"); | |||||
| prop = RNA_def_property(srna, "enable_settings", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", GP_BRUSH_GROUP_SETTINGS); | |||||
| RNA_def_property_ui_text(prop, "Settings", "Enable additional post processing options for new strokes"); | |||||
| prop = RNA_def_property(srna, "enable_random", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", GP_BRUSH_GROUP_RANDOM); | |||||
| RNA_def_property_ui_text(prop, "Random Settings", "Enable random settings for brush"); | |||||
| } | } | ||||
| Context not available. | |||||
This can be moved into RNA sub-struct. (like userprefs does)