diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2013-02-10 19:59:29 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2013-02-10 19:59:29 +0400 |
commit | 809e37bf15568080907a008d40aed41c737c2b24 (patch) | |
tree | 8e3823e5987e75fabb20d8d0926743f051193d58 /source | |
parent | 6b2b55c45361262f7c6608d0c0f5a164f7a1928a (diff) |
Ensure that mask layer exists in sculpt mode after multires subdivide
Sculpt mode requires mask customdata layer for multires and ensures it
exists on entering sculpt mode. However, sculpt mode only considers
multires to be active if the level of subdivision is not zero, so it
does not add mask for unsubdivided multires meshes. If the multires
mesh is subdivided while in sculpt mode, no mask was present leading
to weird drawing and crash on use of the mask brush.
Fixed by doing the same thing in multires_subdivide_exec() that is
done in ED_object_modifier_add(), which is to check if sculpt mode is
active and add mask layer if so.
Fixes [#34190] Viewport artifacts when using Multiresolution modifier
projects.blender.org/tracker/index.php?func=detail&aid=34190&group_id=9&atid=498
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 7d3d6861418..00082b03781 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1196,6 +1196,11 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op) DAG_id_tag_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob); + + if (ob->mode & OB_MODE_SCULPT) { + /* ensure that grid paint mask layer is created */ + ED_sculpt_mask_layers_ensure(ob, mmd); + } return OPERATOR_FINISHED; } |