From ec04c09365cd47bf9ca7e86e1fa731dd2e4540db Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 21 Jan 2008 23:17:19 +0000 Subject: Fix for error in approximate AO in last commit, made it really slow. Also, duplis are now taking into account, the proper way to exclude them is to set the material to be not traceable. Removed an unnecessary pointer from the VlakRen struct to save some memory, not really that significant, but still, saves 70 mb for 10 million faces. --- source/blender/yafray/intern/export_File.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source/blender/yafray/intern/export_File.cpp') diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index 48e4f267177..73b30105b27 100644 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -1188,7 +1188,7 @@ void yafrayFileRender_t::writeMaterialsAndModulators() } -void yafrayFileRender_t::writeObject(Object* obj, const vector &VLR_list, const float obmat[4][4]) +void yafrayFileRender_t::writeObject(Object* obj, ObjectRen *obr, const vector &VLR_list, const float obmat[4][4]) { ostr.str(""); // transform first (not necessarily actual obj->obmat, can be duplivert see below) @@ -1230,7 +1230,6 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector &VLR_li string matname(face0mat->id.name); // use name in imgtex_shader list if 'TexFace' enabled for this material if (face0mat->mode & MA_FACETEXTURE) { - ObjectRen *obr = face0->obr; MTFace* tface = RE_vlakren_get_tface(obr, face0, obr->actmtface, NULL, 0); if (tface) { Image* fimg = (Image*)tface->tpage; @@ -1408,7 +1407,6 @@ void yafrayFileRender_t::writeObject(Object* obj, const vector &VLR_li fci2!=VLR_list.end();++fci2) { VlakRen* vlr = *fci2; - ObjectRen *obr = vlr->obr; Material* fmat = vlr->mat; bool EXPORT_VCOL = ((fmat->mode & (MA_VERTEXCOL|MA_VERTEXCOLP))!=0); string fmatname(fmat->id.name); @@ -1510,13 +1508,13 @@ void yafrayFileRender_t::writeAllObjects() { // first all objects except dupliverts (and main instance object for dups) - for (map >::const_iterator obi=all_objects.begin(); + for (map::const_iterator obi=all_objects.begin(); obi!=all_objects.end(); ++obi) { // skip main duplivert object if in dupliMtx_list, written later Object* obj = obi->first; if (dupliMtx_list.find(string(obj->id.name))!=dupliMtx_list.end()) continue; - writeObject(obj, obi->second, obj->obmat); + writeObject(obj, obi->second.obr, obi->second.faces, obj->obmat); } // Now all duplivert objects (if any) as instances of main object @@ -1536,7 +1534,7 @@ void yafrayFileRender_t::writeAllObjects() // first object written as normal (but with transform of first duplivert) Object* obj = dup_srcob[dupMtx->first]; - writeObject(obj, all_objects[obj], obmat); + writeObject(obj, all_objects[obj].obr, all_objects[obj].faces, obmat); // all others instances of first for (unsigned int curmtx=16;curmtxsecond.size();curmtx+=16) { // number of 4x4 matrices -- cgit v1.2.3