diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2005-04-23 00:16:02 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2005-04-23 00:16:02 +0400 |
commit | 6a00fcd90ca8a2c4bd3a0429d37be2ce6c2ac77a (patch) | |
tree | 8dadc718838f5d6711917b73991c2fdc2d9a28d6 /source/blender/src/editsima.c | |
parent | 43835d4d0450c15c4d8e962c0b979b34325f4c97 (diff) |
Add "View Selected" (numpad .-key) for faceselect mode and the uv editor.
Also includes some 2d vector operations (subtract, dot, normalise).
Diffstat (limited to 'source/blender/src/editsima.c')
-rw-r--r-- | source/blender/src/editsima.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c index 25c1d82fb7f..4de8824cb6c 100644 --- a/source/blender/src/editsima.c +++ b/source/blender/src/editsima.c @@ -1739,3 +1739,42 @@ void pin_tface_uv(int mode) scrarea_queue_winredraw(curarea); } +int minmax_tface_uv(float *min, float *max) +{ + Mesh *me; + TFace *tf; + MFace *mf; + int a, sel; + + if( is_uv_tface_editing_allowed()==0 ) return 0; + me= get_mesh(OBACT); + + INIT_MINMAX2(min, max); + + sel= 0; + mf= (MFace*)me->mface; + tf= (TFace*)me->tface; + for(a=me->totface; a>0; a--, tf++, mf++) { + if(tf->flag & TF_HIDE); + else if(mf->v3 && (tf->flag & TF_SELECT)) { + + if (tf->flag & TF_SEL1) { + DO_MINMAX2(tf->uv[0], min, max); + } + if (tf->flag & TF_SEL2) { + DO_MINMAX2(tf->uv[1], min, max); + } + if (tf->flag & TF_SEL3) { + DO_MINMAX2(tf->uv[2], min, max); + } + if (mf->v4 && tf->flag & TF_SEL4) { + DO_MINMAX2(tf->uv[3], min, max); + } + + sel = 1; + } + } + + return sel; +} + |