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:
authorAntony Riakiotakis <kalast@gmail.com>2014-04-02 18:33:47 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-04-03 01:39:42 +0400
commit03bd418d1610da28258d361180f6eae2d8be671c (patch)
treea5a40d8e533f2be067ed2c526f6c1858be306fb1 /source/blender/editors/sculpt_paint/paint_mask.c
parenta58814acf5567207478b030d1dafa6ad65b67496 (diff)
Fix T39517,
Issue here is that "show diffuse" option does not respect its intended purpose which is to be used only for masking. There are a couple of caveats here: Dyntopo and multires -always- have mask data enabled, and thus as soon as one goes to dyntopo mode or adds a multires modifier he would get the default grey color instead. Matcaps would break when nodes asked for a diffuse material color (this was broken before too). Solved by adding global material state for when matcaps are enabled. Also matcaps don't always played well with VBOs off. Added a few more missing updates for mask operators to notify show_diffuse property as changed. This was also needed on rebuilding dyntopo pbvh. Also make zero mask color duller again after artist feedback.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_mask.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_mask.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index dc0c097c558..a222c7249f7 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -94,9 +94,7 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
PBVH *pbvh;
PBVHNode **nodes;
int totnode, i;
-#ifdef _OPENMP
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
-#endif
mode = RNA_enum_get(op->ptr, "mode");
value = RNA_float_get(op->ptr, "value");
@@ -107,6 +105,9 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
pbvh = dm->getPBVH(ob, dm);
ob->sculpt->pbvh = pbvh;
+ ob->sculpt->show_diffuse_color = sd->flags & SCULPT_SHOW_DIFFUSE;
+ pbvh_show_diffuse_color_set(pbvh, ob->sculpt->show_diffuse_color);
+
BKE_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode);
sculpt_undo_push_begin("Mask flood fill");
@@ -218,6 +219,9 @@ int do_sculpt_mask_box_select(ViewContext *vc, rcti *rect, bool select, bool UNU
pbvh = dm->getPBVH(ob, dm);
ob->sculpt->pbvh = pbvh;
+ ob->sculpt->show_diffuse_color = sd->flags & SCULPT_SHOW_DIFFUSE;
+ pbvh_show_diffuse_color_set(pbvh, ob->sculpt->show_diffuse_color);
+
sculpt_undo_push_begin("Mask box fill");
for (symmpass = 0; symmpass <= symm; ++symmpass) {
@@ -362,6 +366,9 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
pbvh = dm->getPBVH(ob, dm);
ob->sculpt->pbvh = pbvh;
+ ob->sculpt->show_diffuse_color = sd->flags & SCULPT_SHOW_DIFFUSE;
+ pbvh_show_diffuse_color_set(pbvh, ob->sculpt->show_diffuse_color);
+
sculpt_undo_push_begin("Mask lasso fill");
for (symmpass = 0; symmpass <= symm; ++symmpass) {