Brush Texture Angle Goodies:
authorAntony Riakiotakis <kalast@gmail.com>
Fri, 26 Dec 2014 22:51:27 +0000 (23:51 +0100)
committerAntony Riakiotakis <kalast@gmail.com>
Fri, 26 Dec 2014 22:51:27 +0000 (23:51 +0100)
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.

14 files changed:
release/scripts/startup/bl_ui/properties_paint_common.py
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/texture.c
source/blender/blenloader/intern/versioning_270.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_image_2d.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/makesdna/DNA_brush_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_texture_types.h
source/blender/makesrna/intern/rna_brush.c

index f1042856e4c5e7c499af631dacb7a907a90c4297..49634982bebd851c5992fa36b7c978c213799908 100644 (file)
@@ -246,21 +246,20 @@ def brush_texture_settings(layout, brush, sculpt):
     if brush.brush_capabilities.has_texture_angle:
         col = layout.column()
         col.label(text="Angle:")
-        row = col.row(align=True)
         if brush.brush_capabilities.has_texture_angle_source:
+            col.prop(tex_slot, "angle", text="")
+            col.prop(tex_slot, "use_rake", text="Rake")
+            
             if brush.brush_capabilities.has_random_texture_angle:
                 if sculpt:
                     if brush.sculpt_capabilities.has_random_texture_angle:
-                        row.prop(brush, "texture_angle_source_random", text="")
-                    else:
-                        row.prop(brush, "texture_angle_source_no_random", text="")
-
+                        col.prop(tex_slot, "use_random", text="Random")
+                        if tex_slot.use_random:
+                            col.prop(tex_slot, "random_angle", text="")
                 else:
-                    row.prop(brush, "texture_angle_source_random", text="")
-            else:
-                row.prop(brush, "texture_angle_source_no_random", text="")
-
-        row.prop(tex_slot, "angle", text="")
+                    col.prop(tex_slot, "use_random", text="Random")
+                    if tex_slot.use_random:
+                        col.prop(tex_slot, "random_angle", text="")
 
     # scale and offset
     split = layout.split()
@@ -290,9 +289,18 @@ def brush_mask_texture_settings(layout, brush):
 
     col = layout.column()
     col.prop(brush, "use_pressure_masking", text="")
-    col.label(text="Angle:")
-    col.active = brush.brush_capabilities.has_texture_angle
-    col.prop(mask_tex_slot, "angle", text="")
+    # angle and texture_angle_source
+    if brush.brush_capabilities.has_texture_angle:
+        col = layout.column()
+        col.label(text="Angle:")
+        if brush.brush_capabilities.has_texture_angle_source:
+            col.prop(mask_tex_slot, "angle", text="")
+            col.prop(mask_tex_slot, "use_rake", text="Rake")
+            
+            if brush.brush_capabilities.has_random_texture_angle:
+                col.prop(mask_tex_slot, "use_random", text="Random")
+                if mask_tex_slot.use_random:
+                    col.prop(mask_tex_slot, "random_angle", text="")
 
     # scale and offset
     split = layout.split()
