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:
authorCampbell Barton <ideasman42@gmail.com>2019-02-07 09:54:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-07 12:28:33 +0300
commit075a1221907f33c8634cc6e38238f6729334c716 (patch)
tree8774cb5b0081a80c8fe85d06503633658d846a9e /source/blender/editors/sculpt_paint
parent83d78eb32ccfc3a2d6f429dc51961f052aca9a53 (diff)
Fix sculpt undo steps not enabling dyntopo
Logic to disable dyntopo when entering sculpt mode was applied on undo.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c8
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 6512e279a15..b994a688f86 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -5845,7 +5845,7 @@ static int ed_object_sculptmode_flush_recalc_flag(Scene *scene, Object *ob, Mult
void ED_object_sculptmode_enter_ex(
Main *bmain, Depsgraph *depsgraph,
- Scene *scene, Object *ob,
+ Scene *scene, Object *ob, const bool force_dyntopo,
ReportList *reports)
{
const int mode_flag = OB_MODE_SCULPT;
@@ -5926,7 +5926,7 @@ void ED_object_sculptmode_enter_ex(
}
}
- if (message_unsupported == NULL) {
+ if ((message_unsupported == NULL) || force_dyntopo) {
/* Needed because we may be entering this mode before the undo system loads. */
wmWindowManager *wm = bmain->wm.first;
bool has_undo = wm->undo_stack != NULL;
@@ -5959,7 +5959,7 @@ void ED_object_sculptmode_enter(struct bContext *C, ReportList *reports)
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob = OBACT(view_layer);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
- ED_object_sculptmode_enter_ex(bmain, depsgraph, scene, ob, reports);
+ ED_object_sculptmode_enter_ex(bmain, depsgraph, scene, ob, false, reports);
}
void ED_object_sculptmode_exit_ex(
@@ -6041,7 +6041,7 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
ED_object_sculptmode_exit_ex(depsgraph, scene, ob);
}
else {
- ED_object_sculptmode_enter_ex(bmain, depsgraph, scene, ob, op->reports);
+ ED_object_sculptmode_enter_ex(bmain, depsgraph, scene, ob, false, op->reports);
BKE_paint_toolslots_brush_validate(bmain, &ts->sculpt->paint);
}
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 1b8e6da6ee3..67b815ee7d6 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -1119,7 +1119,7 @@ static void sculpt_undosys_step_decode(struct bContext *C, struct Main *bmain, U
/* Don't add sculpt topology undo steps when reading back undo state.
* The undo steps must enter/exit for us. */
me->flag &= ~ME_SCULPT_DYNAMIC_TOPOLOGY;
- ED_object_sculptmode_enter_ex(bmain, depsgraph, scene, ob, NULL);
+ ED_object_sculptmode_enter_ex(bmain, depsgraph, scene, ob, true, NULL);
}
BLI_assert(sculpt_undosys_poll(C));
}