diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-09-10 23:32:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-09-10 23:32:44 +0400 |
commit | 0bd32f3ac60393fca5af17534c8ee90e20664cbd (patch) | |
tree | 37593e75c494bd53a44f26b1797447edef9989e0 /source/blender/src/editface.c | |
parent | 1f0b07c37b4fc51955b8738d9f1922623d98b87c (diff) |
Changes to "Face Select" mode
* Does not indicate that UV's exist, nor does it add UV's when used.
* Only accessible for texturepaint, vertexpaint and weightpaint from a button in the header (Paint Selection Mask)
* Not accessible from the mode menu, this is only an option that applies to paint modes.
This dosnt effect DNA, face select (G_FACESELECT) can be enabled at any time but is only used when paint modes are enabled.
Other changes
* UKey is uv unwrap in editmode, Ukey for undo was editmode only anyway.
* UVCalc in editmode adds a UV Layer if there is not one alredy.
* texture draw in editmode does not draw the face dots (they are get in the way of texturing)
* some missing updates were added.
* removed manipulator from when paint modes are enabled since the manipulator is not drawn in the 3d view.
Diffstat (limited to 'source/blender/src/editface.c')
-rw-r--r-- | source/blender/src/editface.c | 57 |
1 files changed, 10 insertions, 47 deletions
diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c index b22a3b30f0b..2a0a0432955 100644 --- a/source/blender/src/editface.c +++ b/source/blender/src/editface.c @@ -66,6 +66,7 @@ #include "BKE_object.h" #include "BKE_texture.h" #include "BKE_utildefines.h" +#include "BKE_customdata.h" #include "BSE_view.h" #include "BSE_edit.h" @@ -340,7 +341,6 @@ static void uv_calc_shift_project(float *target, float *shift, float rotmat[][4] void calculate_uv_map(unsigned short mapmode) { MTFace *tface; - /*MFace *mface;*/ Object *ob; float dx, dy, rotatematrix[4][4], radius= 1.0, min[3], cent[3], max[3]; float fac= 1.0, upangledeg= 0.0, sideangledeg= 90.0; @@ -358,8 +358,16 @@ void calculate_uv_map(unsigned short mapmode) else sideangledeg= 90.0; } + /* add uvs if there not here */ + if (!EM_texFaceCheck()) { + if (em && em->faces.first) + EM_add_data_layer(&em->fdata, CD_MTFACE); + + if (!EM_texFaceCheck()) + return; + } + ob=OBACT; - if (!EM_texFaceCheck()) return; switch(mapmode) { case B_UVAUTO_BOUNDS: @@ -1415,51 +1423,6 @@ void uv_autocalc_tface() } } -void set_faceselect() /* toggle */ -{ - Object *ob = OBACT; - Mesh *me = 0; - - if(ob==NULL) return; - if(object_data_is_libdata(ob)) { - error_libdata(); - return; - } - - me= get_mesh(ob); - - scrarea_queue_headredraw(curarea); - - if(me) /* make sure modifiers are updated for mapping requirements */ - DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); - - if(G.f & G_FACESELECT) { - G.f &= ~G_FACESELECT; - - if((G.f & (G_WEIGHTPAINT|G_VERTEXPAINT|G_TEXTUREPAINT))==0) { - if(me) - reveal_tface(); - setcursor_space(SPACE_VIEW3D, CURSOR_STD); - BIF_undo_push("End UV Faceselect"); - } - } - else if (me && (ob->lay & G.vd->lay)) { - G.f |= G_FACESELECT; - /* - if(me->mtface==NULL) - make_tfaces(me); - */ - setcursor_space(SPACE_VIEW3D, CURSOR_FACESEL); - BIF_undo_push("Set UV Faceselect"); - } - - countall(); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWBUTSEDIT, 0); - /*allqueue(REDRAWIMAGE, 0);*/ -} - /* Texture Paint */ void set_texturepaint() /* toggle */ |