index 2701dc3465c23fe316ef9a810dce556b659abc6c..b27f1a6775edf342a37def890260a9cb86b3f3da 100644 (file)
@@ -42,7 +42,7 @@ extern "C" {
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION         273
-#define BLENDER_SUBVERSION      0
+#define BLENDER_SUBVERSION      1
 /* 262 was the last editmesh release but it has compatibility code for bmesh data */
 #define BLENDER_MINVERSION      270
 #define BLENDER_MINSUBVERSION   5
index b080ca37e67919abfced7852e9c049ba2c98cba6..8cf6fdcfeead021709e3eaf83918972e93a4f184 100644 (file)
@@ -143,7 +143,7 @@ float paint_grid_paint_mask(const struct GridPaintMask *gpm, unsigned level,
                             unsigned x, unsigned y);
 
 /* stroke related */
-void paint_calculate_rake_rotation(struct UnifiedPaintSettings *ups, const float mouse_pos[2]);
+void paint_calculate_rake_rotation(struct UnifiedPaintSettings *ups, struct Brush *brush, const float mouse_pos[2]);
 
 /* Session data (mode-specific) */
 
index 92f66cdde7626393a373fb638e5cc6d7ae902aae..cdbcffe0ce474e46024d852ba045d21fc60c1394 100644 (file)
@@ -298,7 +298,6 @@ void BKE_brush_debug_print_state(Brush *br)
        BR_TEST_FLAG(BRUSH_SIZE_PRESSURE);
        BR_TEST_FLAG(BRUSH_JITTER_PRESSURE);
        BR_TEST_FLAG(BRUSH_SPACING_PRESSURE);
-       BR_TEST_FLAG(BRUSH_RAKE);
        BR_TEST_FLAG(BRUSH_ANCHORED);
        BR_TEST_FLAG(BRUSH_DIR_IN);
        BR_TEST_FLAG(BRUSH_SPACE);
@@ -314,7 +313,6 @@ void BKE_brush_debug_print_state(Brush *br)
        BR_TEST_FLAG(BRUSH_EDGE_TO_EDGE);
        BR_TEST_FLAG(BRUSH_DRAG_DOT);
        BR_TEST_FLAG(BRUSH_INVERSE_SMOOTH_PRESSURE);
-       BR_TEST_FLAG(BRUSH_RANDOM_ROTATION);
        BR_TEST_FLAG(BRUSH_PLANE_TRIM);
        BR_TEST_FLAG(BRUSH_FRONTFACE);
        BR_TEST_FLAG(BRUSH_CUSTOM_ICON);
@@ -700,7 +698,7 @@ float BKE_brush_sample_masktex(const Scene *scene, Brush *br,
                if (mtex->brush_map_mode == MTEX_MAP_MODE_VIEW) {
                        /* keep coordinates relative to mouse */
 
-                       rotation += ups->brush_rotation;
+                       rotation += ups->brush_rotation_sec;
 
                        x = point_2d[0] - ups->mask_tex_mouse[0];
                        y = point_2d[1] - ups->mask_tex_mouse[1];
@@ -718,7 +716,7 @@ float BKE_brush_sample_masktex(const Scene *scene, Brush *br,
                        y = point_2d[1];
                }
                else if (mtex->brush_map_mode == MTEX_MAP_MODE_RANDOM) {
-                       rotation += ups->brush_rotation;
+                       rotation += ups->brush_rotation_sec;
                        /* these contain a random coordinate */
                        x = point_2d[0] - ups->mask_tex_mouse[0];
                        y = point_2d[1] - ups->mask_tex_mouse[1];
index 96fff339521ed88a7b8d24a3abe95f0862ce8815..5f3b9f04bf22ae1e51864b60274f5e4032a0bed3 100644 (file)
@@ -477,19 +477,48 @@ float paint_grid_paint_mask(const GridPaintMask *gpm, unsigned level,
 /* threshold to move before updating the brush rotation */
 #define RAKE_THRESHHOLD 20
 
-void paint_calculate_rake_rotation(UnifiedPaintSettings *ups, const float mouse_pos[2])
+static void update_brush_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, float rotation)
 {
-       const float u = 0.5f;
-       const float r = RAKE_THRESHHOLD;
+       if (brush->mtex.brush_angle_mode & MTEX_ANGLE_RAKE)
+               ups->brush_rotation = rotation;
+       else
+               ups->brush_rotation = 0.0f;
 
-       float dpos[2];
-       sub_v2_v2v2(dpos, ups->last_rake, mouse_pos);
+       if (brush->mask_mtex.brush_angle_mode & MTEX_ANGLE_RAKE)
+               /* here, translation contains the mouse coordinates. */
+               ups->brush_rotation_sec = rotation;
+       else
+               ups->brush_rotation_sec = 0.0f;
+}
+
+void paint_calculate_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, const float mouse_pos[2])
+{
+       if ((brush->mtex.brush_angle_mode & MTEX_ANGLE_RAKE) || (brush->mask_mtex.brush_angle_mode & MTEX_ANGLE_RAKE)) {
+               const float u = 0.5f;
+               const float r = RAKE_THRESHHOLD;
+               float rotation;
+
+               float dpos[2];
+               sub_v2_v2v2(dpos, ups->last_rake, mouse_pos);
+
+               if (len_squared_v2(dpos) >= r * r) {
+                       rotation = atan2f(dpos[0], dpos[1]);
+
+                       interp_v2_v2v2(ups->last_rake, ups->last_rake,
+                                      mouse_pos, u);
 
-       if (len_squared_v2(dpos) >= r * r) {
-               ups->brush_rotation = atan2f(dpos[0], dpos[1]);
+                       ups->last_rake_angle = rotation;
 
-               interp_v2_v2v2(ups->last_rake, ups->last_rake,
-                              mouse_pos, u);
+                       update_brush_rake_rotation(ups, brush, rotation);
+               }
+               /* make sure we reset here to the last rotation to avoid accumulating
+                * values in case a random rotation is also added */
+               else {
+                       update_brush_rake_rotation(ups, brush, ups->last_rake_angle);
+               }
+       }
+       else {
+               ups->brush_rotation = ups->brush_rotation_sec =0.0f;
        }
 }
 
index 7ce08ac649f02d3d3b2b3dc421ffd7986ebfcf5d..a6536099c5091613a737d2da9f846b8628559de3 100644 (file)
@@ -755,6 +755,8 @@ void default_mtex(MTex *mtex)
        mtex->fieldfac = 1.0f;
        mtex->normapspace = MTEX_NSPACE_TANGENT;
        mtex->brush_map_mode = MTEX_MAP_MODE_TILED;
+       mtex->random_angle = 2.0f * M_PI;
+       mtex->brush_angle_mode = 0;
 }
 
 
index 372a0b06d01626a5d607f429732ee6cff57aadb7..a26e29db4853917394907c7be8d3d32055a30a28 100644 (file)
@@ -435,4 +435,27 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                        }
                }
        }
