Revision: 41436
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41436
Author:   campbellbarton
Date:     2011-11-01 09:48:20 +0000 (Tue, 01 Nov 2011)
Log Message:
-----------
rename BM_FLIPPED --> BM_TMP_TAG to use as a temp tag anywhere.

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/bmesh/bmesh.h
    branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c
    branches/bmesh/blender/source/blender/bmesh/operators/utils.c

Modified: branches/bmesh/blender/source/blender/bmesh/bmesh.h
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/bmesh.h 2011-11-01 09:47:41 UTC 
(rev 41435)
+++ branches/bmesh/blender/source/blender/bmesh/bmesh.h 2011-11-01 09:48:20 UTC 
(rev 41436)
@@ -103,9 +103,13 @@
 #define BM_SHARP       (1<<4)
 #define BM_SMOOTH      (1<<5)
 #define BM_ACTIVE      (1<<6)
-#define BM_NONORMCALC  (1<<7)
-#define BM_FLIPPED     (1<<8) /*internal flag, used for ensuring correct 
normals during multires interpolation*/
+#define BM_TMP_TAG     (1<<7) /* internal flag, used for ensuring correct 
normals
+                            * during multires interpolation, and any other time
+                            * when temp tagging is handy.
+                            * always assume dirty & clear before use. */
 
+/* #define BM_NONORMCALC (1<<8) */ /* UNUSED */
+
 #include "bmesh_class.h"
 
 /*stub */

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c     
2011-11-01 09:47:41 UTC (rev 41435)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_mesh.c     
2011-11-01 09:48:20 UTC (rev 41436)
@@ -207,8 +207,10 @@
        BM_ITER(f, &faces, bm, BM_FACES_OF_MESH, NULL) {
                if (BM_TestHFlag(f, BM_HIDDEN))
                        continue;
+#if 0  /* UNUSED */
                if (f->head.flag & BM_NONORMCALC)
                        continue;
+#endif
 
                bmesh_update_face_normal(bm, f, projectverts);          
        }
@@ -285,7 +287,7 @@
 
 /*
  This function ensures correct normals for the mesh, but
- sets the flag BM_FLIPPED in flipped faces, to allow restoration
+ sets the flag BM_TMP_TAG in flipped faces, to allow restoration
  of original normals.
  
  if undo is 0: calculate right normals
@@ -300,10 +302,10 @@
        
        if (undo) {
                BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
-                       if (BM_TestHFlag(f, BM_FLIPPED)) {
+                       if (BM_TestHFlag(f, BM_TMP_TAG)) {
                                BM_flip_normal(bm, f);
                        }
-                       BM_ClearHFlag(f, BM_FLIPPED);
+                       BM_ClearHFlag(f, BM_TMP_TAG);
                }
                
                return;
@@ -316,8 +318,8 @@
        
        BM_ITER(f, &iter, bm, BM_FACES_OF_MESH, NULL) {
                if (BMO_TestFlag(bm, f, FACE_FLIP))
-                       BM_SetHFlag(f, BM_FLIPPED);
-               else BM_ClearHFlag(f, BM_FLIPPED);
+                       BM_SetHFlag(f, BM_TMP_TAG);
+               else BM_ClearHFlag(f, BM_TMP_TAG);
        }
 
        BMO_pop(bm);

Modified: branches/bmesh/blender/source/blender/bmesh/operators/utils.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/operators/utils.c       
2011-11-01 09:47:41 UTC (rev 41435)
+++ branches/bmesh/blender/source/blender/bmesh/operators/utils.c       
2011-11-01 09:48:20 UTC (rev 41436)
@@ -252,6 +252,8 @@
 /* NOTE: this function uses recursion, which is a little unusual for a bmop
          function, but acceptable I think. */
 
+/* NOTE: BM_TMP_TAG is used on faces to tell if they are flipped. */
+
 void bmesh_righthandfaces_exec(BMesh *bm, BMOperator *op)
 {
        BMIter liter, liter2;
@@ -269,6 +271,10 @@
 
        /*find a starting face*/
        BMO_ITER(f, &siter, bm, op, "faces", BM_FACE) {
+
+               /* clear dirty flag */
+               BM_ClearHFlag(f, BM_TMP_TAG);
+
                if (BMO_TestFlag(bm, f, FACE_VIS))
                        continue;
 
@@ -293,7 +299,7 @@
                BMO_ToggleFlag(bm, startf, FACE_FLIP);
 
                if (flagflip)
-                       BM_ToggleHFlag(startf, BM_FLIPPED);
+                       BM_ToggleHFlag(startf, BM_TMP_TAG);
        }
        
        /*now that we've found our starting face, make all connected faces
@@ -325,11 +331,11 @@
                                                
                                                BMO_ToggleFlag(bm, l2->f, 
FACE_FLIP);
                                                if (flagflip)
-                                                       BM_ToggleHFlag(l2->f, 
BM_FLIPPED);
-                                       } else if (BM_TestHFlag(l2->f, 
BM_FLIPPED) || BM_TestHFlag(l->f, BM_FLIPPED)) {
+                                                       BM_ToggleHFlag(l2->f, 
BM_TMP_TAG);
+                                       } else if (BM_TestHFlag(l2->f, 
BM_TMP_TAG) || BM_TestHFlag(l->f, BM_TMP_TAG)) {
                                                if (flagflip) {
-                                                       BM_ClearHFlag(l->f, 
BM_FLIPPED);
-                                                       BM_ClearHFlag(l2->f, 
BM_FLIPPED);
+                                                       BM_ClearHFlag(l->f, 
BM_TMP_TAG);
+                                                       BM_ClearHFlag(l2->f, 
BM_TMP_TAG);
                                                }
                                        }
                                        

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to