correct own error in logic for skipping mask layers, inverted mask layers with zero...
authorCampbell Barton <ideasman42@gmail.com>
Mon, 16 Jul 2012 15:40:47 +0000 (15:40 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 16 Jul 2012 15:40:47 +0000 (15:40 +0000)
source/blender/blenkernel/intern/mask_rasterize.c
source/blender/editors/interface/interface_templates.c

index 7b84abc3d36302c771e02ad356c92c5c814fbd44..2fe1ffaae9e0e91749a7aedbd40b815e01a76841 100644 (file)
@@ -499,10 +499,10 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas
                unsigned int sf_vert_tot = 0;
                unsigned int tot_feather_quads = 0;
 
-               if (masklay->restrictflag & MASK_RESTRICT_RENDER || masklay->alpha == 0.0f) {
-                       MaskRasterLayer *layer = &mr_handle->layers[masklay_index];
-                       layer_bucket_init_dummy(layer);
-                       layer->alpha = 0.0f; /* signal to skip this layer */
+               if (masklay->restrictflag & MASK_RESTRICT_RENDER) {
+                       /* skip the layer */
+                       mr_handle->layers_tot--;
+                       masklay_index--;
                        continue;
                }
 
@@ -1002,11 +1002,7 @@ float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float x
                float value_layer;
 
                /* also used as signal for unused layer (when render is disabled) */
-               if (layer->alpha == 0.0f) {
-                       continue;
-               }
-
-               if (BLI_in_rctf_v(&layer->bounds, xy)) {
+               if (layer->alpha != 0.0f && BLI_in_rctf_v(&layer->bounds, xy)) {
                        value_layer = 1.0f - layer_bucket_depth_from_xy(layer, xy);
 
                        switch (layer->falloff) {
index 8832f32f43d9b885015e08f522bd69b69b18d0cf..4702253140a60b7da0754f1ab3614fde1a886eee 100644 (file)
@@ -2248,7 +2248,7 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
 
                uiBlockSetEmboss(block, UI_EMBOSSN);
                row = uiLayoutRow(split, TRUE);
-               uiItemR(row, itemptr, "alpha", 0, "", ICON_NONE); // enable when used
+               uiItemR(row, itemptr, "alpha", 0, "", ICON_NONE);
                uiItemR(row, itemptr, "hide", 0, "", 0);
                uiItemR(row, itemptr, "hide_select", 0, "", 0);
                uiItemR(row, itemptr, "hide_render", 0, "", 0);