Added a NO_NOR_RECALC context flag. With Individual extrude, the normals are already...
authorMartin Poirier <theeth@yahoo.com>
Mon, 4 Apr 2005 02:16:56 +0000 (02:16 +0000)
committerMartin Poirier <theeth@yahoo.com>
Mon, 4 Apr 2005 02:16:56 +0000 (02:16 +0000)
Cosmetic changes, renamed CTX_NOPET to CTX_NO_PET

CKey during transform now clears the constraint.

source/blender/include/BIF_transform.h
source/blender/src/editarmature.c
source/blender/src/editcurve.c
source/blender/src/editmball.c
source/blender/src/editmesh_add.c
source/blender/src/editmesh_tools.c
source/blender/src/transform.c
source/blender/src/transform_generics.c

index f823193dcc6812c98b980a53bf56cb0a86c95399..44b90991d9ff3fac9b3a323b210b43cff447f96b 100755 (executable)
 #define TFM_PUSHPULL           12
 
 /* TRANSFORM CONTEXTS */
-#define CTX_NONE               0
-#define CTX_TEXTURE            1
-#define CTX_EDGE               2
-#define CTX_NOPET              4
+#define CTX_NONE                       0
+#define CTX_TEXTURE                    1
+#define CTX_EDGE                       2
+#define CTX_NO_PET                     4
+#define CTX_NO_NOR_RECALC      8
 
 /* TRANSFORM PROPORTIONAL FALLOFF MODES */
 #define PROP_SHARP             0
index 9cd54a3a257e8eba164fd063e2e80a310849a4bd..2c5dfd08ce7f851c03cb8c8ab7f1d2713a0a8d37 100644 (file)
@@ -1999,7 +1999,7 @@ void extrude_armature(void)
        
        /* Transform the endpoints */
        countall();
-       Transform(TFM_TRANSLATION, CTX_NOPET);
+       Transform(TFM_TRANSLATION, CTX_NO_PET);
        allqueue(REDRAWBUTSEDIT, 0);
        allqueue(REDRAWBUTSOBJECT, 0);
        allqueue(REDRAWOOPS, 0);
@@ -2163,7 +2163,7 @@ void adduplicate_armature(void)
        }
 
 
-       Transform(TFM_TRANSLATION, CTX_NOPET);
+       Transform(TFM_TRANSLATION, CTX_NO_PET);
        allqueue(REDRAWBUTSEDIT, 0);
        allqueue(REDRAWBUTSOBJECT, 0);
        allqueue(REDRAWOOPS, 0);
index 0e3c19740d05bae105189573eb87bc4079c84393..ec956b8e9912eee628845825d26b4b192dbb23f3 100644 (file)
@@ -2793,7 +2793,7 @@ void addvert_Nurb(int mode)
        allqueue(REDRAWVIEW3D, 0);
        allqueue(REDRAWBUTSEDIT, 0);
 
-       if(mode=='e') Transform(TFM_TRANSLATION, CTX_NOPET);
+       if(mode=='e') Transform(TFM_TRANSLATION, CTX_NO_PET);
        else while(get_mbut()&R_MOUSE) BIF_wait_for_statechange();
 
        if(mode!='e') {
@@ -2830,7 +2830,7 @@ void extrude_nurb()
                                makeDispList(G.obedit);
                                BIF_undo_push("Extrude");
                                countall();
-                               Transform(TFM_TRANSLATION, CTX_NOPET);
+                               Transform(TFM_TRANSLATION, CTX_NO_PET);
                        }
                }
        }
@@ -3058,7 +3058,7 @@ void adduplicate_nurb()
        adduplicateflagNurb(1);
 
        countall();
-       Transform(TFM_TRANSLATION, CTX_NOPET);
+       Transform(TFM_TRANSLATION, CTX_NO_PET);
 }
 
 void delNurb()
index 0cb3cb1b3b99bb1ec7e04e75ab017e37bfb93597..39b4fd4b99be66ca291b5bd903bde7bdac4892b3 100644 (file)
@@ -307,7 +307,7 @@ void adduplicate_mball()
                ml= ml->prev;
        }
        
-       Transform(TFM_TRANSLATION, CTX_NOPET);
+       Transform(TFM_TRANSLATION, CTX_NO_PET);
        allqueue(REDRAWBUTSEDIT, 0);
 }
 
index f2112e997d6520c53ff6d0099af33e10dd59af61..a86fd23cbae63ff008d62f621549cb92e872cb9c 100644 (file)
@@ -437,7 +437,7 @@ void adduplicate_mesh(void)
 
        waitcursor(0);
        countall(); 
-       Transform(TFM_TRANSLATION, CTX_NOPET);
+       Transform(TFM_TRANSLATION, CTX_NO_PET);
 }
 
 
index 64538e04c70c987e045094853370caffee3e793d..6b9a4a26a446df715a53427105caa659df0c9539 100644 (file)
@@ -561,7 +561,7 @@ void extrude_mesh(void)
                
                /* individual faces? */
                if(nr==2) {
-                       Transform(TFM_SHRINKFATTEN, CTX_NOPET);
+                       Transform(TFM_SHRINKFATTEN, CTX_NO_PET|CTX_NO_NOR_RECALC);
                }
                else {
                        if(transmode=='n') {
@@ -569,7 +569,7 @@ void extrude_mesh(void)
                                VecSubf(nor, nor, G.obedit->obmat[3]);
                                BIF_setSingleAxisConstraint(nor, NULL);
                        }
-                       Transform(TFM_TRANSLATION, CTX_NOPET);
+                       Transform(TFM_TRANSLATION, CTX_NO_PET);
                }
        }
 
index 23f4774b3accc149a8edb8bfd80e1f3e5da200da..2c3c2fa5c1b6103abe4ea6c1de54fb0c8a7648ab 100755 (executable)
@@ -1426,7 +1426,8 @@ static void createTransData(TransInfo *t)
        else if (G.obedit) {
                t->ext = NULL;
                if (G.obedit->type == OB_MESH) {
-                       if(t->mode==TFM_SHRINKFATTEN) vertexnormals(0);
+                       if(t->mode==TFM_SHRINKFATTEN && (t->context & CTX_NO_NOR_RECALC)==0)
+                               vertexnormals(0);
                        createTransEditVerts(t);        
                }
                else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
@@ -1655,6 +1656,10 @@ void Transform(int mode, int context)
                                        }
                                        Trans.redraw = 1;
                                        break;
+                               case CKEY:
+                                       stopConstraint(&Trans);
+                                       Trans.redraw = 1;
+                                       break;
                                case XKEY:
                                        if ((Trans.flag & T_NO_CONSTRAINT)==0) {
                                                if (cmode == 'X') {
index 2fed8368c91973a7cdd959d5e9b428815d2d80f0..31641962ced552f210b39d8a031b81d19e8040f7 100755 (executable)
@@ -388,7 +388,7 @@ void initTrans (TransInfo *t)
        t->flag = 0;
 
        /* setting PET flag */
-       if ((t->context & CTX_NOPET) == 0 && (G.f & G_PROPORTIONAL)) {
+       if ((t->context & CTX_NO_PET) == 0 && (G.f & G_PROPORTIONAL)) {
                t->flag |= T_PROP_EDIT;
        }