diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-09-17 22:22:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-09-17 22:22:06 +0400 |
commit | 0c7c57685ec20717f4d5860bc774b52913742e8d (patch) | |
tree | b3f351da8aecc111d019137605d7aee972f46b15 /source/blender/src/editface.c | |
parent | d1e5c86b76501cef3ad5d5ae70825fc6398d642f (diff) |
New feature for UV/Editmode - 'Sync Mesh Selection' a button in the UV header this mode is disabled by default.
This is implimented by defining macro's that take the mode into account when get/set/checking the selection and that a face can be drawn.
When this is enabled, things work a bit differently
* all faces are drawn in the UV view (except hidden faces).
* selecting faces/verts in the UV window selects them on the mesh also and vice vercer.
* when EditMode (Face only) is enabled, selecting faces in the UV view is not sticky.
* hiding/(de)select all and invert selection simle call the editmesh functions.
* there is no way to select 1 uv corner of 1 face (because a mesh cannot have this as a valid selection) either all UV's that use a vert (sticky), or the whole face.
Diffstat (limited to 'source/blender/src/editface.c')
-rw-r--r-- | source/blender/src/editface.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c index 99fa2f4a3e8..5b86181b4df 100644 --- a/source/blender/src/editface.c +++ b/source/blender/src/editface.c @@ -552,10 +552,11 @@ void calculate_uv_map(unsigned short mapmode) allqueue(REDRAWIMAGE, 0); } -MTFace *get_active_mtface(EditFace **act_efa, MCol **mcol) +MTFace *get_active_mtface(EditFace **act_efa, MCol **mcol, short partsel) { EditMesh *em = G.editMesh; EditFace *efa = NULL; + EditFace *efa_vertsel = NULL; /* use this if one of the faces verts are selected */ EditSelection *ese; if(!EM_texFaceCheck()) @@ -565,9 +566,8 @@ MTFace *get_active_mtface(EditFace **act_efa, MCol **mcol) if(ese->type == EDITFACE) { efa = (EditFace *)ese->data; - if (efa->h) - efa= NULL; - break; + if (efa->h) efa= NULL; + else break; } } @@ -575,9 +575,17 @@ MTFace *get_active_mtface(EditFace **act_efa, MCol **mcol) for (efa= em->faces.first; efa; efa= efa->next) { if (efa->f & SELECT) break; + + /* use a face that has 1 vert selected as a last resort + * This is so selecting verts in editmode does not always make the UV window flicker */ + if (partsel && ((efa->v1->f & SELECT) || (efa->v2->f & SELECT) || (efa->v3->f & SELECT) || (efa->v4 && efa->v4->f & SELECT))) + efa_vertsel = efa; } } + if (partsel && !efa) + efa= efa_vertsel; + if (efa) { if (mcol) { if (CustomData_has_layer(&em->fdata, CD_MCOL)) |