Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-10-02 09:12:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-02 09:12:49 +0400
commit636a8d49a67b453fef2693c602966c1c115168fc (patch)
tree0d7123664dfd4ecae4a0bf04fafb355f89d51f63
parent16c4795e96f6dd7674dbcc3b44bd7b629237a81c (diff)
fix for crash in own recent masking commit with 'flood fill' operator.
-rw-r--r--source/blender/editors/sculpt_paint/paint_mask.c7
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index e309bdb99cb..697d7c63d1f 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -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 void mask_flood_fill_set_elem(float *elem,
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 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
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;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 5f17d44a881..ec0478d128f 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4267,7 +4267,7 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *UNUSED(op))
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;
}