Revision: 18566
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18566
Author:   theeth
Date:     2009-01-18 22:36:38 +0100 (Sun, 18 Jan 2009)

Log Message:
-----------
2.5

Transform orientations (Alt-Space and in header)

enum for transform operator parameter.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h
    
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c
    branches/blender2.5/blender/source/blender/editors/transform/transform.c
    branches/blender2.5/blender/source/blender/editors/transform/transform.h
    
branches/blender2.5/blender/source/blender/editors/transform/transform_constraints.c
    
branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
    
branches/blender2.5/blender/source/blender/editors/transform/transform_manipulator.c
    branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c
    
branches/blender2.5/blender/source/blender/editors/transform/transform_orientations.c

Modified: 
branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h  
2009-01-18 19:12:13 UTC (rev 18565)
+++ branches/blender2.5/blender/source/blender/editors/include/BIF_transform.h  
2009-01-18 21:36:38 UTC (rev 18566)
@@ -96,7 +96,6 @@
 struct Base;
 struct Scene;
 
-struct TransInfo * BIF_GetTransInfo(void);
 void BIF_setSingleAxisConstraint(float vec[3], char *text);
 void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text);
 void BIF_setLocalAxisConstraint(char axis, char *text);
@@ -105,16 +104,17 @@
 int BIF_snappingSupported(struct Object *obedit);
 
 struct TransformOrientation;
+struct bContext;
 
-void BIF_clearTransformOrientation(void);
-void BIF_removeTransformOrientation(struct TransformOrientation *ts);
-void BIF_manageTransformOrientation(int confirm, int set);
+void BIF_clearTransformOrientation(struct bContext *C);
+void BIF_removeTransformOrientation(struct bContext *C, struct 
TransformOrientation *ts);
+void BIF_manageTransformOrientation(struct bContext *C, int confirm, int set);
 int BIF_menuselectTransformOrientation(void);
-void BIF_selectTransformOrientation(struct TransformOrientation *ts);
-void BIF_selectTransformOrientationFromIndex(int index);
+void BIF_selectTransformOrientation(struct bContext *C, struct 
TransformOrientation *ts);
+void BIF_selectTransformOrientationValue(struct bContext *C, int orientation);
 
-char * BIF_menustringTransformOrientation(char *title); /* the returned value 
was allocated and needs to be freed after use */
-int BIF_countTransformOrientation();
+char * BIF_menustringTransformOrientation(const struct bContext *C, char 
*title); /* the returned value was allocated and needs to be freed after use */
+int BIF_countTransformOrientation(const struct bContext *C);
 
 void BIF_getPropCenter(float *center);
 

Modified: 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c 
    2009-01-18 19:12:13 UTC (rev 18565)
+++ 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c 
    2009-01-18 21:36:38 UTC (rev 18566)
@@ -5821,7 +5821,7 @@
                        xco+= XIC+10;
                } else {
                        /* Manipulators arnt used in weight paint mode */
-// XXX                         char *str_menu;
+                       char *str_menu;
                        uiDefIconTextButS(block, ICONTEXTROW,B_AROUND, 
ICON_ROTATE, around_pup(C), xco,yco,XIC+10,YIC, &(v3d->around), 0, 3.0, 0, 0, 
"Rotation/Scaling Pivot (Hotkeys: Comma, Shift Comma, Period, Ctrl Period, Alt 
Period)");
 
                        xco+= XIC+10;
@@ -5865,13 +5865,13 @@
                                xco+= XIC;
                        }
                        
