Fix for bug #11650: removing uv layers in editmode did not work correct.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 15 May 2008 19:40:09 +0000 (19:40 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 15 May 2008 19:40:09 +0000 (19:40 +0000)
Fix for bug #11661: bake to viewport uv layer instead of render uv layer.

source/blender/blenkernel/intern/customdata.c
source/blender/render/intern/include/render_types.h
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/renderdatabase.c

index 663c94e51553233b702aa68d720e2b14d08a2038..3644a50b799a8fd752a63343f8b6ffaa625441ff 100644 (file)
@@ -1241,7 +1241,8 @@ void CustomData_em_copy_data(const CustomData *source, CustomData *dest,
                if(dest_i >= dest->totlayer) return;
 
                /* if we found a matching layer, copy the data */
-               if(dest->layers[dest_i].type == source->layers[src_i].type) {
+               if(dest->layers[dest_i].type == source->layers[src_i].type &&
+                       strcmp(dest->layers[dest_i].name, source->layers[src_i].name) == 0) {
                        char *src_data = (char*)src_block + source->layers[src_i].offset;
                        char *dest_data = (char*)*dest_block + dest->layers[dest_i].offset;
 
index c2d2ea9674530733483435427803e1e53698865c..d7e71b3e5310fdb73aa3e743cd7cc4ac9b47da95 100644 (file)
@@ -265,7 +265,7 @@ typedef struct ObjectRen {
 
        char (*mtface)[32];
        char (*mcol)[32];
-       int  actmtface, actmcol;
+       int  actmtface, actmcol, bakemtface;
 
        float obmat[4][4];      /* only used in convertblender.c, for instancing */
 } ObjectRen;
index 9357a060f6200f6726a495d658c6e5cbaf9128c5..ff31ba8a6eea0d2c952b5117c88d2e475ac1cd60 100644 (file)
@@ -2346,7 +2346,7 @@ static int get_next_bake_face(BakeShade *bs)
                        vlr= RE_findOrAddVlak(obr, v);
 
                        if((bs->actob && bs->actob == obr->ob) || (!bs->actob && (obr->ob->flag & SELECT))) {
-                               tface= RE_vlakren_get_tface(obr, vlr, obr->actmtface, NULL, 0);
+                               tface= RE_vlakren_get_tface(obr, vlr, obr->bakemtface, NULL, 0);
 
                                if(tface && tface->tpage) {
                                        Image *ima= tface->tpage;
@@ -2400,7 +2400,7 @@ static void shade_tface(BakeShade *bs)
        VlakRen *vlr= bs->vlr;
        ObjectInstanceRen *obi= bs->obi;
        ObjectRen *obr= obi->obr;
-       MTFace *tface= RE_vlakren_get_tface(obr, vlr, obr->actmtface, NULL, 0);
+       MTFace *tface= RE_vlakren_get_tface(obr, vlr, obr->bakemtface, NULL, 0);
        Image *ima= tface->tpage;
        float vec[4][2];
        int a, i1, i2, i3;
index 441aa9336be67e86c1eeaf319c3d6cada9f2761b..98b1426e8ff2a6b41c3aba19295ff0818b95575e 100644 (file)
@@ -501,6 +501,7 @@ void RE_set_customdata_names(ObjectRen *obr, CustomData *data)
                if (layer->type == CD_MTFACE) {
                        strcpy(obr->mtface[mtfn++], layer->name);
                        obr->actmtface= layer->active_rnd;
+                       obr->bakemtface= layer->active;
                }
                else if (layer->type == CD_MCOL) {
                        strcpy(obr->mcol[mcn++], layer->name);