diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-12-21 16:47:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-12-21 16:47:27 +0300 |
commit | 47bc3d1208c48903f53728d17d3acbb1ccbd06cb (patch) | |
tree | eca808294b88940590b8dc7e9693acc20ef2048f /source/blender/src/editface.c | |
parent | edccdf934018264002c034906e8a287d12b7ead7 (diff) |
Added names to UV and vertex color layers, and display them as a list.
Added support for multiple UVs in the render engine. This also involved
changing the way faces are stored, to allow data to be added optionally
per 256 faces, same as the existing system for vertices.
A UV layer can be specified in the Map Input panel and the Geometry node
by name. Leaving this field blank will default to the active UV layer.
Also added sharing of face selection and hiding between UV layers, and at
the same time improved syncing with editmode selection and hiding.
Still to do:
- Multi UV support for fastshade.
- Multires and NMesh preservation of multiple UV sets.
Diffstat (limited to 'source/blender/src/editface.c')
-rw-r--r-- | source/blender/src/editface.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c index 81c77adfdde..68fcc200622 100644 --- a/source/blender/src/editface.c +++ b/source/blender/src/editface.c @@ -1434,11 +1434,15 @@ void set_faceselect() /* toggle */ setcursor_space(SPACE_VIEW3D, CURSOR_STD); BIF_undo_push("End UV Faceselect"); } + + if(me) + select_mface_from_tface(me); } else if (me && (ob->lay & G.vd->lay)) { G.f |= G_FACESELECT; if(me->mtface==NULL) make_tfaces(me); + select_tface_from_mface(me); setcursor_space(SPACE_VIEW3D, CURSOR_FACESEL); BIF_undo_push("Set UV Faceselect"); @@ -1451,6 +1455,44 @@ void set_faceselect() /* toggle */ allqueue(REDRAWIMAGE, 0); } +void select_tface_from_mface(Mesh *me) +{ + MFace *mf; + MTFace *tf; + int a; + + if(!me->mtface) return; + + mf= me->mface; + tf= me->mtface; + for(a=0; a<me->totface; a++, mf++, tf++) { + if(mf->flag & ME_FACE_SEL) tf->flag |= TF_SELECT; + else tf->flag &= ~TF_SELECT; + + if(mf->flag & ME_HIDE) tf->flag |= TF_HIDE; + else tf->flag &= ~TF_HIDE; + } +} + +void select_mface_from_tface(Mesh *me) +{ + MFace *mf; + MTFace *tf; + int a; + + if(!me->mtface) return; + + mf= me->mface; + tf= me->mtface; + for(a=0; a<me->totface; a++, mf++, tf++) { + if(tf->flag & TF_SELECT) mf->flag |= ME_FACE_SEL; + else mf->flag &= ~ME_FACE_SEL; + + if(tf->flag & TF_HIDE) mf->flag |= ME_HIDE; + else mf->flag &= ~ME_HIDE; + } +} + /* Texture Paint */ void set_texturepaint() /* toggle */ @@ -1480,6 +1522,10 @@ void set_texturepaint() /* toggle */ } else if (me) { G.f |= G_TEXTUREPAINT; + + if(me->mtface==NULL) + make_tfaces(me); + brush_check_exists(&G.scene->toolsettings->imapaint.brush); texpaint_disable_mipmap(); } |