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/blenloader | |
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/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 48eb6ae8e55..0330883b2f9 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4203,10 +4203,11 @@ static void sort_shape_fix(Main *main) static void customdata_version_242(Mesh *me) { + CustomDataLayer *layer; MTFace *mtf; MCol *mcol; TFace *tf; - int a; + int a, mtfacen, mcoln; if (!me->vdata.totlayer) { CustomData_add_layer(&me->vdata, CD_MVERT, CD_ASSIGN, me->mvert, me->totvert); @@ -4256,6 +4257,25 @@ static void customdata_version_242(Mesh *me) me->tface= NULL; } + for (a=0, mtfacen=0, mcoln=0; a < me->fdata.totlayer; a++) { + layer= &me->fdata.layers[a]; + + if (layer->type == CD_MTFACE) { + if (layer->name[0] == 0) { + if (mtfacen == 0) strcpy(layer->name, "UVTex"); + else sprintf(layer->name, "UVTex.%.3d", mtfacen); + } + mtfacen++; + } + else if (layer->type == CD_MCOL) { + if (layer->name[0] == 0) { + if (mcoln == 0) strcpy(layer->name, "Col"); + else sprintf(layer->name, "Col.%.3d", mcoln); + } + mcoln++; + } + } + mesh_update_customdata_pointers(me); } |