diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-12-27 01:51:27 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-12-27 01:51:27 +0300 |
commit | c7c10e5e283879961356050ba8a965d2239456b8 (patch) | |
tree | d89d06ca30d51087a9d958f66bbf240bd3c7807e /source/blender/makesrna/intern/rna_brush.c | |
parent | e0cf86a9e219dcd71e5d67b8f2999d41e7f8c492 (diff) |
Brush Texture Angle Goodies:
This commit includes a few things:
* It moves the Rake and Random flags from the brush to the MTex.
* The first change allows mask textures to have independent rake
support.
* Random rotation now has an angle value that controls the width of the
effect from the rake or default angle
* Rake and Random are now supported together.
Diffstat (limited to 'source/blender/makesrna/intern/rna_brush.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 50 |
1 files changed, 15 insertions, 35 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index bbc2e0572fa..2c7b7b3d654 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -654,6 +654,21 @@ static void rna_def_brush_texture_slot(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_mask_paint_map_mode_items); RNA_def_property_ui_text(prop, "Mode", ""); RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_update"); + + prop = RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "brush_angle_mode", MTEX_ANGLE_RAKE); + RNA_def_property_ui_text(prop, "Rake", ""); + RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_update"); + + prop = RNA_def_property(srna, "use_random", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "brush_angle_mode", MTEX_ANGLE_RANDOM); + RNA_def_property_ui_text(prop, "Random", ""); + RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_update"); + + prop = RNA_def_property(srna, "random_angle", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_range(prop, 0, M_PI * 2); + RNA_def_property_ui_text(prop, "Random Angle", "Brush texture random angle"); + RNA_def_property_update(prop, 0, "rna_TextureSlot_brush_update"); } static void rna_def_sculpt_capabilities(BlenderRNA *brna) @@ -786,19 +801,6 @@ static void rna_def_brush(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - static EnumPropertyItem texture_angle_source_items[] = { - {0, "USER", 0, "User", "Rotate the brush texture by given angle"}, - {BRUSH_RAKE, "RAKE", 0, "Rake", "Rotate the brush texture to match the stroke direction"}, - {BRUSH_RANDOM_ROTATION, "RANDOM", 0, "Random", "Rotate the brush texture at random"}, - {0, NULL, 0, NULL, NULL} - }; - - static EnumPropertyItem texture_angle_source_no_random_items[] = { - {0, "USER", 0, "User", "Rotate the brush texture by given angle"}, - {BRUSH_RAKE, "RAKE", 0, "Rake", "Rotate the brush texture to match the stroke direction"}, - {0, NULL, 0, NULL, NULL} - }; - static EnumPropertyItem brush_sculpt_plane_items[] = { {SCULPT_DISP_DIR_AREA, "AREA", 0, "Area Plane", ""}, {SCULPT_DISP_DIR_VIEW, "VIEW", 0, "View Plane", ""}, @@ -881,18 +883,6 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Stroke Method", ""); RNA_def_property_update(prop, 0, "rna_Brush_stroke_update"); - prop = RNA_def_property(srna, "texture_angle_source_random", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); - RNA_def_property_enum_items(prop, texture_angle_source_items); - RNA_def_property_ui_text(prop, "Texture Angle Source", ""); - RNA_def_property_update(prop, 0, "rna_Brush_update"); - - prop = RNA_def_property(srna, "texture_angle_source_no_random", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); - RNA_def_property_enum_items(prop, texture_angle_source_no_random_items); - RNA_def_property_ui_text(prop, "Texture Angle Source", ""); - RNA_def_property_update(prop, 0, "rna_Brush_update"); - prop = RNA_def_property(srna, "sculpt_plane", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, brush_sculpt_plane_items); RNA_def_property_ui_text(prop, "Sculpt Plane", ""); @@ -1158,22 +1148,12 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied"); RNA_def_property_update(prop, 0, "rna_Brush_update"); - prop = RNA_def_property(srna, "use_rake", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RAKE); - RNA_def_property_ui_text(prop, "Rake", "Rotate the brush texture to match the stroke direction"); - 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_random_rotation", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_RANDOM_ROTATION); - RNA_def_property_ui_text(prop, "Random Rotation", "Rotate the brush texture at random"); - RNA_def_property_update(prop, 0, "rna_Brush_update"); - 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_ui_text(prop, "Use Plane Trim", "Enable Plane Trim"); |