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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-01-25 22:22:30 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-01-25 22:28:47 +0300
commitc292b4ebb9152c2231e7d50417e35549cc58a656 (patch)
treefd70cd78ac1190e5e88b169e420f0f7153c422c7 /source/blender/editors/sculpt_paint
parent60663c8ec42f1cf0f527a42ea3c6ebbd9b4d3153 (diff)
Fix T46456: Crash when aborting stroke while using dyntopo.
Basically, the 'fake undo' restoring orig coordinates in this case cannot work with dyntopo, since it assumes nothing was added/removed. For now, just prevent this 'restoration' when dyntopo is used, this is no ideal solution from user PoV - but it's better than plain ugly crash! Complete solution seems much more involved and outside of scope of bug handling, added a TODO note: http://wiki.blender.org/index.php/Dev:Source/Development/Todo/Tools#Sculpting
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 73f829ada71..7cc70418fe7 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4817,8 +4817,11 @@ static void sculpt_brush_stroke_cancel(bContext *C, wmOperator *op)
Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
+ const Brush *brush = BKE_paint_brush(&sd->paint);
- if (ss->cache) {
+ /* XXX Cancelling strokes that way does not work with dynamic topology, user will have to do real undo for now.
+ * See T46456. */
+ if (ss->cache && !sculpt_stroke_is_dynamic_topology(ss, brush)) {
paint_mesh_restore_co(sd, ob);
}