diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-01-25 01:58:22 +0300 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-01-25 01:58:22 +0300 |
commit | fb87cfbb1bfad1ab3840f63fb487972d27c49026 (patch) | |
tree | d7e26f41744db4819a3d140603d8038d085c77c3 /source/blender/makesrna | |
parent | 3e6b5804fd64e4df0b1b52a597202f52ae2973c8 (diff) |
More radial control work.
* Added a rotation setting to brush (and brush RNA)
* Brought back strength and rotation modes for radial control
* Brought back brush texture for radial control
* Turned off display of sculpt brush during radial control operator
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 3dc4b9e6fa4..468a63734c4 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -46,6 +46,20 @@ static void *rna_Brush_active_texture_get(PointerRNA *ptr) return brush->mtex[(int)brush->texact]; } +static float rna_Brush_rotation_get(PointerRNA *ptr) +{ + Brush *brush= (Brush*)ptr->data; + const float conv = 57.295779506; + return brush->rot * conv; +} + +static void rna_Brush_rotation_set(PointerRNA *ptr, float v) +{ + Brush *brush= (Brush*)ptr->data; + const float conv = 0.017453293; + brush->rot = v * conv; +} + #else void rna_def_brush(BlenderRNA *brna) @@ -122,6 +136,12 @@ void rna_def_brush(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "alpha"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Strength", "The amount of pressure on the brush."); + + prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "rot"); + RNA_def_property_range(prop, 0, 360); + RNA_def_property_float_funcs(prop, "rna_Brush_rotation_get", "rna_Brush_rotation_set", NULL); + RNA_def_property_ui_text(prop, "Rotation", "Angle of the brush texture."); /* flag */ prop= RNA_def_property(srna, "airbrush", PROP_BOOLEAN, PROP_NONE); |