Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_brush.c
| Show First 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | static EnumPropertyItem rna_enum_gpencil_brush_eraser_modes_items[] = { | ||||
| 0, | 0, | ||||
| "Dissolve", | "Dissolve", | ||||
| "Erase strokes, fading their points strength and thickness"}, | "Erase strokes, fading their points strength and thickness"}, | ||||
| {GP_BRUSH_ERASER_HARD, "HARD", 0, "Point", "Erase stroke points"}, | {GP_BRUSH_ERASER_HARD, "HARD", 0, "Point", "Erase stroke points"}, | ||||
| {GP_BRUSH_ERASER_STROKE, "STROKE", 0, "Stroke", "Erase entire strokes"}, | {GP_BRUSH_ERASER_STROKE, "STROKE", 0, "Stroke", "Erase entire strokes"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static EnumPropertyItem rna_enum_gpencil_fill_draw_modes_items[] = { | static EnumPropertyItem rna_enum_gpencil_fill_draw_modes_items[] = { | ||||
HooglyBoogly: This enum can be defined directly in the function that uses it, like `gppaint_mode_types_items` | |||||
| {GP_FILL_DMODE_BOTH, | {GP_FILL_DMODE_BOTH, | ||||
Done Inline ActionsI'd suggest "Round" instead of "Rounded" here, it's just a bit simpler, and more similar to "Flat" HooglyBoogly: I'd suggest "Round" instead of "Rounded" here, it's just a bit simpler, and more similar to… | |||||
| "BOTH", | "BOTH", | ||||
| 0, | 0, | ||||
| "All", | "All", | ||||
| "Use both visible strokes and edit lines as fill boundary limits"}, | "Use both visible strokes and edit lines as fill boundary limits"}, | ||||
| {GP_FILL_DMODE_STROKE, "STROKE", 0, "Strokes", "Use visible strokes as fill boundary limits"}, | {GP_FILL_DMODE_STROKE, "STROKE", 0, "Strokes", "Use visible strokes as fill boundary limits"}, | ||||
| {GP_FILL_DMODE_CONTROL, "CONTROL", 0, "Edit Lines", "Use edit lines as fill boundary limits"}, | {GP_FILL_DMODE_CONTROL, "CONTROL", 0, "Edit Lines", "Use edit lines as fill boundary limits"}, | ||||
| {0, NULL, 0, NULL, NULL}}; | {0, NULL, 0, NULL, NULL}}; | ||||
| ▲ Show 20 Lines • Show All 994 Lines • ▼ Show 20 Lines | static void rna_def_gpencil_options(BlenderRNA *brna) | ||||
| /* modes */ | /* modes */ | ||||
| static EnumPropertyItem gppaint_mode_types_items[] = { | static EnumPropertyItem gppaint_mode_types_items[] = { | ||||
| {GPPAINT_MODE_STROKE, "STROKE", 0, "Stroke", "Vertex Color affects to Stroke only"}, | {GPPAINT_MODE_STROKE, "STROKE", 0, "Stroke", "Vertex Color affects to Stroke only"}, | ||||
| {GPPAINT_MODE_FILL, "FILL", 0, "Fill", "Vertex Color affects to Fill only"}, | {GPPAINT_MODE_FILL, "FILL", 0, "Fill", "Vertex Color affects to Fill only"}, | ||||
| {GPPAINT_MODE_BOTH, "BOTH", 0, "Stroke and Fill", "Vertex Color affects to Stroke and Fill"}, | {GPPAINT_MODE_BOTH, "BOTH", 0, "Stroke and Fill", "Vertex Color affects to Stroke and Fill"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static EnumPropertyItem rna_enum_gpencil_brush_caps_types_items[] = { | |||||
| {GP_STROKE_CAP_ROUND, "ROUND", ICON_HANDLETYPE_AUTO_CLAMP_VEC, "Round", ""}, | |||||
| {GP_STROKE_CAP_FLAT, "FLAT", ICON_HANDLETYPE_VECTOR_VEC, "Flat", ""}, | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| srna = RNA_def_struct(brna, "BrushGpencilSettings", NULL); | srna = RNA_def_struct(brna, "BrushGpencilSettings", NULL); | ||||
| RNA_def_struct_sdna(srna, "BrushGpencilSettings"); | RNA_def_struct_sdna(srna, "BrushGpencilSettings"); | ||||
| RNA_def_struct_path_func(srna, "rna_BrushGpencilSettings_path"); | RNA_def_struct_path_func(srna, "rna_BrushGpencilSettings_path"); | ||||
| RNA_def_struct_ui_text(srna, "Grease Pencil Brush Settings", "Settings for grease pencil brush"); | RNA_def_struct_ui_text(srna, "Grease Pencil Brush Settings", "Settings for grease pencil brush"); | ||||
| /* Strength factor for new strokes */ | /* Strength factor for new strokes */ | ||||
| prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_sdna(prop, NULL, "draw_strength"); | RNA_def_property_float_sdna(prop, NULL, "draw_strength"); | ||||
| ▲ Show 20 Lines • Show All 453 Lines • ▼ Show 20 Lines | static void rna_def_gpencil_options(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "eraser_mode", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "eraser_mode", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "eraser_mode"); | 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_enum_items(prop, rna_enum_gpencil_brush_eraser_modes_items); | ||||
| RNA_def_property_ui_text(prop, "Mode", "Eraser Mode"); | RNA_def_property_ui_text(prop, "Mode", "Eraser Mode"); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| RNA_def_property_update( | RNA_def_property_update( | ||||
| prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_eraser_mode_update"); | prop, NC_GPENCIL | ND_DATA, "rna_BrushGpencilSettings_eraser_mode_update"); | ||||
| prop = RNA_def_property(srna, "caps_type", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "caps_type"); | |||||
| RNA_def_property_enum_items(prop, rna_enum_gpencil_brush_caps_types_items); | |||||
| RNA_def_property_ui_text(prop, "Caps Type", "The shape of the start and end of the stroke"); | |||||
Done Inline ActionsIn most cases only the first letter of the UI description should be capitalized. Additionally, the description is not useful here. We have to take care to imagine the perspective of someone who hadn't seen this before. HooglyBoogly: In most cases only the first letter of the UI description should be capitalized.
Additionally… | |||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | |||||
Done Inline ActionsThis property is missing RNA_def_property_update HooglyBoogly: This property is missing `RNA_def_property_update` | |||||
Done Inline ActionsDon't need update...it's only for new strokes antoniov: Don't need update...it's only for new strokes | |||||
| prop = RNA_def_property(srna, "fill_draw_mode", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "fill_draw_mode", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "fill_draw_mode"); | 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_enum_items(prop, rna_enum_gpencil_fill_draw_modes_items); | ||||
| RNA_def_property_ui_text(prop, "Mode", "Mode to draw boundary limits"); | RNA_def_property_ui_text(prop, "Mode", "Mode to draw boundary limits"); | ||||
| RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); | ||||
| prop = RNA_def_property(srna, "fill_layer_mode", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "fill_layer_mode", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "fill_layer_mode"); | RNA_def_property_enum_sdna(prop, NULL, "fill_layer_mode"); | ||||
| ▲ Show 20 Lines • Show All 1,811 Lines • Show Last 20 Lines | |||||
This enum can be defined directly in the function that uses it, like gppaint_mode_types_items