Commit: 7122b05ac30d2c1d0854683c82c21b32633cb2b1
Author: Campbell Barton
Date:   Fri May 6 05:40:07 2016 +1000
Branches: master
https://developer.blender.org/rB7122b05ac30d2c1d0854683c82c21b32633cb2b1

Correct own mistake int recent transform API edits

Need to return number of enabled elements.

===================================================================

M       source/blender/bmesh/intern/bmesh_iterators.c

===================================================================

diff --git a/source/blender/bmesh/intern/bmesh_iterators.c 
b/source/blender/bmesh/intern/bmesh_iterators.c
index 1ee629d..a484c1b 100644
--- a/source/blender/bmesh/intern/bmesh_iterators.c
+++ b/source/blender/bmesh/intern/bmesh_iterators.c
@@ -260,9 +260,16 @@ int BM_iter_mesh_bitmap_from_filter(
        BMIter iter;
        BMElem *ele;
        int i;
+       int bitmap_enabled = 0;
 
        BM_ITER_MESH_INDEX (ele, &iter, bm, itype, i) {
-               BLI_BITMAP_SET(bitmap, i, test_fn(ele, user_data));
+               if (test_fn(ele, user_data)) {
+                       BLI_BITMAP_ENABLE(bitmap, i);
+                       bitmap_enabled++;
+               }
+               else {
+                       BLI_BITMAP_DISABLE(bitmap, i);
+               }
        }
 
        return i;
@@ -280,24 +287,24 @@ int BM_iter_mesh_bitmap_from_filter_tessface(
        BMIter iter;
        BMFace *f;
        int i;
-       int j = 0;
+       int bitmap_enabled = 0;
 
        BM_ITER_MESH_INDEX (f, &iter, bm, BM_FACES_OF_MESH, i) {
                if (test_fn(f, user_data)) {
-                       for (int A = 2; A < f->len; A++) {
-                               BLI_BITMAP_ENABLE(bitmap, j);
-                               j++;
+                       for (int tri = 2; tri < f->len; tri++) {
+                               BLI_BITMAP_ENABLE(bitmap, bitmap_enabled);
+                               bitmap_enabled++;
                        }
                }
                else {
-                       for (int A = 2; A < f->len; A++) {
-                               BLI_BITMAP_DISABLE(bitmap, j);
-                               j++;
+                       for (int tri = 2; tri < f->len; tri++) {
+                               BLI_BITMAP_DISABLE(bitmap, bitmap_enabled);
+                               bitmap_enabled++;
                        }
                }
        }
 
-       return j;
+       return bitmap_enabled;
 }
 
 /**

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to