diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-16 22:29:37 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-16 22:31:30 +0300 |
commit | 8fdaf2bddccf7cf1469733c05bad08d530fcd37c (patch) | |
tree | 3955876b007ec0dbd5ef4994693ee318dc5f1f00 /source/blender/editors/sculpt_paint/sculpt_ops.c | |
parent | 02575bcbd0a91f499f13d15860adc3896920b9ff (diff) |
Fix: Missing updates for multires sculpting
Caused by ee23f0f3fb58ce56, which removed the update tag when entering
sculpt mode, and by b5f7af31d6d474c, which made these layers lazily
created, so they weren't always available at the start of a stroke. Now
update the evaluated mesh/multires CCG as necessary. Some updates
could potentially avoided when switching modes in the future, but for
now do it all the time.
Fixes T101116
Also fixes a crash when painting multires mask for the first time
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_ops.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_ops.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_ops.c b/source/blender/editors/sculpt_paint/sculpt_ops.c index 39c77129f0e..0731e54d533 100644 --- a/source/blender/editors/sculpt_paint/sculpt_ops.c +++ b/source/blender/editors/sculpt_paint/sculpt_ops.c @@ -309,6 +309,9 @@ static void sculpt_init_session(Main *bmain, Depsgraph *depsgraph, Scene *scene, ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session"); ob->sculpt->mode_type = OB_MODE_SCULPT; + /* Necessary to make multires displacement immediately visible. */ + DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); + BKE_scene_graph_evaluated_ensure(depsgraph, bmain); /* This function expects a fully evaluated depsgraph. */ |