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:
authorAntony Riakiotakis <kalast@gmail.com>2015-11-24 23:40:18 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-11-24 23:40:52 +0300
commit697acebeb7f61ece1bd17d129d424b3f470438ba (patch)
tree9c58aa30b2874619c163b9062d7fe689f5d483bc /source/blender/editors/sculpt_paint/paint_stroke.c
parentfe3aaac1184f0a09ba7b367380c03dedbfae86b9 (diff)
Sculpting optimization: Avoid iterating the PBVH for intersection during
the paint cursor drawing when a stroke is underway; this information is already available from the stroke itself. Should improve performance when "show brush" is enabled (which is always, for sane people). Finding an intersection is not always cheap, especially on heavy meshes. Cudos to the dyntopo test thread for the report and the sculpt love :)
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_stroke.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index db6ee705343..3225d4d4b7e 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -466,7 +466,10 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const float
copy_v2_v2(mouse_out, mouse_in);
}
- if (!paint_brush_update(C, brush, mode, stroke, mouse_in, mouse_out, pressure, location)) {
+
+ ups->last_hit = paint_brush_update(C, brush, mode, stroke, mouse_in, mouse_out, pressure, location);
+ copy_v3_v3(ups->last_location, location);
+ if (!ups->last_hit) {
return;
}