[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54434] trunk/blender/source/blender/ editors/object/object_modifier.c: Ensure that mask layer exists in sculpt mode after multires subdivide

Nicholas Bishop nicholasbishop at gmail.com
Sun Feb 10 16:59:30 CET 2013


Revision: 54434
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54434
Author:   nicholasbishop
Date:     2013-02-10 15:59:29 +0000 (Sun, 10 Feb 2013)
Log Message:
-----------
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

Modified Paths:
--------------
    trunk/blender/source/blender/editors/object/object_modifier.c

Modified: trunk/blender/source/blender/editors/object/object_modifier.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_modifier.c	2013-02-10 14:59:38 UTC (rev 54433)
+++ trunk/blender/source/blender/editors/object/object_modifier.c	2013-02-10 15:59:29 UTC (rev 54434)
@@ -1196,6 +1196,11 @@
 
 	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;
 }




More information about the Bf-blender-cvs mailing list