Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_brush.c
| Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | static const EnumPropertyItem sculpt_stroke_method_items[] = { | ||||
| {BRUSH_CURVE, | {BRUSH_CURVE, | ||||
| "CURVE", | "CURVE", | ||||
| 0, | 0, | ||||
| "Curve", | "Curve", | ||||
| "Define the stroke curve with a bezier curve (dabs are separated according to spacing)"}, | "Define the stroke curve with a bezier curve (dabs are separated according to spacing)"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| /* clang-format off */ | |||||
| const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = { | const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = { | ||||
| {SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""}, | {SCULPT_TOOL_DRAW, "DRAW", ICON_BRUSH_SCULPT_DRAW, "Draw", ""}, | ||||
| {SCULPT_TOOL_DRAW_SHARP, "DRAW_SHARP", ICON_BRUSH_SCULPT_DRAW, "Draw Sharp", ""}, | {SCULPT_TOOL_DRAW_SHARP, "DRAW_SHARP", ICON_BRUSH_SCULPT_DRAW, "Draw Sharp", ""}, | ||||
| {SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""}, | {SCULPT_TOOL_CLAY, "CLAY", ICON_BRUSH_CLAY, "Clay", ""}, | ||||
| {SCULPT_TOOL_CLAY_STRIPS, "CLAY_STRIPS", ICON_BRUSH_CLAY_STRIPS, "Clay Strips", ""}, | {SCULPT_TOOL_CLAY_STRIPS, "CLAY_STRIPS", ICON_BRUSH_CLAY_STRIPS, "Clay Strips", ""}, | ||||
| {SCULPT_TOOL_LAYER, "LAYER", ICON_BRUSH_LAYER, "Layer", ""}, | {SCULPT_TOOL_LAYER, "LAYER", ICON_BRUSH_LAYER, "Layer", ""}, | ||||
| {SCULPT_TOOL_INFLATE, "INFLATE", ICON_BRUSH_INFLATE, "Inflate", ""}, | {SCULPT_TOOL_INFLATE, "INFLATE", ICON_BRUSH_INFLATE, "Inflate", ""}, | ||||
| {SCULPT_TOOL_BLOB, "BLOB", ICON_BRUSH_BLOB, "Blob", ""}, | {SCULPT_TOOL_BLOB, "BLOB", ICON_BRUSH_BLOB, "Blob", ""}, | ||||
| {SCULPT_TOOL_CREASE, "CREASE", ICON_BRUSH_CREASE, "Crease", ""}, | {SCULPT_TOOL_CREASE, "CREASE", ICON_BRUSH_CREASE, "Crease", ""}, | ||||
| {0, "", 0, NULL, NULL}, | {0, "", 0, NULL, NULL}, | ||||
| {SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_SMOOTH, "Smooth", ""}, | {SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_SMOOTH, "Smooth", ""}, | ||||
| {SCULPT_TOOL_FLATTEN, "FLATTEN", ICON_BRUSH_FLATTEN, "Flatten", ""}, | {SCULPT_TOOL_FLATTEN, "FLATTEN", ICON_BRUSH_FLATTEN, "Flatten", ""}, | ||||
| {SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""}, | {SCULPT_TOOL_FILL, "FILL", ICON_BRUSH_FILL, "Fill", ""}, | ||||
| {SCULPT_TOOL_SCRAPE, "SCRAPE", ICON_BRUSH_SCRAPE, "Scrape", ""}, | {SCULPT_TOOL_SCRAPE, "SCRAPE", ICON_BRUSH_SCRAPE, "Scrape", ""}, | ||||
| {SCULPT_TOOL_MULTIPLANE_SCRAPE, "MULTIPLANE_SCRAPE", ICON_BRUSH_SCRAPE, "Multiplane Scrape", ""}, | |||||
| {SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_PINCH, "Pinch", ""}, | {SCULPT_TOOL_PINCH, "PINCH", ICON_BRUSH_PINCH, "Pinch", ""}, | ||||
| {0, "", 0, NULL, NULL}, | {0, "", 0, NULL, NULL}, | ||||
| {SCULPT_TOOL_GRAB, "GRAB", ICON_BRUSH_GRAB, "Grab", ""}, | {SCULPT_TOOL_GRAB, "GRAB", ICON_BRUSH_GRAB, "Grab", ""}, | ||||
| {SCULPT_TOOL_ELASTIC_DEFORM, "ELASTIC_DEFORM", ICON_BRUSH_GRAB, "Elastic Deform", ""}, | {SCULPT_TOOL_ELASTIC_DEFORM, "ELASTIC_DEFORM", ICON_BRUSH_GRAB, "Elastic Deform", ""}, | ||||
| {SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_SNAKE_HOOK, "Snake Hook", ""}, | {SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_SNAKE_HOOK, "Snake Hook", ""}, | ||||
| {SCULPT_TOOL_THUMB, "THUMB", ICON_BRUSH_THUMB, "Thumb", ""}, | {SCULPT_TOOL_THUMB, "THUMB", ICON_BRUSH_THUMB, "Thumb", ""}, | ||||
| {SCULPT_TOOL_POSE, "POSE", ICON_BRUSH_GRAB, "Pose", ""}, | {SCULPT_TOOL_POSE, "POSE", ICON_BRUSH_GRAB, "Pose", ""}, | ||||
| {SCULPT_TOOL_NUDGE, "NUDGE", ICON_BRUSH_NUDGE, "Nudge", ""}, | {SCULPT_TOOL_NUDGE, "NUDGE", ICON_BRUSH_NUDGE, "Nudge", ""}, | ||||
| {SCULPT_TOOL_ROTATE, "ROTATE", ICON_BRUSH_ROTATE, "Rotate", ""}, | {SCULPT_TOOL_ROTATE, "ROTATE", ICON_BRUSH_ROTATE, "Rotate", ""}, | ||||
| {SCULPT_TOOL_TOPOLOGY, "TOPOLOGY", ICON_BRUSH_GRAB, "Topology", ""}, | |||||
| {0, "", 0, NULL, NULL}, | {0, "", 0, NULL, NULL}, | ||||
| {SCULPT_TOOL_SIMPLIFY, "SIMPLIFY", ICON_BRUSH_DATA, "Simplify", ""}, | {SCULPT_TOOL_SIMPLIFY, "SIMPLIFY", ICON_BRUSH_DATA, "Simplify", ""}, | ||||
| {SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_MASK, "Mask", ""}, | {SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_MASK, "Mask", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| /* clang-format on */ | |||||
| const EnumPropertyItem rna_enum_brush_uv_sculpt_tool_items[] = { | const EnumPropertyItem rna_enum_brush_uv_sculpt_tool_items[] = { | ||||
| {UV_SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", "Grab UVs"}, | {UV_SCULPT_TOOL_GRAB, "GRAB", 0, "Grab", "Grab UVs"}, | ||||
| {UV_SCULPT_TOOL_RELAX, "RELAX", 0, "Relax", "Relax UVs"}, | {UV_SCULPT_TOOL_RELAX, "RELAX", 0, "Relax", "Relax UVs"}, | ||||
| {UV_SCULPT_TOOL_PINCH, "PINCH", 0, "Pinch", "Pinch UVs"}, | {UV_SCULPT_TOOL_PINCH, "PINCH", 0, "Pinch", "Pinch UVs"}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 1,483 Lines • ▼ Show 20 Lines | static const EnumPropertyItem brush_spacing_unit_items[] = { | ||||
| "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_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_SMOOTHER, "SMOOTHER", ICON_SMOOTHCURVE, "Smoother", ""}, | |||||
| {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", ""}, | ||||
| {BRUSH_CURVE_INVSQUARE, "INVSQUARE", ICON_INVERSESQUARECURVE, "Inverse square", ""}, | {BRUSH_CURVE_INVSQUARE, "INVSQUARE", ICON_INVERSESQUARECURVE, "Inverse square", ""}, | ||||
| {BRUSH_CURVE_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""}, | {BRUSH_CURVE_CONSTANT, "CONSTANT", ICON_NOCURVE, "Constant", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| ▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | static void rna_def_brush(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_sdna(prop, NULL, "alpha"); | RNA_def_property_float_sdna(prop, NULL, "alpha"); | ||||
| RNA_def_property_range(prop, 0.0f, 10.0f); | RNA_def_property_range(prop, 0.0f, 10.0f); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3); | RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Strength", "How powerful the effect of the brush is when applied"); | prop, "Strength", "How powerful the effect of the brush is when applied"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "dash_ratio", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_sdna(prop, NULL, "dash_ratio"); | |||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | |||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3); | |||||
| RNA_def_property_ui_text( | |||||
| prop, "Dash Ratio", "Ratio of samples in a cycle that the brush is enabled"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| prop = RNA_def_property(srna, "dash_samples", PROP_INT, PROP_UNSIGNED); | |||||
| RNA_def_property_int_sdna(prop, NULL, "dash_samples"); | |||||
| RNA_def_property_range(prop, 1, 10000); | |||||
| RNA_def_property_ui_range(prop, 1, 10000, 5, -1); | |||||
| RNA_def_property_ui_text( | |||||
| prop, "Dash Length", "Length of a dash cycle measured in stroke samples"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| prop = RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE); | prop = RNA_def_property(srna, "plane_offset", PROP_FLOAT, PROP_DISTANCE); | ||||
| RNA_def_property_float_sdna(prop, NULL, "plane_offset"); | RNA_def_property_float_sdna(prop, NULL, "plane_offset"); | ||||
| RNA_def_property_float_default(prop, 0); | RNA_def_property_float_default(prop, 0); | ||||
| RNA_def_property_range(prop, -2.0f, 2.0f); | RNA_def_property_range(prop, -2.0f, 2.0f); | ||||
| RNA_def_property_ui_range(prop, -0.5f, 0.5f, 0.001, 3); | RNA_def_property_ui_range(prop, -0.5f, 0.5f, 0.001, 3); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, | prop, | ||||
| "Plane Offset", | "Plane Offset", | ||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | static void rna_def_brush(BlenderRNA *brna) | ||||
| prop = RNA_def_property(srna, "pose_offset", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "pose_offset", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_sdna(prop, NULL, "pose_offset"); | RNA_def_property_float_sdna(prop, NULL, "pose_offset"); | ||||
| RNA_def_property_range(prop, 0.0f, 2.0f); | RNA_def_property_range(prop, 0.0f, 2.0f); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Pose Origin Offset", "Offset of the pose origin in relation to the brush radius"); | prop, "Pose Origin Offset", "Offset of the pose origin in relation to the brush radius"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "multiplane_scrape_angle", PROP_FLOAT, PROP_FACTOR); | |||||
| RNA_def_property_float_sdna(prop, NULL, "multiplane_scrape_angle"); | |||||
| RNA_def_property_range(prop, 0.0f, 160.0f); | |||||
| RNA_def_property_ui_text(prop, "Plane Angle", "Angle between the planes of the crease"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| prop = RNA_def_property(srna, "pose_smooth_iterations", PROP_INT, PROP_UNSIGNED); | |||||
| RNA_def_property_int_sdna(prop, NULL, "pose_smooth_iterations"); | |||||
| RNA_def_property_range(prop, 0, 100); | |||||
| RNA_def_property_ui_text( | |||||
| prop, | |||||
| "Smooth Iterations", | |||||
| "Smooth iterations applied after calculating the pose factor of each vertex"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| prop = RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR); | prop = RNA_def_property(srna, "auto_smooth_factor", PROP_FLOAT, PROP_FACTOR); | ||||
| RNA_def_property_float_sdna(prop, NULL, "autosmooth_factor"); | RNA_def_property_float_sdna(prop, NULL, "autosmooth_factor"); | ||||
| RNA_def_property_float_default(prop, 0); | RNA_def_property_float_default(prop, 0); | ||||
| RNA_def_property_range(prop, 0.0f, 1.0f); | RNA_def_property_range(prop, 0.0f, 1.0f); | ||||
| RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3); | RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3); | ||||
| RNA_def_property_ui_text( | RNA_def_property_ui_text( | ||||
| prop, "Autosmooth", "Amount of smoothing to automatically apply to each stroke"); | prop, "Autosmooth", "Amount of smoothing to automatically apply to each stroke"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| ▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | RNA_def_property_ui_text( | ||||
| prop, | prop, | ||||
| "Grab Active Vertex", | "Grab Active Vertex", | ||||
| "Apply the maximum grab strength to the active vertex instead of the cursor location"); | "Apply the maximum grab strength to the active vertex instead of the cursor location"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_paint_antialiasing", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_paint_antialiasing", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "sampling_flag", BRUSH_PAINT_ANTIALIASING); | RNA_def_property_boolean_sdna(prop, NULL, "sampling_flag", BRUSH_PAINT_ANTIALIASING); | ||||
| RNA_def_property_ui_text(prop, "Antialasing", "Smooths the edges of the strokes"); | RNA_def_property_ui_text(prop, "Antialasing", "Smooths the edges of the strokes"); | ||||
| prop = RNA_def_property(srna, "use_multiplane_scrape_dynamic", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_MULTIPLANE_SCRAPE_DYNAMIC); | |||||
| RNA_def_property_ui_text(prop, | |||||
| "Dynamic Mode", | |||||
| "The angle between the planes changes during the stroke to fit the " | |||||
| "surface under the cursor"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| prop = RNA_def_property(srna, "show_multiplane_scrape_planes_preview", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_MULTIPLANE_SCRAPE_PLANES_PREVIEW); | |||||
| RNA_def_property_ui_text( | |||||
| prop, "Show Cursor Preview", "Preview the scrape planes in the cursor during the stroke"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | |||||
| prop = RNA_def_property(srna, "invert_to_scrape_fill", PROP_BOOLEAN, PROP_NONE); | |||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_INVERT_TO_SCRAPE_FILL); | |||||
| RNA_def_property_ui_text(prop, | |||||
| "Invert to Scrape or Fill", | |||||
| "Use Scrape or Fill tool when inverting this brush instead of " | |||||
| "inverting its displacement direction"); | |||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE); | prop = RNA_def_property(srna, "use_pressure_strength", PROP_BOOLEAN, PROP_NONE); | ||||
| RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_PRESSURE); | RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ALPHA_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, "Strength Pressure", "Enable tablet pressure sensitivity for strength"); | prop, "Strength Pressure", "Enable tablet pressure sensitivity for strength"); | ||||
| RNA_def_property_update(prop, 0, "rna_Brush_update"); | RNA_def_property_update(prop, 0, "rna_Brush_update"); | ||||
| ▲ Show 20 Lines • Show All 435 Lines • Show Last 20 Lines | |||||