svn merge ^/trunk/blender -r42009:42053
[blender.git] / source / blender / editors / object / object_bake.c
index 5dc1c1b..0d3d732 100644 (file)
@@ -364,6 +364,16 @@ static int multiresbake_test_break(MultiresBakeRender *bkr)
 static void do_multires_bake(MultiresBakeRender *bkr, Image* ima, MPassKnownData passKnownData,
                              MInitBakeData initBakeData, MApplyBakeData applyBakeData, MFreeBakeData freeBakeData)
 {
+#if 1 // BMESH_TODO
+       (void)bkr;
+       (void)ima;
+       (void)passKnownData;
+       (void)initBakeData;
+       (void)applyBakeData;
+       (void)freeBakeData;
+
+       printf("BMESH_TODO" AT "\n");
+#else
        DerivedMesh *dm= bkr->lores_dm;
        ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
        const int lvl= bkr->lvl;
@@ -446,6 +456,7 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image* ima, MPassKnownData
                if(freeBakeData)
                        freeBakeData(data.bake_data);
        }
+#endif // BMESH_TODO
 }
 
 static void interp_bilinear_quad_data(float data[4][3], float u, float v, float res[3])
@@ -508,6 +519,17 @@ static void interp_bilinear_grid(DMGridData *grid, int grid_size, float crn_x, f
 
 static void get_ccgdm_data(DerivedMesh *lodm, DerivedMesh *hidm, const int *origindex,  const int lvl, const int face_index, const float u, const float v, float co[3], float n[3])
 {
+#if 1 // BMESH_TODO
+       (void)lodm;
+       (void)hidm;
+       (void)origindex;
+       (void)lvl;
+       (void)face_index;
+       (void)u;
+       (void)v;
+       (void)co;
+       (void)n;
+#else
        MFace mface;
        DMGridData **grid_data;
        float crn_x, crn_y;
@@ -549,6 +571,7 @@ static void get_ccgdm_data(DerivedMesh *lodm, DerivedMesh *hidm, const int *orig
 
        if(co != NULL)
                interp_bilinear_grid(grid_data[g_index + S], grid_size, crn_x, crn_y, 1, co);
+#endif
 }
 
 /* mode = 0: interpolate normals,
@@ -619,7 +642,7 @@ static void *init_heights_data(MultiresBakeRender *bkr, Image *ima)
                height_data->ssdm= subsurf_make_derived_from_derived(bkr->lores_dm, &smd, 0, NULL, 0, 0, 0);
        }
 
-       height_data->origindex= lodm->getFaceDataArray(lodm, CD_ORIGINDEX);
+       height_data->origindex= lodm->getTessFaceDataArray(lodm, CD_ORIGINDEX);
 
        return (void*)height_data;
 }
@@ -631,7 +654,7 @@ static void *init_normal_data(MultiresBakeRender *bkr, Image *UNUSED(ima))
 
        normal_data= MEM_callocN(sizeof(MNormalBakeData), "MultiresBake normalData");
 
-       normal_data->origindex= lodm->getFaceDataArray(lodm, CD_ORIGINDEX);
+       normal_data->origindex= lodm->getTessFaceDataArray(lodm, CD_ORIGINDEX);
 
        return (void*)normal_data;
 }
@@ -693,6 +716,16 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
                                    const int face_index, const int lvl, const float st[2],
                                    float UNUSED(tangmat[3][3]), const int x, const int y)
 {
+#if 1 // BMESH_TODO
+       (void)lores_dm;
+       (void)hires_dm;
+       (void)bake_data;
+       (void)face_index;
+       (void)lvl;
+       (void)st;
+       (void)x;
+       (void)y;
+#else
        MTFace *mtface= CustomData_get_layer(&lores_dm->faceData, CD_MTFACE);
        MFace mface;
        Image *ima= mtface[face_index].tpage;
@@ -749,6 +782,7 @@ static void apply_heights_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
                char *rrgb= (char*)ibuf->rect + pixel*4;
                rrgb[3]= 255;
        }
+#endif // BMESH_TODO
 }
 
 /* MultiresBake callback for normals' baking
@@ -760,6 +794,17 @@ static void apply_tangmat_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
                                    const int face_index, const int lvl, const float st[2],
                                    float tangmat[3][3], const int x, const int y)
 {
+#if 1 // BMESH_TODO
+       (void)lores_dm;
+       (void)hires_dm;
+       (void)bake_data;
+       (void)face_index;
+       (void)lvl;
+       (void)st;
+       (void)tangmat;
+       (void)y;
+       (void)x;
+#else
        MTFace *mtface= CustomData_get_layer(&lores_dm->faceData, CD_MTFACE);
        MFace mface;
        Image *ima= mtface[face_index].tpage;
@@ -806,6 +851,7 @@ static void apply_tangmat_callback(DerivedMesh *lores_dm, DerivedMesh *hires_dm,
                rrgb[2]= FTOCHAR(vec[2]);
                rrgb[3]= 255;
        }
+#endif
 }
 
 static void count_images(MultiresBakeRender *bkr)
@@ -991,7 +1037,7 @@ static DerivedMesh *multiresbake_create_loresdm(Scene *scene, Object *ob, int *l
 
        if(*lvl==0) {
                DerivedMesh *tmp_dm= CDDM_from_mesh(me, ob);
-               dm= CDDM_copy(tmp_dm);
+               dm= CDDM_copy(tmp_dm, 0);
                tmp_dm->release(tmp_dm);
        } else {
                MultiresModifierData tmp_mmd= *mmd;