replace VECCOPY and QUATCOPY with inline funcs.
[blender.git] / source / blender / editors / transform / transform.c
index 8699bc8..9c1d5ad 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
@@ -1543,10 +1541,11 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
                {
                        if (kmi->propvalue == TFM_MODAL_SNAP_INV_ON && kmi->val == KM_PRESS)
                        {
-                               if ((ELEM(kmi->type, LEFTCTRLKEY, RIGHTCTRLKEY) && event->ctrl) ||
-                                       (ELEM(kmi->type, LEFTSHIFTKEY, RIGHTSHIFTKEY) && event->shift) ||
-                                       (ELEM(kmi->type, LEFTALTKEY, RIGHTALTKEY) && event->alt) ||
-                                       (kmi->type == OSKEY && event->oskey)) {
+                               if ((ELEM(kmi->type, LEFTCTRLKEY, RIGHTCTRLKEY) &&   event->ctrl)  ||
+                                   (ELEM(kmi->type, LEFTSHIFTKEY, RIGHTSHIFTKEY) && event->shift) ||
+                                   (ELEM(kmi->type, LEFTALTKEY, RIGHTALTKEY) &&     event->alt)   ||
+                                   ((kmi->type == OSKEY) &&                         event->oskey) )
+                               {
                                        t->modifiers |= MOD_SNAP_INVERT;
                                }
                                break;
@@ -1691,8 +1690,8 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
                        values[0]= RNA_float_get(op->ptr, "value");
                }
 
-               QUATCOPY(t->values, values);
-               QUATCOPY(t->auto_values, values);
+               copy_v4_v4(t->values, values);
+               copy_v4_v4(t->auto_values, values);
                t->flag |= T_AUTOVALUES;
        }
 
@@ -1922,7 +1921,7 @@ static void protectedQuaternionBits(short protectflag, float *quat, float *oldqu
                        quat[3]= oldquat[3];
        }
        else {
-               /* quaternions get limited with euler... (compatability mode) */
+               /* quaternions get limited with euler... (compatibility mode) */
                float eul[3], oldeul[3], nquat[4], noldquat[4];
                float qlen;
 
@@ -2606,27 +2605,18 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) {
        }
        
        /* local constraint shouldn't alter center */
-       if (t->around == V3D_LOCAL) {
-               if (t->flag & T_OBJECT) {
-                       copy_v3_v3(center, td->center);
-               }
-               else if (t->flag & T_EDIT) {
-
-                       if(t->settings->selectmode & SCE_SELECT_FACE) {
-                               copy_v3_v3(center, td->center);
-                       }
-                       else {
-                               copy_v3_v3(center, t->center);
-                       }
-               }
-               else {
-                       copy_v3_v3(center, t->center);
-               }
+       if ((t->around == V3D_LOCAL) &&
+               (   (t->flag & (T_OBJECT|T_POSE)) ||
+                   ((t->flag & T_EDIT) && (t->settings->selectmode & SCE_SELECT_FACE)) ||
+                   (t->obedit && t->obedit->type == OB_ARMATURE))
+               )
+       {
+               copy_v3_v3(center, td->center);
        }
        else {
                copy_v3_v3(center, t->center);
        }
-       
+
        if (td->ext) {
                float fsize[3];
                
@@ -2902,10 +2892,10 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short
 
        /* local constraint shouldn't alter center */
        if (around == V3D_LOCAL) {
-               if (t->flag & (T_OBJECT|T_POSE)) {
-                       center = td->center;
-               }
-               else if (t->settings->selectmode & SCE_SELECT_FACE) {
+               if (    (t->flag & (T_OBJECT|T_POSE)) ||
+                       (t->settings->selectmode & SCE_SELECT_FACE) ||
+                       (t->obedit && t->obedit->type == OB_ARMATURE))
+               {
                        center = td->center;
                }
        }