Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_brush.c
| Show First 20 Lines • Show All 1,586 Lines • ▼ Show 20 Lines | static const EnumPropertyItem brush_spacing_unit_items[] = { | ||||
| {BRUSH_SCENE_SPACING, | {BRUSH_SCENE_SPACING, | ||||
| "SCENE", | "SCENE", | ||||
| 0, | 0, | ||||
| "Scene", | "Scene", | ||||
| "Calculate brush spacing relative to the scene using the stroke location"}, | "Calculate brush spacing relative to the scene using the stroke location"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static const EnumPropertyItem brush_jitter_unit_items[] = { | |||||
| {BRUSH_ABSOLUTE_JITTER, "VIEW", 0, "View", "Jitterring happens in screen space, in pixels"}, | |||||
| {BRUSH_RELATIVE_JITTER, "BRUSH", 0, "Brush", "Jitterring happens relative to the brush size"}, | |||||
mont29: Please do not use "magic numbers" ever, always use proper enum value (or `#define` if really… | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| static const EnumPropertyItem falloff_shape_unit_items[] = { | |||||
| {PAINT_FALLOFF_SHAPE_SPHERE, "SPHERE", 0, "Sphere", "Apply brush influence in a Sphere, outwards from the center"}, | |||||
| {PAINT_FALLOFF_SHAPE_TUBE, "PROJECTED", 0, "Projected", "Apply brush influence in a 2D circle, projected from the view"}, | |||||
| {0, NULL, 0, NULL, NULL}, | |||||
| }; | |||||
| static const EnumPropertyItem brush_curve_preset_items[] = { | static const EnumPropertyItem brush_curve_preset_items[] = { | ||||
| {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""}, | {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""}, | ||||
| {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, | {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, | ||||
| {BRUSH_CURVE_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""}, | {BRUSH_CURVE_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""}, | ||||
| {BRUSH_CURVE_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""}, | {BRUSH_CURVE_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""}, | ||||
| {BRUSH_CURVE_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, | {BRUSH_CURVE_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, | ||||
| {BRUSH_CURVE_LIN, "LIN", ICON_LINCURVE, "Linear", ""}, | {BRUSH_CURVE_LIN, "LIN", ICON_LINCURVE, "Linear", ""}, | ||||
| {BRUSH_CURVE_POW4, "POW4", ICON_SHARPCURVE, "Sharper", ""}, | {BRUSH_CURVE_POW4, "POW4", ICON_SHARPCURVE, "Sharper", ""}, | ||||
| ▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | static void rna_def_brush(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Curve Preset", ""); | RNA_def_property_ui_text(prop, "Curve Preset", ""); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "elastic_deform_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "elastic_deform_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_items(prop, brush_elastic_deform_type_items); | RNA_def_property_enum_items(prop, brush_elastic_deform_type_items); | ||||
| RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush"); | RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "jitter_unit", PROP_ENUM, PROP_NONE); /* as an enum */ | |||||
| RNA_def_property_enum_bitflag_sdna(prop, NULL, "jitter_unit"); | |||||
| RNA_def_property_enum_items(prop, brush_jitter_unit_items); | |||||
| RNA_def_property_ui_text( | |||||
| prop, "Jitter Unit", "Jitter in screen space or relative to brush size"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| prop = RNA_def_property(srna, "falloff_shape", PROP_ENUM, PROP_NONE); /* as an enum */ | |||||
| RNA_def_property_enum_bitflag_sdna(prop, NULL, "falloff_shape"); | |||||
| RNA_def_property_enum_items(prop, falloff_shape_unit_items); | |||||
| RNA_def_property_ui_text( | |||||
| prop, "Falloff Shape", "Use projected or spherical falloff"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| /* number values */ | /* number values */ | ||||
| prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL); | prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL); | ||||
| RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL); | RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL); | ||||
| RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS * 10); | RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS * 10); | ||||
| RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, -1); | RNA_def_property_ui_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS, 1, -1); | ||||
| RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels"); | RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_size_update"); | RNA_def_property_update(prop, 0, "rna_Brush_size_update"); | ||||
| ▲ Show 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | static void rna_def_brush(BlenderRNA *brna) | ||||
| RNA_def_property_range(prop, 0, M_PI / 2); | RNA_def_property_range(prop, 0, M_PI / 2); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, | prop, | ||||
| "Falloff Angle", | "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. */ | |||||
| prop = RNA_def_property(srna, "use_projected", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "falloff_shape", PAINT_FALLOFF_SHAPE_TUBE); | |||||
| RNA_def_property_ui_text( | |||||
| prop, "2D Falloff", "Apply brush influence in 2D circle instead of a sphere"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)"); | prop, "Airbrush", "Keep applying paint effect while holding mouse (spray)"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_original_normal", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_NORMAL); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ORIGINAL_NORMAL); | ||||
| ▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | static void rna_def_brush(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_inverse_smooth_pressure", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_INVERSE_SMOOTH_PRESSURE); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_INVERSE_SMOOTH_PRESSURE); | ||||
| RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); | RNA_def_property_ui_icon(prop, ICON_STYLUS_PRESSURE, 0); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied"); | prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_relative_jitter", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_ABSOLUTE_JITTER); | |||||
| RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true); | |||||
| RNA_def_property_ui_text( | |||||
| prop, "Absolute Jitter", "Jittering happens in screen space, not relative to brush size"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| prop = RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PLANE_TRIM); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PLANE_TRIM); | ||||
| RNA_def_property_ui_text(prop, "Use Plane Trim", "Enable Plane Trim"); | RNA_def_property_ui_text(prop, "Use Plane Trim", "Enable Plane Trim"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_frontface", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FRONTFACE); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FRONTFACE); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| ▲ Show 20 Lines • Show All 378 Lines • Show Last 20 Lines | |||||
Please do not use "magic numbers" ever, always use proper enum value (or #define if really needed).