Added UV face rotate and mirror to editmode and re arranged some of the editmode...
authorCampbell Barton <ideasman42@gmail.com>
Wed, 12 Sep 2007 10:35:48 +0000 (10:35 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 12 Sep 2007 10:35:48 +0000 (10:35 +0000)
The WKey menu was way too big and not well organized, re-arranged keys like this.

Ctrl+V - Vert Menu  (remove doubles, smooth...)
Ctrl+E - Edge Menu - left as is
Ctrl+F - Face Menu - (flip normals, shading, Rotate and Mirror UV's/Colors)

Wkey menu only has subdivide in it now.

filesel.c - only show the relative paths option if the file is saved, (flag on by default caused the image to silently fail loading on my system, and gave permission errors on a users), also removed a warning.

13 files changed:
source/blender/include/BIF_editmesh.h
source/blender/src/buttons_editing.c
source/blender/src/drawobject.c
source/blender/src/editface.c
source/blender/src/editmesh.c
source/blender/src/editmesh_mods.c
source/blender/src/editmesh_tools.c
source/blender/src/editobject.c
source/blender/src/filelist.c
source/blender/src/filesel.c
source/blender/src/header_view3d.c
source/blender/src/space.c
source/blender/src/unwrapper.c

index 1ef526cb55fb6322d84b084c0d0f0b11aa12fb37..fc9437aecc9970ec0a9453469840cd1d4a253422 100644 (file)
@@ -171,7 +171,9 @@ extern void selectrandom_mesh(void);
 extern void editmesh_select_by_material(int index);
 extern void editmesh_deselect_by_material(int index);
 
+extern void Vertex_Menu(void);
 extern void Edge_Menu(void);
+extern void Face_Menu(void);
 extern void select_mesh_group_menu(void);
 extern void editmesh_mark_seam(int clear);
 extern void loop_multiselect(int looptype);
@@ -219,6 +221,10 @@ extern void edge_flip(void);
 extern void fill_mesh(void);
 extern void bevel_menu();
 extern void mesh_set_smooth_faces(short event);
+extern void mesh_rotate_uvs(void);
+extern void mesh_mirror_uvs(void);
+extern void mesh_rotate_colors(void);
+extern void mesh_mirror_colors(void);
 void mesh_copy_menu(void);
 void edge_rotate_selected(int dir);
 int EdgeSlide(short immediate, float imperc);
@@ -247,5 +253,6 @@ UvMapVert *get_uv_map_vert_EM(UvVertMap *vmap, unsigned int v);
 void free_uv_vert_map_EM(UvVertMap *vmap);
 
 int EM_texFaceCheck(void); /* can we edit UV's for this mesh?*/
+int EM_vertColorCheck(void); /* can we edit colors for this mesh?*/
 
 #endif
index 8d60f73858c53973273670bfa43f6792f98569d2..b3310a7dad21fad6ac6e6b1c90a02a2a8be69072 100644 (file)
@@ -4364,9 +4364,9 @@ static void editing_panel_mesh_tools1(Object *ob, Mesh *me)
        if(uiNewPanel(curarea, block, "Mesh Tools 1", "Editing", 960, 0, 318, 204)==0) return;
 
        uiBlockBeginAlign(block);
-       uiDefBut(block, BUT,B_SELSWAP,  "Select Swap",  955, 200,  106, 19, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces");
-       uiDefBut(block, BUT,B_HIDE,             "Hide",         1061, 200, 106, 19, 0, 0, 0, 0, 0, "Hides selected faces");
-       uiDefBut(block, BUT,B_REVEAL,   "Reveal",               1167, 200,  107, 19, 0, 0, 0, 0, 0, "Reveals selected faces");
+       uiDefBut(block, BUT,B_SELSWAP,  "Select Swap",  955, 200,  106, 19, 0, 0, 0, 0, 0, "Selects unselected faces, and deselects selected faces (Ctrl+I)");
+       uiDefBut(block, BUT,B_HIDE,             "Hide",         1061, 200, 106, 19, 0, 0, 0, 0, 0, "Hides selected faces (H)");
+       uiDefBut(block, BUT,B_REVEAL,   "Reveal",               1167, 200,  107, 19, 0, 0, 0, 0, 0, "Reveals selected faces (Alt H)");
        uiBlockEndAlign(block);
 
        uiBlockBeginAlign(block);
index fa6a3938f3cdb2c08b6a8fe701a0fd22fbc08bab..43a1ea6d0c1c7dfd68a630342e778420fb1110b2 100644 (file)
@@ -2082,7 +2082,7 @@ static void draw_em_fancy(Object *ob, EditMesh *em, DerivedMesh *cageDM, Derived
                                
                                
                        } else if(ese->type == EDITFACE) {
-                               EditFace *efa = (EditEdge*)ese->data;
+                               EditFace *efa = (EditFace*)ese->data;
                                
                                /*  repeate this pattern
                                   X000X000 
index 2a0a043295513174850f201e8656e4c8aafe9f14..48edf7e8096aec9b4909e6fe705438cfebc96cbc 100644 (file)
@@ -766,153 +766,6 @@ void selectswap_tface(void)
        object_tface_flags_changed(OBACT, 0);
 }
 
-void rotate_uv_tface()
-{
-       Mesh *me;
-       MFace *mf;
-       MCol *mcol;
-       MTFace *tf;
-       short mode;
-       int a;
-       
-       me= get_mesh(OBACT);
-       if(me==0 || me->mtface==0) return;
-       
-       mode= pupmenu("Rotate %t|UV Co-ordinates %x1|Vertex Colors %x2");
-
-       if (mode == 1 && me->mtface) {
-               tf= me->mtface;
-               mf= me->mface;
-               for(a=0; a<me->totface; a++, tf++, mf++) {
-                       if(mf->flag & ME_FACE_SEL) {
-                               float u1= tf->uv[0][0];
-                               float v1= tf->uv[0][1];
-                               
-                               tf->uv[0][0]= tf->uv[1][0];
-                               tf->uv[0][1]= tf->uv[1][1];
-       
-                               tf->uv[1][0]= tf->uv[2][0];
-                               tf->uv[1][1]= tf->uv[2][1];
-       
-                               if(mf->v4) {
-                                       tf->uv[2][0]= tf->uv[3][0];
-                                       tf->uv[2][1]= tf->uv[3][1];
-                               
-                                       tf->uv[3][0]= u1;
-                                       tf->uv[3][1]= v1;
-                               }
-                               else {
-                                       tf->uv[2][0]= u1;
-                                       tf->uv[2][1]= v1;
-                               }
-                       }
-               }
-
-               BIF_undo_push("Rotate UV face");
-               object_uvs_changed(OBACT);
-       }
-       else if (mode == 2 && me->mcol) {
-               tf= me->mtface;
-               mcol= me->mcol;
-               mf= me->mface;
-               for(a=0; a<me->totface; a++, tf++, mf++, mcol+=4) {
-                       if(mf->flag & ME_FACE_SEL) {
-                               MCol tmpcol= mcol[0];
-                               
-                               mcol[0]= mcol[1];
-                               mcol[1]= mcol[2];
-       
-                               if(mf->v4) {
-                                       mcol[2]= mcol[3];
-                                       mcol[3]= tmpcol;
-                               }
-                               else
-                                       mcol[2]= tmpcol;
-                       }
-               }
-
-               BIF_undo_push("Rotate color face");
-               object_uvs_changed(OBACT);
-       }
-}
-
-void mirror_uv_tface()
-{
-       Mesh *me;
-       MFace *mf;
-       MTFace *tf;
-       MCol *mcol;
-       short mode;
-       int a;
-       
-       me= get_mesh(OBACT);
-       if(me==0 || me->mtface==0) return;
-       
-       mode= pupmenu("Mirror %t|UV Co-ordinates %x1|Vertex Colors %x2");
-       
-       if (mode==1 && me->mtface) {
-               mf= me->mface;
-               tf= me->mtface;
-
-               for (a=0; a<me->totface; a++, tf++, mf++) {
-                       if(mf->flag & ME_FACE_SEL) {
-                               float u1= tf->uv[0][0];
-                               float v1= tf->uv[0][1];
-                               if(mf->v4) {
-                                       tf->uv[0][0]= tf->uv[3][0];
-                                       tf->uv[0][1]= tf->uv[3][1];
-                               
-                                       tf->uv[3][0]= u1;
-                                       tf->uv[3][1]= v1;
-
-                                       u1= tf->uv[1][0];
-                                       v1= tf->uv[1][1];
-
-                                       tf->uv[1][0]= tf->uv[2][0];
-                                       tf->uv[1][1]= tf->uv[2][1];
-                               
-                                       tf->uv[2][0]= u1;
-                                       tf->uv[2][1]= v1;
-                               }
-                               else {
-                                       tf->uv[0][0]= tf->uv[2][0];
-                                       tf->uv[0][1]= tf->uv[2][1];
-                                       tf->uv[2][0]= u1;
-                                       tf->uv[2][1]= v1;
-                               }
-                       }
-               }
-       }
-       else if(mode==2 && me->mcol) {
-               mf= me->mface;
-               tf= me->mtface;
-               mcol= me->mcol;
-
-               for (a=0; a<me->totface; a++, tf++, mf++, mcol+=4) {
-                       if(mf->flag & ME_FACE_SEL) {
-                               MCol tmpcol= mcol[0];
-
-                               if(mf->v4) {
-                                       mcol[0]= mcol[3];
-                                       mcol[3]= tmpcol;
-
-                                       tmpcol = mcol[1];
-                                       mcol[1]= mcol[2];
-                                       mcol[2]= tmpcol;
-                               }
-                               else {
-                                       mcol[0]= mcol[2];
-                                       mcol[2]= tmpcol;
-                               }
-                       }
-               }
-       }
-       
-       BIF_undo_push("Mirror UV face");
-
-       object_uvs_changed(OBACT);
-}
-
 int minmax_tface(float *min, float *max)
 {
        Object *ob;
index 4b7db1c1609ed58715c935c3d8c0cb989da6c262..fcfb1a5c40f4ddd05068bd1a59342a21b4ed1747 100644 (file)
@@ -2177,3 +2177,17 @@ int EM_texFaceCheck(void)
                return 1;
        return 0;
 }
+
+/* can we edit colors for this mesh?*/
+int EM_vertColorCheck(void)
+{
+       /* some of these checks could be a touch overkill */
+       if (    (G.obedit) &&
+                       (G.obedit->type == OB_MESH) &&
+                       (G.editMesh) &&
+                       (G.editMesh->faces.first) &&
+                       (CustomData_has_layer(&G.editMesh->fdata, CD_MCOL)))
+               return 1;
+       return 0;
+}
+
index 1c3d347288c204b0cd7cb95b63726f22c2ec7c7e..c4a13323624c5b22f01309e65f240ac463b8cd64 100644 (file)
@@ -3175,6 +3175,38 @@ void BME_Menu()  {
        }
 }
 
+
+
+void Vertex_Menu() {
+       short ret;
+       ret= pupmenu("Vertex Specials%t|Merge%x4|Remove Doubles%x5|Smooth %x10|Blend From Shape%x16|Propagate To All Shapes%x17|Select Vertex Path%x18");
+
+       switch(ret)
+       {
+               case 4:
+                       mergemenu();
+                       break;
+               case 5:
+                       notice("Removed %d Vertices", removedoublesflag(1, G.scene->toolsettings->doublimit));
+                       BIF_undo_push("Remove Doubles");
+                       break;
+               case 10:
+                       vertexsmooth();
+                       break;
+               case 16: 
+                       shape_copy_select_from();
+                       break;
+               case 17: 
+                       shape_propagate();
+                       break;
+               case 18:
+                       pathselect();
+                       BIF_undo_push("Select Vertex Path");
+                       break;
+       }
+}
+
+
 void Edge_Menu() {
        short ret;
 
@@ -3227,6 +3259,45 @@ void Edge_Menu() {
        }
 }
 
+void Face_Menu() {
+       short ret;
+       ret= pupmenu(
+               "Face Specials%t|Flip Normals %x1|Bevel %x2|Shade Smooth %x3|Shade Flat %x4|%l|"
+               "UV Rotate (Shift - CCW)%x10|UV Mirror (Shift - Switch Axis)%x11|"
+               "Color Rotate (Shift - CCW)%x12|Color Mirror (Shift - Switch Axis)%x13");
+
+       switch(ret)
+       {
+               case 1:
+                       flip_editnormals();
+                       BIF_undo_push("Flip Normals");
+                       break;
+               case 2:
+                       bevel_menu();
+                       break;
+               case 3:
+                       mesh_set_smooth_faces(1);
+                       break;
+               case 4:
+                       mesh_set_smooth_faces(0);
+                       break;
+                       
+               /* uv texface options */
+               case 10:
+                       mesh_rotate_uvs();
+                       break;
+               case 11:
+                       mesh_mirror_uvs();
+                       break;
+               case 12:
+                       mesh_rotate_colors();
+                       break;
+               case 13:
+                       mesh_mirror_colors();
+                       break;
+       }
+}
+
 
 /* **************** NORMALS ************** */
 
index 6cdc393d2c534bb6acb756150891840e1da75938..7dd116d0fad931916350036110d0fbbc98cd6e7d 100644 (file)
@@ -6500,3 +6500,172 @@ void loop_to_region(void)
        BIF_undo_push("Edge Loop to Face Region");
 }
 
+
+/* texface and vertex color editmode tools for the face menu */
+
+void mesh_rotate_uvs(void)
+{
+       EditMesh *em = G.editMesh;
+       EditFace *efa;
+       short change;
+       MTFace *tf;
+       float u1, v1;
+       
+       if (!EM_texFaceCheck()) {
+               error("mesh has no uv/image layers");
+               return;
+       }
+       
+       for(efa=em->faces.first; efa; efa=efa->next) {
+               if (efa->f & SELECT) {
+                       tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+                       u1= tf->uv[0][0];
+                       v1= tf->uv[0][1];
+                       
+                       tf->uv[0][0]= tf->uv[1][0];
+                       tf->uv[0][1]= tf->uv[1][1];
+
+                       tf->uv[1][0]= tf->uv[2][0];
+                       tf->uv[1][1]= tf->uv[2][1];
+                       
+                       if(efa->v4) {
+                               tf->uv[2][0]= tf->uv[3][0];
+                               tf->uv[2][1]= tf->uv[3][1];
+                       
+                               tf->uv[3][0]= u1;
+                               tf->uv[3][1]= v1;
+                       }
+                       else {
+                               tf->uv[2][0]= u1;
+                               tf->uv[2][1]= v1;
+                       }
+                       change = 1;
+               }
+       }
+       
+       if (change) {
+               allqueue(REDRAWVIEW3D, 0);
+               BIF_undo_push("Rotate UV face");
+       }
+}
+
+void mesh_mirror_uvs(void)
+{
+       EditMesh *em = G.editMesh;
+       EditFace *efa;
+       short change;
+       MTFace *tf;
+       float u1, v1;
+       
+       if (!EM_texFaceCheck()) {
+               error("mesh has no uv/image layers");
+               return;
+       }
+       
+       for(efa=em->faces.first; efa; efa=efa->next) {
+               if (efa->f & SELECT) {
+                       tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+                       u1= tf->uv[0][0];
+                       v1= tf->uv[0][1];
+                       if(efa->v4) {
+                               tf->uv[0][0]= tf->uv[3][0];
+                               tf->uv[0][1]= tf->uv[3][1];
+                       
+                               tf->uv[3][0]= u1;
+                               tf->uv[3][1]= v1;
+
+                               u1= tf->uv[1][0];
+                               v1= tf->uv[1][1];
+
+                               tf->uv[1][0]= tf->uv[2][0];
+                               tf->uv[1][1]= tf->uv[2][1];
+                       
+                               tf->uv[2][0]= u1;
+                               tf->uv[2][1]= v1;
+                       }
+                       else {
+                               tf->uv[0][0]= tf->uv[2][0];
+                               tf->uv[0][1]= tf->uv[2][1];
+                               tf->uv[2][0]= u1;
+                               tf->uv[2][1]= v1;
+                       }
+                       change = 1;
+               }
+       }
+       
+       if (change) {
+               allqueue(REDRAWVIEW3D, 0);
+               BIF_undo_push("Mirror UV face");
+       }
+}
+
+void mesh_rotate_colors(void)
+{
+       EditMesh *em = G.editMesh;
+       EditFace *efa;
+       short change;
+       MCol tmpcol, *mcol;
+       if (!EM_vertColorCheck()) {
+               error("mesh has no color layers");
+               return;
+       }
+       
+       for(efa=em->faces.first; efa; efa=efa->next) {
+               if (efa->f & SELECT) {
+                       mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
+                       tmpcol= mcol[0];
+                       
+                       mcol[0]= mcol[1];
+                       mcol[1]= mcol[2];
+
+                       if(efa->v4) {
+                               mcol[2]= mcol[3];
+                               mcol[3]= tmpcol;
+                       }
+                       else
+                               mcol[2]= tmpcol;
+                       change = 1;
+               }
+       }
+       
+       if (change) {
+               allqueue(REDRAWVIEW3D, 0);
+               BIF_undo_push("Rotate Color face");
+       }       
+}
+
+void mesh_mirror_colors(void)
+{
+       EditMesh *em = G.editMesh;
+       EditFace *efa;
+       short change;
+       MCol tmpcol, *mcol;
+       if (!EM_vertColorCheck()) {
+               error("mesh has no color layers");
+               return;
+       }
+       
+       for(efa=em->faces.first; efa; efa=efa->next) {
+               if (efa->f & SELECT) {
+                       mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
+                       tmpcol= mcol[0];
+                       
+                       mcol[0]= mcol[1];
+                       mcol[1]= mcol[2];
+
+                       if(efa->v4) {
+                               mcol[2]= mcol[3];
+                               mcol[3]= tmpcol;
+                       }
+                       else {
+                               mcol[2]= tmpcol;
+                       }
+                       change = 1;
+               }
+       }
+       
+       if (change) {
+               allqueue(REDRAWVIEW3D, 0);
+               BIF_undo_push("Mirror Color face");
+       }
+}
index 8a8f31e027d78b1e5294c5e77ef51c097248e8d8..360a3b0732cab1c8842d3ec76cb63f9a7f6298fd 100644 (file)
@@ -2350,8 +2350,7 @@ void special_editmenu(void)
                }
        }
        else if(G.obedit->type==OB_MESH) {
-
-               nr= pupmenu("Specials%t|Subdivide%x1|Subdivide Multi%x2|Subdivide Multi Fractal%x3|Subdivide Smooth%x12|Merge%x4|Remove Doubles%x5|Hide%x6|Reveal%x7|Select Swap%x8|Flip Normals %x9|Smooth %x10|Bevel %x11|Set Smooth %x14|Set Solid %x15|Blend From Shape%x16|Propagate To All Shapes%x17|Select Vertex Path%x18");
+               nr= pupmenu("Subdivide Mesh%t|Subdivide%x1|Subdivide Multi%x2|Subdivide Multi Fractal%x3|Subdivide Smooth%x4");
                
                switch(nr) {
                case 1:
@@ -2376,7 +2375,7 @@ void special_editmenu(void)
                        BIF_undo_push("Subdivide Fractal");
                        break;
                        
-               case 12:        /* smooth */
+               case 4: /* smooth */
                        /* if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; */
                        fac= 1.0f;
                        if(fbutton(&fac, 0.0f, 5.0f, 10, 10, "Smooth:")==0) return;
@@ -2386,49 +2385,6 @@ void special_editmenu(void)
                        esubdivideflag(1, fac, G.scene->toolsettings->editbutflag | B_SMOOTH, 1, 0);
                        BIF_undo_push("Subdivide Smooth");
                        break;          
-                       
-               case 4:
-                       mergemenu();
-                       break;
-               case 5:
-                       notice("Removed %d Vertices", removedoublesflag(1, G.scene->toolsettings->doublimit));
-                       BIF_undo_push("Remove Doubles");
-                       break;
-               case 6:
-                       hide_mesh(0);
-                       break;
-               case 7:
-                       reveal_mesh();
-                       break;
-               case 8:
-                       selectswap_mesh();
-                       break;
-               case 9:
-                       flip_editnormals();
-                       BIF_undo_push("Flip Normals");
-                       break;
-               case 10:
-                       vertexsmooth();
-                       break;
-               case 11:
-                       bevel_menu();
-                       break;
-               case 14:
-                       mesh_set_smooth_faces(1);
-                       break;
-               case 15: 
-                       mesh_set_smooth_faces(0);
-                       break;
-               case 16: 
-                       shape_copy_select_from();
-                       break;
-               case 17: 
-                       shape_propagate();
-                       break;
-               case 18:
-                       pathselect();
-                       BIF_undo_push("Select Vertex Path");
-                       break;
                }
                
                DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
@@ -3369,10 +3325,9 @@ void copy_attr_menu()
        
        if(!(ob=OBACT)) return;
        
-       if (G.obedit && ob->type == OB_MESH) {
-               mesh_copy_menu();
-               return;
-       } else {
+       if (G.obedit) {
+               if (ob->type == OB_MESH)
+                       mesh_copy_menu();
                return;
        }
        
index 5b46194d00cd688db1c8887094134c3ad1f719b6..7ada2afc69b8590b05b459ea4154ae9df056c6b9 100644 (file)
@@ -883,7 +883,7 @@ void BIF_filelist_from_library(struct FileList* filelist)
        }
 
        BLI_linklist_free(names, free);
-       if (previews) BLI_linklist_free(previews, MEM_freeN);
+       if (previews) BLI_linklist_free(previews, (void(*)(void*)) MEM_freeN);
 
        BIF_filelist_sort(filelist, FILE_SORTALPHA);
 
index 242c7c0a12cdcf0d932dee406ad5d356aad43814..f4b9d47becf7a538542a3053888d4c4e5416c784 100644 (file)
@@ -1189,8 +1189,10 @@ static void activate_fileselect_(int type, char *title, char *file, short *menup
        /* sfile->act is used for databrowse: double names of library objects */
        sfile->act= -1;
 
-       if(BLI_convertstringcode(name, G.sce, G.scene->r.cfra)) sfile->flag |= FILE_STRINGCODE;
-       else sfile->flag &= ~FILE_STRINGCODE;
+       if(G.relbase_valid && BLI_convertstringcode(name, G.sce, G.scene->r.cfra))
+               sfile->flag |= FILE_STRINGCODE;
+       else
+               sfile->flag &= ~FILE_STRINGCODE;
 
        if (U.uiflag & USER_HIDE_DOT)
                sfile->flag |= FILE_HIDE_DOT;
index bcbad9d28931f813af136c35cdd331074d5b7299..757af299e0e4a9570f7e2bab21ec15ff287b7939 100644 (file)
@@ -4385,126 +4385,6 @@ uiBlock *view3d_sculptmenu(void *arg_unused)
        return block;
 }
 
-static void do_view3d_facesel_propertiesmenu(void *arg, int event)
-{
-       MTFace *tf = get_active_tface(NULL, NULL);
-
-       if (tf) {
-               switch(event) {
-               case 0: /*      textured */
-                       tf->mode ^= TF_TEX;
-                       break;
-               case 1: /* tiled*/
-                       tf->mode ^= TF_TILES;
-                       break;
-               case 2: /* light */
-                       tf->mode ^= TF_LIGHT;
-                       break;
-               case 3: /* invisible */
-                       tf->mode ^= TF_INVISIBLE;
-                       break;
-               case 4: /* collision */
-                       tf->mode ^= TF_DYNAMIC;
-                       break;
-               case 5: /* shared vertex colors */
-                       tf->mode ^= TF_SHAREDCOL;
-                       break;
-               case 6: /* two sided */
-                       tf->mode ^= TF_TWOSIDE;
-                       break;
-               case 7: /* use object color */
-                       tf->mode ^= TF_OBCOL;
-                       break;
-               case 8: /* halo */
-                       tf->mode ^= TF_BILLBOARD;
-                       break;
-               case 9: /* billboard */
-                       tf->mode ^= TF_BILLBOARD2;
-                       break;
-               case 10: /* shadow */
-                       tf->mode ^= TF_SHADOW;
-                       break;
-               case 11: /* text */
-                       tf->mode ^= TF_BMFONT;
-                       break;
-               case 12: /* opaque blend mode */
-                       tf->transp = TF_SOLID;
-                       break;
-               case 13: /* additive blend mode */
-                       tf->transp |= TF_ADD;
-                       break;
-               case 14: /* alpha blend mode */
-                       tf->transp = TF_ALPHA;
-                       break;
-               }
-       }
-       allqueue(REDRAWVIEW3D, 0);
-       allqueue(REDRAWBUTSEDIT, 0);
-}
-
-static uiBlock *view3d_facesel_propertiesmenu(void *arg_unused)
-{
-       MTFace *tf = get_active_tface(NULL, NULL);
-       uiBlock *block;
-       short yco = 20, menuwidth = 120;
-
-       /* display ticks/crosses depending on active tface properties */
-
-       block= uiNewBlock(&curarea->uiblocks, "view3d_facesel_propertiesmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
-       uiBlockSetButmFunc(block, do_view3d_facesel_propertiesmenu, NULL);
-       
-       if (tf->mode & TF_TEX) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Textured",                  0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Textured",                                          0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
-       
-       if (tf->mode & TF_TILES) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Tiled",                   0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Tiled",                                             0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
-       
-       if (tf->mode & TF_LIGHT) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Light",                   0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Light",                                             0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
-       
-       if (tf->mode & TF_INVISIBLE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Invisible",                   0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Invisible",                                         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
-       
-       if (tf->mode & TF_DYNAMIC) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Collision",                     0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Collision",                                         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
-       
-       if (tf->mode & TF_SHAREDCOL) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Shared Vertex Colors",                        0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Shared Vertex Colors",                                              0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
-       
-       if (tf->mode & TF_TWOSIDE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Two Sided",                     0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Two Sided",                                         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
-       
-       if (tf->mode & TF_OBCOL) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Use Object Color",                        0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Use Object Color",                                          0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
-       
-       if (tf->mode & TF_BILLBOARD) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Halo",                        0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Halo",                                              0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
-       
-       if (tf->mode & TF_BILLBOARD2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Billboard",                  0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Billboard",                                         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
-               
-       if (tf->mode & TF_SHADOW) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Shadow",                 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Shadow",                                            0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
-       
-       if (tf->mode & TF_BMFONT) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Text",                   0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Text",                                              0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
-       
-       uiDefBut(block, SEPR, 0, "",                            0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-       
-       if (tf->transp == TF_SOLID) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Opaque Blend Mode",                    0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Opaque Blend Mode",                                         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");
-       
-       if (tf->transp == TF_ADD) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Additive Blend Mode",                    0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Additive Blend Mode",                                               0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, "");
-       
-       if (tf->transp == TF_ALPHA) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Alpha Blend Mode",                     0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
-       else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Alpha Blend Mode",                                          0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 14, "");
-
-       uiBlockSetDirection(block, UI_RIGHT);
-       uiTextBoundsBlock(block, 60);
-       return block;
-}
-
 static void do_view3d_facesel_showhidemenu(void *arg, int event)
 {
        switch(event) {
@@ -4542,59 +4422,14 @@ static uiBlock *view3d_facesel_showhidemenu(void *arg_unused)
 
 static void do_view3d_faceselmenu(void *arg, int event)
 {
-       /* code copied from buttons.c :(        
-               would be nice if it was split up into functions */
-       Mesh *me;
-       MTFace *tf, *activetf;
-       MFace *mf;
-       MCol *activemcol;
-       int a;
-       
        switch(event) {
-       case 0: /* copy draw mode */
-       case 1: /* copy UVs */
-       case 2: /* copy vertex colors */
-               me= get_mesh(OBACT);
-               activetf = get_active_tface(NULL, &activemcol);
-
-               if (me && activetf) {
-                       mf = me->mface;
-                       for (a=0, tf=me->mtface; a < me->totface; a++, tf++, mf++) {
-                               if(tf!=activetf && (mf->flag & ME_FACE_SEL)) {
-                                       if(event==0) {
-                                               tf->mode= activetf->mode;
-                                               tf->transp= activetf->transp;
-                                       } else if(event==1) {
-                                               memcpy(tf->uv, activetf->uv, sizeof(tf->uv));
-                                               tf->tpage= activetf->tpage;
-                                               tf->tile= activetf->tile;
-                                               
-                                               if(activetf->mode & TF_TILES) tf->mode |= TF_TILES;
-                                               else tf->mode &= ~TF_TILES;
-                                               
-                                       }
-                                       else if(event==2 && activemcol)
-                                               memcpy(&me->mcol[a*4], activemcol, sizeof(MCol)*4);
-                               }
-                       }
-
-                       do_shared_vertexcol(me);        
-               }
-               break;
-       case 3: /* set vertex colors */
+       case 0: /* set vertex colors */
                clear_vpaint_selectedfaces();
                break;
-       /*case 8: uv calculation - removed */
-       case 7: /* rotate UVs */
-               rotate_uv_tface();
-               break;
-       case 9: /* mirror UVs */
-               mirror_uv_tface();
-               break;
-       case 10: /* mark border seam */
+       case 1: /* mark border seam */
                seam_mark_clear_tface(1);
                break;
-       case 11: /* clear seam */
+       case 2: /* clear seam */
                seam_mark_clear_tface(2);
                break;
        }
@@ -4609,26 +4444,13 @@ static uiBlock *view3d_faceselmenu(void *arg_unused)
        
        block= uiNewBlock(&curarea->uiblocks, "view3d_faceselmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
        uiBlockSetButmFunc(block, do_view3d_faceselmenu, NULL);
-       
-       uiDefIconTextBlockBut(block, view3d_facesel_propertiesmenu, NULL, ICON_RIGHTARROW_THIN, "Active Draw Mode", 0, yco-=20, 120, 19, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Draw Mode",         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
-
-       uiDefBut(block, SEPR, 0, "",                            0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
 
-
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate UVs|R",           0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mirror UVs|M",           0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
-
-       uiDefBut(block, SEPR, 0, "",                            0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
-       
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy UVs & Textures",            0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Vertex Colors",             0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Vertex Colors|Shift K",              0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Vertex Colors|Shift K",              0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
        
        uiDefBut(block, SEPR, 0, "",                            0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
        
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Seam|Ctrl E",              0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mark Border Seam|Ctrl E",                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Seam|Ctrl E",              0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mark Border Seam|Ctrl E",                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
 
        uiDefBut(block, SEPR, 0, "",                            0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
 
index 0e96121bbec6d01d70de2b9e6e7eca1a7a615d1d..0d2c101b845e6431a9d3322e1fc72b85e6e4b981 100644 (file)
@@ -1821,11 +1821,13 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                        case FKEY:
                                if(G.obedit) {
                                        if(G.obedit->type==OB_MESH) {
-                                               if((G.qual==LR_SHIFTKEY))
+                                               if(G.qual == LR_CTRLKEY)
+                                                       Face_Menu();
+                                               else if((G.qual==LR_SHIFTKEY))
                                                        fill_mesh();
                                                else if(G.qual==LR_ALTKEY)
                                                        beauty_fill();
-                                               else if(G.qual==LR_CTRLKEY)
+                                               else if(G.qual & (LR_CTRLKEY|LR_SHIFTKEY))
                                                        edge_flip();
                                                else if (G.qual==0)
                                                        addedgeface_mesh();
@@ -1975,8 +1977,10 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                }
                                break;
                        case IKEY:
-                               if(G.obedit);
-                               else if(G.qual==LR_CTRLKEY) {
+                               if(G.obedit) {
+                                       if(G.qual==LR_CTRLKEY) 
+                                               selectswap_mesh();
+                               } else if(G.qual==LR_CTRLKEY) {
                                        if(ob && ob->type==OB_ARMATURE) 
                                                if(ob->flag & OB_POSEMODE) 
                                                        pose_add_IK();
@@ -2067,9 +2071,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                }
                                break;
                        case MKEY:
-                               if((G.obedit==0) && (FACESEL_PAINT_TEST) && (G.qual==0))
-                                       mirror_uv_tface();
-                               else if(G.obedit){
+                               if(G.obedit){
                                        if(G.qual==LR_ALTKEY) {
                                                if(G.obedit->type==OB_MESH) {
                                                        mergemenu();
@@ -2201,9 +2203,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                }
                                break;                          
                        case RKEY:
-                               if((G.obedit==0) && (FACESEL_PAINT_TEST) && (G.qual==0) && !(G.f & G_WEIGHTPAINT))
-                                       rotate_uv_tface();
-                               else if((G.obedit==0) && G.qual==LR_ALTKEY) {
+                               if((G.obedit==0) && G.qual==LR_ALTKEY) {
                                        if(okee("Clear rotation")) {
                                                clear_object('r');
                                        }
@@ -2373,7 +2373,11 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                
                                break;
                        case VKEY:
-                               if((G.qual==LR_SHIFTKEY)) {
+                               if ((G.qual==LR_CTRLKEY)) {
+                                       if ((G.obedit) && G.obedit->type==OB_MESH) {
+                                               Vertex_Menu();
+                                       }
+                               } else if((G.qual==LR_SHIFTKEY)) {
                                        if ((G.obedit) && G.obedit->type==OB_MESH) {
                                                align_view_to_selected(v3d);
                                        }
index 5a4c8f66bd55dad56a3bbb1645c6c6be2ab96eff..62b1966caf52e880989f84ce001ae30705fb7b4e 100644 (file)
@@ -219,7 +219,7 @@ ParamHandle *construct_param_handle(EditMesh *em, short implicit, short fill, sh
                float *uv[4];
                int nverts;
 
-               tf= (TFace *)CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
+               tf= (MTFace *)CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
                
                if (efa->h)
                        continue;