Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_brush.c
| Show All 25 Lines | |||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <assert.h> | #include <assert.h> | ||||
| #include "DNA_brush_types.h" | #include "DNA_brush_types.h" | ||||
| #include "DNA_texture_types.h" | #include "DNA_texture_types.h" | ||||
| #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_gpencil_types.h" | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "rna_internal.h" | #include "rna_internal.h" | ||||
| ▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | const EnumPropertyItem rna_enum_brush_image_tool_items[] = { | ||||
| {PAINT_TOOL_SOFTEN, "SOFTEN", ICON_BRUSH_SOFTEN, "Soften", ""}, | {PAINT_TOOL_SOFTEN, "SOFTEN", ICON_BRUSH_SOFTEN, "Soften", ""}, | ||||
| {PAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SMEAR, "Smear", ""}, | {PAINT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SMEAR, "Smear", ""}, | ||||
| {PAINT_TOOL_CLONE, "CLONE", ICON_BRUSH_CLONE, "Clone", ""}, | {PAINT_TOOL_CLONE, "CLONE", ICON_BRUSH_CLONE, "Clone", ""}, | ||||
| {PAINT_TOOL_FILL, "FILL", ICON_BRUSH_TEXFILL, "Fill", ""}, | {PAINT_TOOL_FILL, "FILL", ICON_BRUSH_TEXFILL, "Fill", ""}, | ||||
| {PAINT_TOOL_MASK, "MASK", ICON_BRUSH_TEXMASK, "Mask", ""}, | {PAINT_TOOL_MASK, "MASK", ICON_BRUSH_TEXMASK, "Mask", ""}, | ||||
| {0, NULL, 0, NULL, NULL} | {0, NULL, 0, NULL, NULL} | ||||
| }; | }; | ||||
| #ifndef RNA_RUNTIME | |||||
| 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[] = { | |||||
| { GP_BRUSH_ICON_PENCIL, "PENCIL", ICON_GPBRUSH_PENCIL, "Pencil", "" }, | |||||
| { GP_BRUSH_ICON_PEN, "PEN", ICON_GPBRUSH_PEN, "Pen", "" }, | |||||
| { GP_BRUSH_ICON_INK, "INK", ICON_GPBRUSH_INK, "Ink", "" }, | |||||
| { GP_BRUSH_ICON_INKNOISE, "INKNOISE", ICON_GPBRUSH_INKNOISE, "Ink Noise", "" }, | |||||
| { GP_BRUSH_ICON_BLOCK, "BLOCK", ICON_GPBRUSH_BLOCK, "Block", "" }, | |||||
| { GP_BRUSH_ICON_MARKER, "MARKER", ICON_GPBRUSH_MARKER, "Marker", "" }, | |||||
| { GP_BRUSH_ICON_FILL, "FILL", ICON_GPBRUSH_FILL, "Fill", "" }, | |||||
| { GP_BRUSH_ICON_ERASE_SOFT, "SOFT", ICON_GPBRUSH_ERASE_SOFT, "Eraser Soft", "" }, | |||||
| { GP_BRUSH_ICON_ERASE_HARD, "HARD", ICON_GPBRUSH_ERASE_HARD, "Eraser Hard", "" }, | |||||
| { GP_BRUSH_ICON_ERASE_STROKE, "STROKE", ICON_GPBRUSH_ERASE_STROKE, "Eraser Stroke", "" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| #endif | |||||
| #ifdef RNA_RUNTIME | #ifdef RNA_RUNTIME | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "BKE_colorband.h" | #include "BKE_colorband.h" | ||||
| #include "BKE_brush.h" | #include "BKE_brush.h" | ||||
| ▲ Show 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | static void rna_Brush_icon_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) | ||||
| if (br->flag & BRUSH_CUSTOM_ICON) { | if (br->flag & BRUSH_CUSTOM_ICON) { | ||||
| BKE_icon_changed(BKE_icon_id_ensure(&br->id)); | BKE_icon_changed(BKE_icon_id_ensure(&br->id)); | ||||
| } | } | ||||
| WM_main_add_notifier(NC_BRUSH | NA_EDITED, br); | WM_main_add_notifier(NC_BRUSH | NA_EDITED, br); | ||||
| } | } | ||||
| static const EnumPropertyItem *rna_DynamicGpencil_type_itemf( | |||||
| bContext *C, PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) | |||||
| { | |||||
| Main *bmain = CTX_data_main(C); | |||||
| EnumPropertyItem *item = NULL, item_tmp = { 0 }; | |||||
| int totitem = 0; | |||||
| int i = 0; | |||||
| Brush *brush; | |||||
| for (brush = bmain->brush.first; brush; brush = brush->id.next, i++) { | |||||
| if (brush->gpencil_settings == NULL) | |||||
| continue; | |||||
| item_tmp.identifier = brush->id.name + 2; | |||||
| item_tmp.name = brush->id.name + 2; | |||||
| item_tmp.value = i; | |||||
| item_tmp.icon = brush->gpencil_settings->icon_id; | |||||
| RNA_enum_item_add(&item, &totitem, &item_tmp); | |||||
| } | |||||
| RNA_enum_item_end(&item, &totitem); | |||||
| *r_free = true; | |||||
| return item; | |||||
| } | |||||
| static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr) | static void rna_TextureSlot_brush_angle_update(bContext *C, PointerRNA *ptr) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| MTex *mtex = ptr->data; | MTex *mtex = ptr->data; | ||||
| /* skip invalidation of overlay for stencil mode */ | /* skip invalidation of overlay for stencil mode */ | ||||
| if (mtex->mapping != MTEX_MAP_MODE_STENCIL) { | if (mtex->mapping != MTEX_MAP_MODE_STENCIL) { | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex); | BKE_paint_invalidate_overlay_tex(scene, view_layer, mtex->tex); | ||||
| ▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | switch (mode) { | ||||
| case ePaintTexture2D: | case ePaintTexture2D: | ||||
| case ePaintTextureProjective: | case ePaintTextureProjective: | ||||
| return sculpt_stroke_method_items; | return sculpt_stroke_method_items; | ||||
| default: | default: | ||||
| return brush_stroke_method_items; | return brush_stroke_method_items; | ||||
| } | } | ||||
| } | } | ||||
| /* Grease Pencil Drawing Brushes Settings */ | |||||
| static void rna_BrushGpencilSettings_default_eraser_update(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->gpencil_settings->brush_type == GP_BRUSH_TYPE_ERASE)) | |||||
| { | |||||
| brush->gpencil_settings->flag &= ~GP_BRUSH_DEFAULT_ERASER; | |||||
| } | |||||
| } | |||||
| } | |||||
| static void rna_BrushGpencilSettings_eraser_mode_update(Main *UNUSED(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->gpencil_settings->brush_type == GP_BRUSH_TYPE_ERASE)) { | |||||
| switch (brush->gpencil_settings->eraser_mode) { | |||||
| case GP_BRUSH_ERASER_SOFT: | |||||
| brush->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_SOFT; | |||||
| break; | |||||
| case GP_BRUSH_ERASER_HARD: | |||||
| brush->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_HARD; | |||||
| break; | |||||
| case GP_BRUSH_ERASER_STROKE: | |||||
| brush->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_STROKE; | |||||
| break; | |||||
| default: | |||||
| brush->gpencil_settings->icon_id = GP_BRUSH_ICON_ERASE_SOFT; | |||||
| break; | |||||
| } | |||||
| } | |||||
| } | |||||
| static bool rna_BrushGpencilSettings_material_poll(PointerRNA *UNUSED(ptr), PointerRNA value) | |||||
| { | |||||
| Material *ma = (Material *)value.data; | |||||
| /* GP materials only */ | |||||
| return (ma->gp_style != NULL); | |||||
| } | |||||
| #else | #else | ||||
| static void rna_def_brush_texture_slot(BlenderRNA *brna) | static void rna_def_brush_texture_slot(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem prop_map_mode_items[] = { | static const EnumPropertyItem prop_map_mode_items[] = { | ||||
| ▲ Show 20 Lines • Show All 178 Lines • ▼ Show 20 Lines | #define IMAPAINT_TOOL_CAPABILITY(prop_name_, ui_name_) \ | ||||
| IMAPAINT_TOOL_CAPABILITY(has_accumulate, "Has Accumulate"); | IMAPAINT_TOOL_CAPABILITY(has_accumulate, "Has Accumulate"); | ||||
| IMAPAINT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation"); | IMAPAINT_TOOL_CAPABILITY(has_space_attenuation, "Has Space Attenuation"); | ||||
| IMAPAINT_TOOL_CAPABILITY(has_radius, "Has Radius"); | IMAPAINT_TOOL_CAPABILITY(has_radius, "Has Radius"); | ||||
| #undef IMAPAINT_TOOL_CAPABILITY | #undef IMAPAINT_TOOL_CAPABILITY | ||||
| } | } | ||||
| static void rna_def_gpencil_options(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| /* Grease Pencil Drawing - generated dynamically */ | |||||
| static const EnumPropertyItem prop_dynamic_gpencil_type[] = { | |||||
| { 1, "DRAW", 0, "Draw", "" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| srna = RNA_def_struct(brna, "BrushGpencilSettings", NULL); | |||||
| RNA_def_struct_sdna(srna, "BrushGpencilSettings"); | |||||
| RNA_def_struct_ui_text(srna, "Grease Pencil Brush Settings", "Settings for grease pencil brush"); | |||||
| /* grease pencil drawing brushes */ | |||||
| prop = RNA_def_property(srna, "grease_pencil_tool", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "brush_type"); | |||||
| RNA_def_property_enum_items(prop, prop_dynamic_gpencil_type); | |||||
| RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_DynamicGpencil_type_itemf"); | |||||
| RNA_def_property_ui_text(prop, "Grease Pencil Tool", ""); | |||||
| /* TODO: GPXX review update */ | |||||
| RNA_def_property_update(prop, 0, NULL); | |||||
| //RNA_def_property_update(prop, 0, "rna_Brush_gpencil_tool_update"); | |||||
| /* 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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "curve_sensitivity"); | |||||
| RNA_def_property_struct_type(prop, "CurveMapping"); | |||||
| RNA_def_property_ui_text(prop, "Curve Sensitivity", "Curve used for the sensitivity"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "curve_strength", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_pointer_sdna(prop, NULL, "curve_strength"); | |||||
| RNA_def_property_struct_type(prop, "CurveMapping"); | |||||
| RNA_def_property_ui_text(prop, "Curve Strength", "Curve used for the strength"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "curve_jitter"); | |||||
| RNA_def_property_struct_type(prop, "CurveMapping"); | |||||
| RNA_def_property_ui_text(prop, "Curve Jitter", "Curve used for the jitter effect"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| /* fill simplify steps */ | |||||
| prop = RNA_def_property(srna, "gpencil_fill_simplyfy_level", PROP_INT, PROP_NONE); | |||||
| RNA_def_property_int_sdna(prop, NULL, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "icon_id"); | |||||
| RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_icons_items); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| 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, "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"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| prop = RNA_def_property(srna, "use_cursor", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_ENABLE_CURSOR); | |||||
| RNA_def_property_boolean_default(prop, true); | |||||
| RNA_def_property_ui_text(prop, "Enable Cursor", "Enable cursor on screen"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| prop = RNA_def_property(srna, "gpencil_brush_type", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "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"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| prop = RNA_def_property(srna, "eraser_mode", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_eraser_mode_update"); | |||||
| prop = RNA_def_property(srna, "gpencil_fill_draw_mode", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "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"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| /* Material */ | |||||
| prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_struct_type(prop, "Material"); | |||||
| RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_BrushGpencilSettings_material_poll"); | |||||
| RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); | |||||
| RNA_def_property_ui_text(prop, "Material", "Material used for strokes drawn using this brush"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); | |||||
| prop = RNA_def_property(srna, "gpencil_fill_show_boundary", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "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"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| prop = RNA_def_property(srna, "gpencil_fill_hide", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "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"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| prop = RNA_def_property(srna, "default_eraser", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "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_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_default_eraser_update"); | |||||
| prop = RNA_def_property(srna, "enable_settings", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_GROUP_SETTINGS); | |||||
| RNA_def_property_ui_text(prop, "Settings", "Enable additional post processing options for new strokes"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| prop = RNA_def_property(srna, "enable_random", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_GROUP_RANDOM); | |||||
| RNA_def_property_ui_text(prop, "Random Settings", "Enable random settings for brush"); | |||||
| RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); | |||||
| } | |||||
| static void rna_def_brush(BlenderRNA *brna) | static void rna_def_brush(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| static const EnumPropertyItem prop_blend_items[] = { | static const EnumPropertyItem prop_blend_items[] = { | ||||
| {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while painting"}, | {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while painting"}, | ||||
| {IMB_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while painting"}, | {IMB_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while painting"}, | ||||
| ▲ Show 20 Lines • Show All 306 Lines • ▼ Show 20 Lines | static void rna_def_brush(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Kernel Radius", "Radius of kernel used for soften and sharpen in pixels"); | RNA_def_property_ui_text(prop, "Kernel Radius", "Radius of kernel used for soften and sharpen in pixels"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "blur_mode", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "blur_mode", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_items(prop, brush_blur_mode_items); | RNA_def_property_enum_items(prop, brush_blur_mode_items); | ||||
| RNA_def_property_ui_text(prop, "Blur Mode", ""); | RNA_def_property_ui_text(prop, "Blur Mode", ""); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "falloff_angle", PROP_FLOAT, PROP_ANGLE); | prop = RNA_def_property(srna, "falloff_angle", PROP_FLOAT, PROP_ANGLE); | ||||
campbellbarton: This can be moved into RNA sub-struct. (like userprefs does) | |||||
| RNA_def_property_float_sdna(prop, NULL, "falloff_angle"); | RNA_def_property_float_sdna(prop, NULL, "falloff_angle"); | ||||
| RNA_def_property_range(prop, 0, M_PI / 2); | RNA_def_property_range(prop, 0, M_PI / 2); | ||||
| RNA_def_property_ui_text(prop, "Falloff Angle", | RNA_def_property_ui_text(prop, "Falloff Angle", | ||||
| "Paint most on faces pointing towards the view according to this angle"); | "Paint most on faces pointing towards the view according to this angle"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| /* flag */ | /* flag */ | ||||
| /* This is an enum but its unlikely we add other shapes, so expose as a boolean. */ | /* This is an enum but its unlikely we add other shapes, so expose as a boolean. */ | ||||
| ▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | static void rna_def_brush(BlenderRNA *brna) | ||||
| /* adaptive space is not implemented yet */ | /* adaptive space is not implemented yet */ | ||||
| prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_adaptive_space", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ADAPTIVE_SPACE); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ADAPTIVE_SPACE); | ||||
| RNA_def_property_ui_text(prop, "Adaptive Spacing", | RNA_def_property_ui_text(prop, "Adaptive Spacing", | ||||
| "Space daubs according to surface orientation instead of screen space"); | "Space daubs according to surface orientation instead of screen space"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_locked_size", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LOCK_SIZE); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_LOCK_SIZE); | ||||
Not Done Inline Actionslvl -> level campbellbarton: lvl -> level | |||||
| RNA_def_property_ui_text(prop, "Use Blender Units", | RNA_def_property_ui_text(prop, "Use Blender Units", | ||||
| "When locked brush stays same size relative to object; when unlocked brush size is " | "When locked brush stays same size relative to object; when unlocked brush size is " | ||||
| "given in pixels"); | "given in pixels"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_edge_to_edge", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_EDGE_TO_EDGE); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_EDGE_TO_EDGE); | ||||
Not Done Inline Actionsname stabilize for RNA names (DNA could stay). campbellbarton: name `stabilize` for RNA names (DNA could stay). | |||||
| RNA_def_property_ui_text(prop, "Edge-to-edge", "Drag anchor brush from edge-to-edge"); | RNA_def_property_ui_text(prop, "Edge-to-edge", "Drag anchor brush from edge-to-edge"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_restore_mesh", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_DRAG_DOT); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_DRAG_DOT); | ||||
| RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned"); | RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| ▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | static void rna_def_brush(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_WEIGHT_PAINT); | RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_WEIGHT_PAINT); | ||||
| RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode"); | RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode"); | ||||
| prop = RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_paint_image", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_TEXTURE_PAINT); | RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_TEXTURE_PAINT); | ||||
| RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode"); | RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode"); | ||||
| prop = RNA_def_property(srna, "use_paint_grease_pencil", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_GPENCIL_PAINT); | |||||
| RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in grease pencil drawing mode"); | |||||
| /* texture */ | /* texture */ | ||||
| prop = RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_struct_type(prop, "BrushTextureSlot"); | RNA_def_property_struct_type(prop, "BrushTextureSlot"); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "mtex"); | RNA_def_property_pointer_sdna(prop, NULL, "mtex"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_ui_text(prop, "Texture Slot", ""); | RNA_def_property_ui_text(prop, "Texture Slot", ""); | ||||
| prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); | ||||
| ▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | static void rna_def_brush(BlenderRNA *brna) | ||||
| RNA_def_property_pointer_funcs(prop, "rna_Sculpt_tool_capabilities_get", NULL, NULL, NULL); | RNA_def_property_pointer_funcs(prop, "rna_Sculpt_tool_capabilities_get", NULL, NULL, NULL); | ||||
| RNA_def_property_ui_text(prop, "Sculpt Capabilities", "Brush's capabilities in sculpt mode"); | RNA_def_property_ui_text(prop, "Sculpt Capabilities", "Brush's capabilities in sculpt mode"); | ||||
| prop = RNA_def_property(srna, "image_paint_capabilities", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "image_paint_capabilities", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_flag(prop, PROP_NEVER_NULL); | RNA_def_property_flag(prop, PROP_NEVER_NULL); | ||||
| 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"); | ||||
| prop = RNA_def_property(srna, "gpencil_settings", PROP_POINTER, PROP_NONE); | |||||
| RNA_def_property_struct_type(prop, "BrushGpencilSettings"); | |||||
| RNA_def_property_pointer_sdna(prop, NULL, "gpencil_settings"); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_ui_text(prop, "Gpencil Settings", ""); | |||||
| } | } | ||||
| /* A brush stroke is a list of changes to the brush that | /* A brush stroke is a list of changes to the brush that | ||||
| * can occur during a stroke | * can occur during a stroke | ||||
| * | * | ||||
| * o 3D location of the brush | * o 3D location of the brush | ||||
| * o 2D mouse location | * o 2D mouse location | ||||
| ▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void RNA_def_brush(BlenderRNA *brna) | void RNA_def_brush(BlenderRNA *brna) | ||||
| { | { | ||||
| rna_def_brush(brna); | rna_def_brush(brna); | ||||
| rna_def_brush_capabilities(brna); | rna_def_brush_capabilities(brna); | ||||
| rna_def_sculpt_capabilities(brna); | rna_def_sculpt_capabilities(brna); | ||||
| rna_def_image_paint_capabilities(brna); | rna_def_image_paint_capabilities(brna); | ||||
| rna_def_gpencil_options(brna); | |||||
| rna_def_brush_texture_slot(brna); | rna_def_brush_texture_slot(brna); | ||||
| rna_def_operator_stroke_element(brna); | rna_def_operator_stroke_element(brna); | ||||
| } | } | ||||
| #endif | #endif | ||||
This can be moved into RNA sub-struct. (like userprefs does)