Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2008-01-22 22:46:47 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2008-01-22 22:46:47 +0300
commit0ea3c91a784c3fead61158c32a1cab3609de886d (patch)
tree39315439aa3b2ee84596985ab25f5b40741d9e1a /source/blender/src/sculptmode.c
parentff714ce654b1bbea6cd8c145169e48a3de535d18 (diff)
Fixed bug #8128, Sculpt Mode crash with Smooth Stroke
Disabled smooth stroke when the grab brush is active
Diffstat (limited to 'source/blender/src/sculptmode.c')
-rw-r--r--source/blender/src/sculptmode.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/src/sculptmode.c b/source/blender/src/sculptmode.c
index 55626be8cfa..9e1fa16a44c 100644
--- a/source/blender/src/sculptmode.c
+++ b/source/blender/src/sculptmode.c
@@ -1474,6 +1474,8 @@ void sculpt(void)
short spacing= 32000;
int scissor_box[4];
float offsetRot;
+ int smooth_stroke = 0;
+
if(!(G.f & G_SCULPTMODE) || G.obedit || !ob || ob->id.lib || !get_mesh(ob) || (get_mesh(ob)->totface == 0))
return;
if(!(ob->lay & G.vd->lay))
@@ -1490,7 +1492,9 @@ void sculpt(void)
ss= sd->session;
}
- if(sd->flags & SCULPT_INPUT_SMOOTH)
+ smooth_stroke = (sd->flags & SCULPT_INPUT_SMOOTH) && (sd->brush_type != GRAB_BRUSH);
+
+ if(smooth_stroke)
sculpt_stroke_new(256);
ss->damaged_rects.first = ss->damaged_rects.last = NULL;
@@ -1569,7 +1573,7 @@ void sculpt(void)
if(firsttime || mouse[0]!=mvalo[0] || mouse[1]!=mvalo[1] || sculptmode_brush()->airbrush) {
firsttime= 0;
- if(sd->flags & SCULPT_INPUT_SMOOTH)
+ if(smooth_stroke)
sculpt_stroke_add_point(mouse[0], mouse[1]);
spacing+= sqrt(pow(mvalo[0]-mouse[0],2)+pow(mvalo[1]-mouse[1],2));
@@ -1578,7 +1582,7 @@ void sculpt(void)
ss->vertexcosnos= mesh_get_mapped_verts_nors(ob);
if(G.scene->sculptdata.brush_type != GRAB_BRUSH) {
- if(sd->flags & SCULPT_INPUT_SMOOTH) {
+ if(smooth_stroke) {
sculpt_stroke_apply(&e);
}
else if(sd->spacing==0 || spacing>sd->spacing) {
@@ -1619,7 +1623,7 @@ void sculpt(void)
/* Draw cursor */
if(sculpt_data()->flags & SCULPT_DRAW_BRUSH)
fdrawXORcirc((float)mouse[0],(float)mouse[1],sculptmode_brush()->size);
- if(sculpt_data()->flags & SCULPT_INPUT_SMOOTH)
+ if(smooth_stroke)
sculpt_stroke_draw();
myswapbuffers();
@@ -1643,7 +1647,7 @@ void sculpt(void)
/* Set the rotation of the brush back to what it was before any rake */
set_tex_angle(offsetRot);
- if(sd->flags & SCULPT_INPUT_SMOOTH) {
+ if(smooth_stroke) {
sculpt_stroke_apply_all(&e);
calc_damaged_verts(&ss->damaged_verts,e.grabdata);
BLI_freelistN(&ss->damaged_rects);