diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-09-30 12:28:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-09-30 12:28:15 +0400 |
commit | b47c75953b78ec2645970effe189b8ed7cb7462c (patch) | |
tree | ab497bbf44a6a15226862868d127c50188a8d568 /source/blender/src/editmesh_tools.c | |
parent | 51b56a4d3f17e8cea35ba02132af0c2b893e1ff2 (diff) |
- rewrote UV Stitch, (seperate from limit stitch now), does much less
work for same results.
- UV Stitch with the V key was not working (as stated in the menu)
- Rotate UV's and Colors now have an option for CCW (was in the menu
but not implimented)
- Draw face dot in UV when in face mode
Diffstat (limited to 'source/blender/src/editmesh_tools.c')
-rw-r--r-- | source/blender/src/editmesh_tools.c | 86 |
1 files changed, 60 insertions, 26 deletions
diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index 20aa1771331..2afac79be1d 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -6559,7 +6559,7 @@ void mesh_rotate_uvs(void) { EditMesh *em = G.editMesh; EditFace *efa; - short change = 0; + short change = 0, ccw; MTFace *tf; float u1, v1; @@ -6568,28 +6568,49 @@ void mesh_rotate_uvs(void) return; } + ccw = (G.qual == LR_SHIFTKEY); + 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; + if (ccw) { + if(efa->v4) { + tf->uv[0][0]= tf->uv[3][0]; + tf->uv[0][1]= tf->uv[3][1]; + + tf->uv[3][0]= tf->uv[2][0]; + tf->uv[3][1]= tf->uv[2][1]; + } else { + tf->uv[0][0]= tf->uv[2][0]; + tf->uv[0][1]= tf->uv[2][1]; + } + + tf->uv[2][0]= tf->uv[1][0]; + tf->uv[2][1]= tf->uv[1][1]; + + tf->uv[1][0]= u1; + tf->uv[1][1]= v1; + } else { + 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; } @@ -6657,27 +6678,40 @@ void mesh_rotate_colors(void) { EditMesh *em = G.editMesh; EditFace *efa; - short change = 0; + short change = 0, ccw; MCol tmpcol, *mcol; if (!EM_vertColorCheck()) { error("mesh has no color layers"); return; } + ccw = (G.qual == LR_SHIFTKEY); + 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; + if (ccw) { + if(efa->v4) { + mcol[0]= mcol[3]; + mcol[3]= mcol[2]; + } else { + mcol[0]= mcol[2]; + } + mcol[2]= mcol[1]; + mcol[1]= tmpcol; + } else { + mcol[0]= mcol[1]; + mcol[1]= mcol[2]; + + if(efa->v4) { + mcol[2]= mcol[3]; + mcol[3]= tmpcol; + } + else + mcol[2]= tmpcol; } - else - mcol[2]= tmpcol; change = 1; } } |