diff options
author | Alfredo de Greef <eeshlo@yahoo.com> | 2005-10-25 13:30:54 +0400 |
---|---|---|
committer | Alfredo de Greef <eeshlo@yahoo.com> | 2005-10-25 13:30:54 +0400 |
commit | d21d25538959611bd090c7d5c3709164290d4b42 (patch) | |
tree | 9ebcf3384a5d837fd79c556bba04e2d2ca2ee8b8 | |
parent | a7e9a9d9c0e4154db41de6184eefcccfd6e4ed0a (diff) |
fix for bug #3193, winmat was not calculated properly because of
some previously uninitialized parameters.
-rw-r--r-- | source/blender/render/intern/source/initrender.c | 8 | ||||
-rwxr-xr-x | source/blender/yafray/intern/export_File.cpp | 4 | ||||
-rw-r--r-- | source/blender/yafray/intern/export_Plugin.cpp | 16 |
3 files changed, 17 insertions, 11 deletions
diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index f79b86f018b..7705609a46f 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -583,7 +583,7 @@ void RE_setwindowclip(int mode, int jmode) else i_window(minx, maxx, miny, maxy, R.near, R.far, R.winmat); -// printmatrix4("win", R.winmat); + //printmatrix4("win", R.winmat); } @@ -836,6 +836,12 @@ static void yafrayRender(void) { R.flag |= R_RENDERING; /* !!! */ + /* bug #3193: these params were not initialized, needed later for winmat calc. */ + R.xstart = -R.afmx; + R.ystart = -R.afmy; + R.xend = R.xstart + R.rectx - 1; + R.yend = R.ystart + R.recty - 1; + /* all allocs moved here, out of export code */ /* display rgba buf */ if (R.rectot) MEM_freeN(R.rectot); diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index 43128b35933..79e83704ee9 100755 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -1207,7 +1207,9 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_li // Export orco coords test. // Previously was done by checking orco pointer, however this can be non-null but still not initialized. // Test the rendermaterial texco flag instead. - bool EXPORT_ORCO = ((face0mat->texco & TEXCO_ORCO)!=0); + // update2: bug #3193 it seems it has changed again with the introduction of static 'hair' particles, + // now it uses the vert pointer again as an extra test to make sure there are orco coords available + bool EXPORT_ORCO = (((face0mat->texco & TEXCO_ORCO)!=0) && (face0->v1->orco!=NULL)); string has_orco = "off"; if (EXPORT_ORCO) has_orco = "on"; diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp index 27333c89b89..fc587bab2e0 100644 --- a/source/blender/yafray/intern/export_Plugin.cpp +++ b/source/blender/yafray/intern/export_Plugin.cpp @@ -1279,8 +1279,7 @@ void yafrayPluginRender_t::genVertices(vector<yafray::point3d_t> &verts, int &vi MTC_cp3Float(ver->co, tvec); MTC_Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); - if (has_orco) - verts.push_back(yafray::point3d_t(ver->orco[0],ver->orco[1],ver->orco[2])); + if (has_orco) verts.push_back(yafray::point3d_t(ver->orco[0], ver->orco[1], ver->orco[2])); } if (vert_idx.find(vlr->v2)==vert_idx.end()) { @@ -1289,8 +1288,7 @@ void yafrayPluginRender_t::genVertices(vector<yafray::point3d_t> &verts, int &vi MTC_cp3Float(ver->co, tvec); MTC_Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); - if (has_orco) - verts.push_back(yafray::point3d_t(ver->orco[0],ver->orco[1],ver->orco[2])); + if (has_orco) verts.push_back(yafray::point3d_t(ver->orco[0], ver->orco[1], ver->orco[2])); } if (vert_idx.find(vlr->v3)==vert_idx.end()) { @@ -1299,8 +1297,7 @@ void yafrayPluginRender_t::genVertices(vector<yafray::point3d_t> &verts, int &vi MTC_cp3Float(ver->co, tvec); MTC_Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); - if (has_orco) - verts.push_back(yafray::point3d_t(ver->orco[0],ver->orco[1],ver->orco[2])); + if (has_orco) verts.push_back(yafray::point3d_t(ver->orco[0], ver->orco[1], ver->orco[2])); } if ((vlr->v4) && (vert_idx.find(vlr->v4)==vert_idx.end())) { @@ -1309,8 +1306,7 @@ void yafrayPluginRender_t::genVertices(vector<yafray::point3d_t> &verts, int &vi MTC_cp3Float(ver->co, tvec); MTC_Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); - if (has_orco) - verts.push_back(yafray::point3d_t(ver->orco[0],ver->orco[1],ver->orco[2])); + if (has_orco) verts.push_back(yafray::point3d_t(ver->orco[0], ver->orco[1], ver->orco[2])); } } @@ -1341,7 +1337,9 @@ void yafrayPluginRender_t::writeObject(Object* obj, const vector<VlakRen*> &VLR_ // Export orco coords test. // Previously was done by checking orco pointer, however this can be non-null but still not initialized. // Test the rendermaterial texco flag instead. - bool has_orco = ((face0mat->texco & TEXCO_ORCO)!=0); + // update2: bug #3193 it seems it has changed again with the introduction of static 'hair' particles, + // now it uses the vert pointer again as an extra test to make sure there are orco coords available + bool has_orco = (((face0mat->texco & TEXCO_ORCO)!=0) && (face0->v1->orco!=NULL)); bool no_auto = true; //in case non-mesh, or mesh has no autosmooth float sm_angle = 0.1f; |