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>2018-01-30 12:33:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-01-30 12:33:20 +0300
commitd0f63d402db5260d57dc60cf52aa029d7f11f161 (patch)
treed608211a6d0fdffb525ad6743e4fe4832b525424 /source/blender/editors/sculpt_paint/sculpt.c
parentb0af44fa4d7a2e134b315c49a4fbdf573f781004 (diff)
Fix T53943: Weight paint crash in new scene
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 37af1732045..2468f273a04 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -5585,8 +5585,10 @@ static void SCULPT_OT_symmetrize(wmOperatorType *ot)
static void sculpt_init_session(Scene *scene, Object *ob)
{
- ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
+ /* Create persistent sculpt mode data */
+ BKE_sculpt_toolsettings_data_ensure(scene);
+ ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
BKE_sculpt_update_mesh_elements(scene, scene->toolsettings->sculpt, ob, 0, false);
}
@@ -5650,31 +5652,6 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
if (flush_recalc)
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- /* Create persistent sculpt mode data */
- if (!ts->sculpt) {
- ts->sculpt = MEM_callocN(sizeof(Sculpt), "sculpt mode data");
-
- /* Turn on X plane mirror symmetry by default */
- ts->sculpt->paint.symmetry_flags |= PAINT_SYMM_X;
- ts->sculpt->paint.flags |= PAINT_SHOW_BRUSH;
-
- /* Make sure at least dyntopo subdivision is enabled */
- ts->sculpt->flags |= SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE;
- }
-
- if (!ts->sculpt->detail_size)
- ts->sculpt->detail_size = 12;
- if (!ts->sculpt->detail_percent)
- ts->sculpt->detail_percent = 25;
- if (ts->sculpt->constant_detail == 0.0f)
- ts->sculpt->constant_detail = 3.0f;
-
- /* Set sane default tiling offsets */
- if (!ts->sculpt->paint.tile_offset[0]) ts->sculpt->paint.tile_offset[0] = 1.0f;
- if (!ts->sculpt->paint.tile_offset[1]) ts->sculpt->paint.tile_offset[1] = 1.0f;
- if (!ts->sculpt->paint.tile_offset[2]) ts->sculpt->paint.tile_offset[2] = 1.0f;
-
-
/* Create sculpt mode session data */
if (ob->sculpt)
BKE_sculptsession_free(ob);