diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-09-12 14:35:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-09-12 14:35:48 +0400 |
commit | b2b3b018948f2a5b14b888e386ba811d9e1236e0 (patch) | |
tree | c9c50bc73341c74cd8de09f29cb60d2fd93f6f11 /source/blender/src | |
parent | d1dcfd744a1c28e85a1e61b17782c2444fa14e8b (diff) |
Added UV face rotate and mirror to editmode and re arranged some of the editmode keys
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.
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/buttons_editing.c | 6 | ||||
-rw-r--r-- | source/blender/src/drawobject.c | 2 | ||||
-rw-r--r-- | source/blender/src/editface.c | 147 | ||||
-rw-r--r-- | source/blender/src/editmesh.c | 14 | ||||
-rw-r--r-- | source/blender/src/editmesh_mods.c | 71 | ||||
-rw-r--r-- | source/blender/src/editmesh_tools.c | 169 | ||||
-rw-r--r-- | source/blender/src/editobject.c | 55 | ||||
-rw-r--r-- | source/blender/src/filelist.c | 2 | ||||
-rw-r--r-- | source/blender/src/filesel.c | 6 | ||||
-rw-r--r-- | source/blender/src/header_view3d.c | 190 | ||||
-rw-r--r-- | source/blender/src/space.c | 26 | ||||
-rw-r--r-- | source/blender/src/unwrapper.c | 2 |
12 files changed, 290 insertions, 400 deletions
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 8d60f73858c..b3310a7dad2 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -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); diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index fa6a3938f3c..43a1ea6d0c1 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -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 diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c index 2a0a0432955..48edf7e8096 100644 --- a/source/blender/src/editface.c +++ b/source/blender/src/editface.c @@ -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; diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c index 4b7db1c1609..fcfb1a5c40f 100644 --- a/source/blender/src/editmesh.c +++ b/source/blender/src/editmesh.c @@ -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; +} + diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c index 1c3d347288c..c4a13323624 100644 --- a/source/blender/src/editmesh_mods.c +++ b/source/blender/src/editmesh_mods.c @@ -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 ************** */ diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index 6cdc393d2c5..7dd116d0fad 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -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"); + } +} diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 8a8f31e027d..360a3b0732c 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -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; } diff --git a/source/blender/src/filelist.c b/source/blender/src/filelist.c index 5b46194d00c..7ada2afc69b 100644 --- a/source/blender/src/filelist.c +++ b/source/blender/src/filelist.c @@ -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); diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index 242c7c0a12c..f4b9d47becf 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -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; diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index bcbad9d2893..757af299e0e 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -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, ""); diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 0e96121bbec..0d2c101b845 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -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); } diff --git a/source/blender/src/unwrapper.c b/source/blender/src/unwrapper.c index 5a4c8f66bd5..62b1966caf5 100644 --- a/source/blender/src/unwrapper.c +++ b/source/blender/src/unwrapper.c @@ -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; |