Fix crash caused by own commit to optimize out curvemapping
authorAntony Riakiotakis <kalast@gmail.com>
Mon, 19 Aug 2013 19:41:38 +0000 (19:41 +0000)
committerAntony Riakiotakis <kalast@gmail.com>
Mon, 19 Aug 2013 19:41:38 +0000 (19:41 +0000)
initialization. In sculpt mode, when using shift-click to switch to the
smooth brush it was possible to ommit initialization of curvemapping for
that brush.

source/blender/blenkernel/intern/brush.c
source/blender/editors/sculpt_paint/sculpt.c

index 09f53281dbec6101626afb5332e48e5cb296c2d7..9812c49f08be1a68e87911fa9c545aa84bcaea9e 100644 (file)
@@ -1022,6 +1022,7 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br)
        int half = side / 2;
        int i, j;
 
+       curvemapping_initialize(br->curve);
        texcache = BKE_brush_gen_texture_cache(br, half);
        im->rect_float = MEM_callocN(sizeof(float) * side * side, "radial control rect");
        im->x = im->y = side;
index 545c0f6f0e859d40f0537c30f7ca46d4b4fa2a4b..a5de6b1eea8d9a3aba860a9966f134b569c22d34 100644 (file)
@@ -70,6 +70,7 @@
 #include "BKE_node.h"
 #include "BKE_object.h"
 #include "BKE_subsurf.h"
+#include "BKE_colortools.h"
 
 #include "BIF_glutil.h"
 
@@ -3771,6 +3772,7 @@ static void sculpt_update_cache_invariants(bContext *C, Sculpt *sd, SculptSessio
                                brush = br;
                                cache->saved_smooth_size = BKE_brush_size_get(scene, brush);
                                BKE_brush_size_set(scene, brush, size);
+                               curvemapping_initialize(brush->curve);
                        }
                }
        }