-// XXX                 if (v3d->twmode > (BIF_countTransformOrientation() - 1) 
+ V3D_MANIP_CUSTOM) {
-//                             v3d->twmode = 0;
-//                     }
+                       if (v3d->twmode > (BIF_countTransformOrientation(C) - 
1) + V3D_MANIP_CUSTOM) {
+                               v3d->twmode = 0;
+                       }
                        
-// XXX                 str_menu = 
BIF_menustringTransformOrientation("Orientation");
-//                     uiDefButS(block, MENU, B_MAN_MODE, 
str_menu,xco,yco,70,YIC, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation 
(ALT+Space)");
-//                     MEM_freeN(str_menu);
+                       str_menu = BIF_menustringTransformOrientation(C, 
"Orientation");
+                       uiDefButS(block, MENU, B_MAN_MODE, 
str_menu,xco,yco,70,YIC, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation 
(ALT+Space)");
+                       MEM_freeN(str_menu);
                        
                        xco+= 70;
                        uiBlockEndAlign(block);

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/transform/transform.c    
2009-01-18 19:12:13 UTC (rev 18565)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform.c    
2009-01-18 21:36:38 UTC (rev 18566)
@@ -990,6 +990,8 @@
        t->mode = mode;
 
        initTransInfo(C, t, event);                                     // 
internal data, mouse, vectors
+       
+       initTransformOrientation(C, t);
 
        if(t->spacetype == SPACE_VIEW3D)
        {

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/transform/transform.h    
2009-01-18 19:12:13 UTC (rev 18565)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform.h    
2009-01-18 21:36:38 UTC (rev 18566)
@@ -307,8 +307,7 @@
 #define CON_AXIS2              8
 #define CON_SELECT             16
 #define CON_NOFLIP             32      /* does not reorient vector to face 
viewport when on */
-#define CON_LOCAL              64
-#define CON_USER               128
+#define CON_USER               64
 
 /* transdata->flag */
 #define TD_SELECTED                    1
@@ -577,19 +576,21 @@
 #define NDOF_CANCEL            4
 
 
-/*********************** TransSpace ******************************/
+/*********************** Transform Orientations ******************************/
 
-int manageObjectSpace(int confirm, int set);
-int manageMeshSpace(int confirm, int set);
-int manageBoneSpace(int confirm, int set);
+void initTransformOrientation(struct bContext *C, TransInfo *t);
 
+int manageObjectSpace(struct bContext *C, int confirm, int set);
+int manageMeshSpace(struct bContext *C, int confirm, int set);
+int manageBoneSpace(struct bContext *C, int confirm, int set);
+
 /* Those two fill in mat and return non-zero on success */
 int createSpaceNormal(float mat[3][3], float normal[3]);
 int createSpaceNormalTangent(float mat[3][3], float normal[3], float 
tangent[3]);
 
-int addMatrixSpace(float mat[3][3], char name[]);
-int addObjectSpace(struct Object *ob);
-void applyTransformOrientation(void);
+int addMatrixSpace(struct bContext *C, float mat[3][3], char name[]);
+int addObjectSpace(struct bContext *C, struct Object *ob);
+void applyTransformOrientation(struct bContext *C, TransInfo *t);
 
 
 #define ORIENTATION_NONE       0

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform_constraints.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/transform/transform_constraints.c
        2009-01-18 19:12:13 UTC (rev 18565)
+++ 
branches/blender2.5/blender/source/blender/editors/transform/transform_constraints.c
        2009-01-18 21:36:38 UTC (rev 18566)
@@ -490,16 +490,16 @@
        if (t->flag & T_EDIT) {
                float obmat[3][3];
                Mat3CpyMat4(obmat, t->scene->obedit->obmat);
-               setConstraint(t, obmat, mode|CON_LOCAL, text);
+               setConstraint(t, obmat, mode, text);
        }
        else {
                if (t->total == 1) {
-                       setConstraint(t, t->data->axismtx, mode|CON_LOCAL, 
text);
+                       setConstraint(t, t->data->axismtx, mode, text);
                }
                else {
                        strncpy(t->con.text + 1, text, 48);
                        Mat3CpyMat3(t->con.mtx, t->data->axismtx);
-                       t->con.mode = mode|CON_LOCAL;
+                       t->con.mode = mode;
                        getConstraintMatrix(t);
 
                        startConstraint(t);
@@ -869,7 +869,6 @@
        Mat3CpyMat3(t->con.mtx, mtx);
        t->con.mode |= CON_APPLY;
        t->con.mode |= CON_SELECT;
-       t->con.mode &= ~CON_LOCAL;
 
        setNearestAxis(t);
        t->con.drawExtra = NULL;

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
        2009-01-18 19:12:13 UTC (rev 18565)
+++ 
branches/blender2.5/blender/source/blender/editors/transform/transform_conversions.c
        2009-01-18 21:36:38 UTC (rev 18566)
@@ -1553,8 +1553,7 @@
 
 static void createTransLatticeVerts(bContext *C, TransInfo *t)
 {
-       // TRANSFORM_FIX_ME
-#if 0
+       Lattice *latt = ((Lattice*)t->obedit->data)->editlatt;
        TransData *td = NULL;
        BPoint *bp;
        float mtx[3][3], smtx[3][3];
@@ -1562,8 +1561,8 @@
        int count=0, countsel=0;
        int propmode = t->flag & T_PROP_EDIT;
 
-       bp= editLatt->def;
-       a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
+       bp = latt->def;
+       a  = latt->pntsu * latt->pntsv * latt->pntsw;
        while(a--) {
                if(bp->hide==0) {
                        if(bp->f1 & SELECT) countsel++;
@@ -1583,8 +1582,8 @@
        Mat3Inv(smtx, mtx);
 
        td = t->data;
-       bp= editLatt->def;
-       a= editLatt->pntsu*editLatt->pntsv*editLatt->pntsw;
+       bp = latt->def;
+       a  = latt->pntsu * latt->pntsv * latt->pntsw;
        while(a--) {
                if(propmode || (bp->f1 & SELECT)) {
                        if(bp->hide==0) {
@@ -1606,7 +1605,6 @@
                }
                bp++;
        }
-#endif
 }
 
 /* ******************* particle edit **************** */
@@ -2342,8 +2340,8 @@
 
 static void createTransUVs(bContext *C, TransInfo *t)
 {
-       // TRANSFORM_FIX_ME
-#if 0
+#if 0 // TRANSFORM_FIX_ME
+       SpaceImage *sima = (SpaceImage*)CTX_wm_space_data(C);
        TransData *td = NULL;
        TransData2D *td2d = NULL;
        MTFace *tf;
@@ -2357,7 +2355,7 @@
        if(is_uv_tface_editing_allowed()==0) return;
 
        /* count */
-       if (G.sima->flag & SI_BE_SQUARE && !propmode) {
+       if (sima->flag & SI_BE_SQUARE && !propmode) {
                for (efa= em->faces.first; efa; efa= efa->next) {
                        /* store face pointer for second loop, prevent second 
lookup */
                        tf= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
@@ -2409,13 +2407,13 @@
           treated just as if they were 3d verts */
        t->data2d= MEM_callocN(t->total*sizeof(TransData2D), "TransObData2D(UV 
Editing)");
 
-       if(G.sima->flag & SI_CLIP_UV)
+       if(sima->flag & SI_CLIP_UV)
                t->flag |= T_CLIP_UV;
 
        td= t->data;
        td2d= t->data2d;
        
-       if (G.sima->flag & SI_BE_SQUARE && !propmode) {
+       if (sima->flag & SI_BE_SQUARE && !propmode) {
                for (efa= em->faces.first; efa; efa= efa->next) {
                        tf=(MTFace *)efa->tmp.p;
                        if (tf) {
@@ -2474,7 +2472,7 @@
                }
        }
        
-       if (G.sima->flag & SI_LIVE_UNWRAP)
+       if (sima->flag & SI_LIVE_UNWRAP)
                unwrap_lscm_live_begin();
 #endif
 }

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform_manipulator.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/transform/transform_manipulator.c
        2009-01-18 19:12:13 UTC (rev 18565)
+++ 
branches/blender2.5/blender/source/blender/editors/transform/transform_manipulator.c
        2009-01-18 21:36:38 UTC (rev 18566)
@@ -219,7 +219,7 @@
        float plane[3]={0.0, 0.0, 0.0};
        int a, totsel=0;
 
-       t = BIF_GetTransInfo();
+//XXX  t = BIF_GetTransInfo();
        
        /* transform widget matrix */
        Mat4One(v3d->twmat);

Modified: 
branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c
===================================================================

@@ Diff output truncated at 10240 characters. @@

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

Reply via email to