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.
This commit is contained in:
2007-09-12 10:35:48 +00:00
parent d1dcfd744a
commit b2b3b01894
13 changed files with 297 additions and 400 deletions

View 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;