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/blenkernel | |
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/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/paint.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/paint.cc b/source/blender/blenkernel/intern/paint.cc index 22f5b4d54c6..887ae1c8121 100644 --- a/source/blender/blenkernel/intern/paint.cc +++ b/source/blender/blenkernel/intern/paint.cc @@ -2042,6 +2042,8 @@ int BKE_sculpt_mask_layers_ensure(Object *ob, MultiresModifierData *mmd) } } } + /* The evaluated multires CCG must be updated to contain the new data. */ + DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); ret |= SCULPT_MASK_LAYER_CALC_LOOP; } @@ -2049,6 +2051,8 @@ int BKE_sculpt_mask_layers_ensure(Object *ob, MultiresModifierData *mmd) /* Create vertex paint mask layer if there isn't one already. */ if (!paint_mask) { CustomData_add_layer(&me->vdata, CD_PAINT_MASK, CD_SET_DEFAULT, nullptr, me->totvert); + /* The evaluated mesh must be updated to contain the new data. */ + DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); ret |= SCULPT_MASK_LAYER_CALC_VERT; } |