diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-09-22 21:54:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-09-22 21:54:13 +0400 |
commit | aee06ac0d0ebe22c6156808fcc4d87aca1fbea10 (patch) | |
tree | 444def3be57a5c2134cdff13060c47ccdc7ddb46 /source/blender/blenkernel | |
parent | d5b186ba6bac1e41a87aa4d9153a30a4091524f4 (diff) |
added an active face for the mesh editmode and normal mesh - this is needed because the TFace flag was not always easy to access from editmode.
using the last selected face was almost good enough however when selecting verts and edges the last selected face would become inactive and the space image would flicker about too much.
The active face is used for getting the space image at the moment and keeps scripts that use this flag working also.
This has 2 commands to get and set, so the variable is not accessed directly.
all "UV Calculate" scripts work now
last commit crashed when in solid draw mode, it seems subsurf modifier is ignoring the displayMask since MTFACE is available. just made it do a null check for now.
uvcalc_follow_active_coords.py - should be done inC and put in the snap menu.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 36 |
2 files changed, 20 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 3a64c3504cb..ff84b3c08f8 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -243,6 +243,7 @@ static Image *image_alloc(const char *name, short source, short type) ima->ok= IMA_OK; ima->xrep= ima->yrep= 1; + ima->aspx= ima->aspy= 1.0; ima->gen_x= 256; ima->gen_y= 256; ima->gen_type= 1; /* no defines yet? */ diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 39674c9796f..646157991bb 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1881,28 +1881,30 @@ static void ccgDM_drawUVEdges(DerivedMesh *dm) MTFace *tf = DM_get_face_data_layer(dm, CD_MTFACE); int i; - glBegin(GL_LINES); - for(i = 0; i < dm->numFaceData; i++, mf++, tf++) { - if(!(mf->flag&ME_HIDE)) { - glVertex2fv(tf->uv[0]); - glVertex2fv(tf->uv[1]); - - glVertex2fv(tf->uv[1]); - glVertex2fv(tf->uv[2]); - - if(!mf->v4) { - glVertex2fv(tf->uv[2]); + if (tf) { + glBegin(GL_LINES); + for(i = 0; i < dm->numFaceData; i++, mf++, tf++) { + if(!(mf->flag&ME_HIDE)) { glVertex2fv(tf->uv[0]); - } else { + glVertex2fv(tf->uv[1]); + + glVertex2fv(tf->uv[1]); glVertex2fv(tf->uv[2]); - glVertex2fv(tf->uv[3]); - - glVertex2fv(tf->uv[3]); - glVertex2fv(tf->uv[0]); + + if(!mf->v4) { + glVertex2fv(tf->uv[2]); + glVertex2fv(tf->uv[0]); + } else { + glVertex2fv(tf->uv[2]); + glVertex2fv(tf->uv[3]); + + glVertex2fv(tf->uv[3]); + glVertex2fv(tf->uv[0]); + } } } + glEnd(); } - glEnd(); } static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int useColors) { |