+
+       if (!MAIN_VERSION_ATLEAST(main, 273, 1)) {
+#define        BRUSH_RAKE (1 << 7)
+#define BRUSH_RANDOM_ROTATION = (1 << 25)
+
+               Brush *br;
+
+               for (br = main->brush.first; br; br = br->id.next) {
+                       if (br->flag & BRUSH_RAKE) {
+                               br->mtex.brush_angle_mode |= MTEX_ANGLE_RAKE;
+                               br->mask_mtex.brush_angle_mode |= MTEX_ANGLE_RAKE;
+                       }
+                       else if (br->flag & BRUSH_RAKE) {
+                               br->mtex.brush_angle_mode |= MTEX_ANGLE_RANDOM;
+                               br->mask_mtex.brush_angle_mode |= MTEX_ANGLE_RANDOM;
+                       }
+                       br->mtex.random_angle = 2.0f * M_PI;
+                       br->mask_mtex.random_angle = 2.0f * M_PI;
+               }
+
+#undef BRUSH_RAKE
+#undef BRUSH_RANDOM_ROTATION
+       }
 }
index e27ef705fad39863bc168dd703f9001ae8e19439..92cb346b61e98526eee721e5dbb4c2051b8e36c7 100644 (file)
@@ -595,7 +595,7 @@ static void paint_draw_tex_overlay(UnifiedPaintSettings *ups, Brush *brush,
                if (mtex->brush_map_mode == MTEX_MAP_MODE_VIEW) {
                        /* brush rotation */
                        glTranslatef(0.5, 0.5, 0);
-                       glRotatef((double)RAD2DEGF(ups->brush_rotation),
+                       glRotatef((double)RAD2DEGF((primary) ? ups->brush_rotation : ups->brush_rotation_sec),
                                  0.0, 0.0, 1.0);
                        glTranslatef(-0.5f, -0.5f, 0);
 
@@ -1000,9 +1000,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
        /* don't calculate rake angles while a stroke is active because the rake variables are global and
         * we may get interference with the stroke itself. For line strokes, such interference is visible */
        if (!ups->stroke_active) {
-               if (brush->flag & BRUSH_RAKE)
-                       /* here, translation contains the mouse coordinates. */
-                       paint_calculate_rake_rotation(ups, translation);
+               paint_calculate_rake_rotation(ups, brush, translation);
        }
 
        /* draw overlay */
index 44d562bbc7bb976addba034dd706723449481519..2298164822fd5fd17ad3b3c7be8e96d9fba9adb3 100644 (file)
@@ -686,7 +686,7 @@ static void brush_painter_2d_refresh_cache(ImagePaintState *s, BrushPainter *pai
                bool do_partial_update_mask = false;
                /* invalidate case for all mapping modes */
                if (brush->mask_mtex.brush_map_mode == MTEX_MAP_MODE_VIEW) {
-                       mask_rotation += ups->brush_rotation;
+                       mask_rotation += ups->brush_rotation_sec;
                }
                else if (brush->mask_mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM) {
                        renew_maxmask = true;
index 9c4701d0a01ab300177199236537ccc48e6e873e..bd5fa835718ab04cd86bd09f51b47bdd9c3b6aac 100644 (file)
@@ -207,6 +207,7 @@ static bool paint_brush_update(bContext *C,
        UnifiedPaintSettings *ups = stroke->ups;
        bool location_sampled = false;
        bool location_success = false;
+       bool do_random = false;
        /* XXX: Use pressure value from first brush step for brushes which don't
         *      support strokes (grab, thumb). They depends on initial state and
         *      brush coord/pressure/etc.
@@ -256,13 +257,9 @@ static bool paint_brush_update(bContext *C,
        if (paint_supports_dynamic_tex_coords(brush, mode)) {
                if (((brush->mtex.brush_map_mode == MTEX_MAP_MODE_VIEW) ||
                     (brush->mtex.brush_map_mode == MTEX_MAP_MODE_AREA) ||
-                    (brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)) &&
-                   !(brush->flag & BRUSH_RAKE))
+                    (brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)))
                {
-                       if (brush->flag & BRUSH_RANDOM_ROTATION)
-                               ups->brush_rotation = 2.0f * (float)M_PI * BLI_frand();
-                       else
-                               ups->brush_rotation = 0.0f;
+                       do_random = true;
                }
 
                if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)
@@ -291,7 +288,7 @@ static bool paint_brush_update(bContext *C,
 
                ups->anchored_size = ups->pixel_radius = sqrtf(dx * dx + dy * dy);
 
-               ups->brush_rotation = atan2f(dx, dy) + M_PI;
+               ups->brush_rotation = ups->brush_rotation_sec = atan2f(dx, dy) + M_PI;
 
                if (brush->flag & BRUSH_EDGE_TO_EDGE) {
                        halfway[0] = dx * 0.5f + stroke->initial_mouse[0];
@@ -328,13 +325,27 @@ static bool paint_brush_update(bContext *C,
                ups->pixel_radius /= stroke->zoom_2d;
                ups->draw_anchored = true;
        }
-       else if (brush->flag & BRUSH_RAKE) {
+       else {
                /* here we are using the initial mouse coordinate because we do not want the rake
                 * result to depend on jittering */
-               if (!stroke->brush_init)
+               if (!stroke->brush_init) {
                        copy_v2_v2(ups->last_rake, mouse_init);
-               else
-                       paint_calculate_rake_rotation(ups, mouse_init);
+               }
+               else {
+                       paint_calculate_rake_rotation(ups, brush, mouse_init);
+               }
+       }
+
+       if (do_random) {
+               if (brush->mtex.brush_angle_mode & MTEX_ANGLE_RANDOM) {
+                       ups->brush_rotation += -brush->mtex.random_angle / 2.0f +
+                                              brush->mtex.random_angle * BLI_frand();
+               }
+
+               if (brush->mask_mtex.brush_angle_mode & MTEX_ANGLE_RANDOM) {
+                       ups->brush_rotation_sec += -brush->mask_mtex.random_angle / 2.0f +
+                                                  brush->mask_mtex.random_angle * BLI_frand();
+               }
        }
 
        if (!location_sampled) {
@@ -675,9 +686,12 @@ static void stroke_done(struct bContext *C, struct wmOperator *op)
        ups->stroke_active = false;
 
        /* reset rotation here to avoid doing so in cursor display */
-       if (!(stroke->brush->flag & BRUSH_RAKE))
+       if (!(stroke->brush->mtex.brush_angle_mode & MTEX_ANGLE_RAKE))
                ups->brush_rotation = 0.0f;
 
+       if (!(stroke->brush->mask_mtex.brush_angle_mode & MTEX_ANGLE_RAKE))
+               ups->brush_rotation_sec = 0.0f;
+
        if (stroke->stroke_started) {
                if (stroke->redraw)
                        stroke->redraw(C, stroke, true);
@@ -1064,10 +1078,10 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
        else if ((br->flag & BRUSH_LINE) && stroke->stroke_started &&
                 (first_modal || (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE))))
        {
-               if (br->flag & BRUSH_RAKE) {
+               if ((br->mtex.brush_angle_mode & MTEX_ANGLE_RAKE) || (br->mtex.brush_angle_mode & MTEX_ANGLE_RAKE)) {
                        copy_v2_v2(stroke->ups->last_rake, stroke->last_mouse_position);
-                       paint_calculate_rake_rotation(stroke->ups,  sample_average.mouse);
                }
+               paint_calculate_rake_rotation(stroke->ups, br, sample_average.mouse);
        }
        else if (first_modal ||
                 /* regular dabs */
index 2fce2be8eaf40b31b2fde4a7d34376ab88cd294a..89c8316002b5d3b09276fb0e633d5e5a1fef9c1b 100644 (file)
@@ -93,7 +93,7 @@ typedef struct Brush {
 
        float plane_offset;     /* offset for plane brushes (clay, flatten, fill, scrape) */
 
-       float pad;
+       int flag2;
        int gradient_spacing;
        int gradient_stroke_mode; /* source for stroke color gradient application */
        int gradient_fill_mode;   /* source for fill tool color gradient application */
@@ -192,7 +192,7 @@ typedef enum BrushFlags {
        BRUSH_JITTER_PRESSURE = (1 << 4),
        BRUSH_SPACING_PRESSURE = (1 << 5),
        BRUSH_UNUSED = (1 << 6),
-       BRUSH_RAKE = (1 << 7),
+//     BRUSH_RAKE = (1 << 7), deprecated, use brush_angle_mode
        BRUSH_ANCHORED = (1 << 8),
        BRUSH_DIR_IN = (1 << 9),
        BRUSH_SPACE = (1 << 10),
@@ -209,7 +209,7 @@ typedef enum BrushFlags {
        BRUSH_EDGE_TO_EDGE = (1 << 22),
        BRUSH_DRAG_DOT = (1 << 23),
        BRUSH_INVERSE_SMOOTH_PRESSURE = (1 << 24),
-       BRUSH_RANDOM_ROTATION = (1 << 25),
+//     BRUSH_RANDOM_ROTATION = (1 << 25), deprecated, use brush_angle_mode
        BRUSH_PLANE_TRIM = (1 << 26),
        BRUSH_FRONTFACE = (1 << 27),
        BRUSH_CUSTOM_ICON = (1 << 28),
index 27b5da90d5550519be32e97cc7e7cbea0db3de50..5f21e5473e4441f4b94260cf2076797b02c0afc5 100644 (file)
@@ -985,25 +985,31 @@ typedef struct UnifiedPaintSettings {
 
        /* record movement of mouse so that rake can start at an intuitive angle */
        float last_rake[2];
+       float last_rake_angle, pad;
 
        float brush_rotation;
+       float brush_rotation_sec;
 
        /*********************************************************************************
         *  all data below are used to communicate with cursor drawing and tex sampling  *
         *********************************************************************************/
-       int draw_anchored;
        int anchored_size;
 
-       char draw_inverted;
-       char pad3[7];
-
        float overlap_factor; /* normalization factor due to accumulated value of curve along spacing.
                               * Calculated when brush spacing changes to dampen strength of stroke
                               * if space attenuation is used*/
+       char draw_inverted;
+       /* check is there an ongoing stroke right now */
+       char stroke_active;
+
+       char draw_anchored;
+       char do_linear_conversion;
+
        float anchored_initial_mouse[2];
 
-       /* check is there an ongoing stroke right now */
-       int stroke_active;
+       /* radius of brush, premultiplied with pressure.
+        * In case of anchored brushes contains the anchored radius */
+       float pixel_radius;
 
        /* drawing pressure */
        float size_pressure_value;
@@ -1015,13 +1021,7 @@ typedef struct UnifiedPaintSettings {
        float mask_tex_mouse[2];
 
        /* ColorSpace cache to avoid locking up during sampling */
-       int do_linear_conversion;
        struct ColorSpace *colorspace;
-
-       /* radius of brush, premultiplied with pressure.
-        * In case of anchored brushes contains the anchored radius */
-       float pixel_radius;
-       int pad4;
 } UnifiedPaintSettings;
 
 typedef enum {
index d256cfb2e85d60700f919339e3307cd5b3230bdb..042645eeb769e35d00b7f6dd0750696c0232c657 100644 (file)
@@ -62,11 +62,12 @@ typedef struct MTex {
        char uvname[64];        /* MAX_CUSTOMDATA_LAYER_NAME */
        
        char projx, projy, projz, mapping;
-       float ofs[3], size[3], rot;
-       
+       char brush_map_mode, brush_angle_mode;
+       char pad[2];
+       float ofs[3], size[3], rot, random_angle;
+
        short texflag, colormodel, pmapto, pmaptoneg;
        short normapspace, which_output;
-       char brush_map_mode, pad[7];
        float r, g, b, k;
        float def_var, rt;
        
@@ -512,6 +513,10 @@ typedef struct ColorMapping {
 #define MTEX_MAP_MODE_RANDOM   4
 #define MTEX_MAP_MODE_STENCIL  5
 
+/* brush_angle_mode */
+#define MTEX_ANGLE_RANDOM      1
+#define MTEX_ANGLE_RAKE        2
+
 /* **************** ColorBand ********************* */
 
 /* colormode */
index bbc2e0572fa32c3bef4f7208e168f18cce44c13b..2c7b7b3d6548736e4a4b25a47a5ea78eaee45836 100644 (file)
@@ -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");