[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29878] branches/soc-2010-nicolasbishop/ source/blender/blenlib/BLI_pbvh.h: Make mask opacity actually do something; I had forgotten to update the PBVH iterator to take mask opacity into account .

Nicholas Bishop nicholasbishop at gmail.com
Fri Jul 2 20:18:12 CEST 2010


Revision: 29878
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29878
Author:   nicholasbishop
Date:     2010-07-02 20:18:11 +0200 (Fri, 02 Jul 2010)

Log Message:
-----------
Make mask opacity actually do something; I had forgotten to update the PBVH iterator to take mask opacity into account.

Modified Paths:
--------------
    branches/soc-2010-nicolasbishop/source/blender/blenlib/BLI_pbvh.h

Modified: branches/soc-2010-nicolasbishop/source/blender/blenlib/BLI_pbvh.h
===================================================================
--- branches/soc-2010-nicolasbishop/source/blender/blenlib/BLI_pbvh.h	2010-07-02 17:52:22 UTC (rev 29877)
+++ branches/soc-2010-nicolasbishop/source/blender/blenlib/BLI_pbvh.h	2010-07-02 18:18:11 UTC (rev 29878)
@@ -251,8 +251,10 @@
 					if(vi.gridkey->mask) { \
 						int j; \
 						vi.mask_combined= 0; \
-						for(j=0; j<vi.gridkey->mask; ++j) \
-							vi.mask_combined+= GRIDELEM_MASK(vi.grid, vi.gridkey)[j]; \
+						for(j=0; j<vi.gridkey->mask; ++j) { \
+							CustomDataLayer *cdl= vi.vdata->layers + vi.pmask_first_layer + j; \
+							vi.mask_combined+= GRIDELEM_MASK(vi.grid, vi.gridkey)[j] * cdl->strength; \
+						} \
 						CLAMP(vi.mask_combined, 0, 1); \
 						if(vi.pmask_active_layer != -1) \
 							vi.mask_active= &GRIDELEM_MASK(vi.grid, \
@@ -269,9 +271,11 @@
 					if(vi.pmask_layer_count) { \
 						int j; \
 						vi.mask_combined= 0; \
-						for(j=0; j<vi.pmask_layer_count; ++j) \
+						for(j=0; j<vi.pmask_layer_count; ++j) { \
+							CustomDataLayer *cdl= vi.vdata->layers + vi.pmask_first_layer + j; \
 							vi.mask_combined+= \
-								((float*)vi.vdata->layers[vi.pmask_first_layer + j].data)[vi.vert_indices[vi.gx]]; \
+								((float*)cdl->data)[vi.vert_indices[vi.gx]] * cdl->strength; \
+						} \
 						CLAMP(vi.mask_combined, 0, 1); \
 						if(vi.pmask_active_layer != -1) \
 							vi.mask_active = &((float*)vi.vdata->layers[vi.pmask_active_layer].data)[vi.vert_indices[vi.gx]]; \





More information about the Bf-blender-cvs mailing list