diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-06-04 12:03:37 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2007-06-04 12:03:37 +0400 |
commit | 531ffedba9cf00dd086a0c36894e56718e540384 (patch) | |
tree | 7554da53832fc98bb44ea3267fe41da084d27492 /source/blender/src/sculptmode.c | |
parent | 8e530d50746b5623e38138e816c11770bde72eb1 (diff) |
== Sculpt Mode ==
Kind of fixed [#6688] sculpt - if 2.44 blend is openned in 2.43 with flatten brush selected causes crash
* Added better handling for new brushes; if more brushes are added they will no longer cause a crash (but this doesn't help older Blenders compiled without this fix.)
Diffstat (limited to 'source/blender/src/sculptmode.c')
-rw-r--r-- | source/blender/src/sculptmode.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c index 0497460ac2a..c6c27c5ba59 100644 --- a/source/blender/src/sculptmode.c +++ b/source/blender/src/sculptmode.c @@ -1096,13 +1096,22 @@ void calc_damaged_verts(ListBase *damaged_verts, GrabData *grabdata) BrushData *sculptmode_brush(void) { SculptData *sd= &G.scene->sculptdata; - return (sd->brush_type==DRAW_BRUSH ? &sd->drawbrush : - sd->brush_type==SMOOTH_BRUSH ? &sd->smoothbrush : - sd->brush_type==PINCH_BRUSH ? &sd->pinchbrush : - sd->brush_type==INFLATE_BRUSH ? &sd->inflatebrush : - sd->brush_type==GRAB_BRUSH ? &sd->grabbrush : - sd->brush_type==LAYER_BRUSH ? &sd->layerbrush : - sd->brush_type==FLATTEN_BRUSH ? &sd->flattenbrush : NULL); + + BrushData *bd = + (sd->brush_type==DRAW_BRUSH ? &sd->drawbrush : + sd->brush_type==SMOOTH_BRUSH ? &sd->smoothbrush : + sd->brush_type==PINCH_BRUSH ? &sd->pinchbrush : + sd->brush_type==INFLATE_BRUSH ? &sd->inflatebrush : + sd->brush_type==GRAB_BRUSH ? &sd->grabbrush : + sd->brush_type==LAYER_BRUSH ? &sd->layerbrush : + sd->brush_type==FLATTEN_BRUSH ? &sd->flattenbrush : NULL); + + if(!bd) { + sculptmode_init(G.scene); + bd = &sd->drawbrush; + } + + return bd; } void sculptmode_update_tex() @@ -1853,8 +1862,8 @@ void set_sculptmode(void) else { G.f |= G_SCULPTMODE; - if(!sculptmode_brush()) - sculptmode_init(G.scene); + /* Called here to sanity-check the brush */ + sculptmode_brush(); sculpt_init_session(); |