[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51002] trunk/blender/source/blender/ editors/sculpt_paint: fix for crash in own recent masking commit with ' flood fill' operator.

Campbell Barton ideasman42 at gmail.com
Tue Oct 2 07:12:49 CEST 2012


Revision: 51002
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51002
Author:   campbellbarton
Date:     2012-10-02 05:12:49 +0000 (Tue, 02 Oct 2012)
Log Message:
-----------
fix for crash in own recent masking commit with 'flood fill' operator.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/paint_mask.c
    trunk/blender/source/blender/editors/sculpt_paint/sculpt.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_mask.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_mask.c	2012-10-02 04:31:51 UTC (rev 51001)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_mask.c	2012-10-02 05:12:49 UTC (rev 51002)
@@ -54,6 +54,7 @@
 #include "WM_types.h"
 
 #include "ED_screen.h"
+#include "ED_sculpt.h"
 
 #include "paint_intern.h"
 #include "sculpt_intern.h" /* for undo push */
@@ -77,7 +78,9 @@
 static int mask_flood_fill_exec(bContext *C, wmOperator *op)
 {
 	ARegion *ar = CTX_wm_region(C);
+	struct Scene *scene = CTX_data_scene(C);
 	Object *ob = CTX_data_active_object(C);
+	struct MultiresModifierData *mmd = sculpt_multires_active(scene, ob);
 	PaintMaskFloodMode mode;
 	float value;
 	DerivedMesh *dm;
@@ -88,7 +91,9 @@
 	mode = RNA_enum_get(op->ptr, "mode");
 	value = RNA_float_get(op->ptr, "value");
 
-	dm = mesh_get_derived_final(CTX_data_scene(C), ob, CD_MASK_BAREMESH);
+	ED_sculpt_mask_layers_ensure(ob, mmd);
+
+	dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
 	pbvh = dm->getPBVH(ob, dm);
 	ob->sculpt->pbvh = pbvh;
 

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2012-10-02 04:31:51 UTC (rev 51001)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2012-10-02 05:12:49 UTC (rev 51002)
@@ -4267,7 +4267,7 @@
 		paint_cursor_start(C, sculpt_poll);
 	}
 
-	WM_event_add_notifier(C, NC_SCENE | ND_MODE, CTX_data_scene(C));
+	WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene);
 
 	return OPERATOR_FINISHED;
 }




More information about the Bf-blender-cvs mailing list