diff options
author | Alfredo de Greef <eeshlo@yahoo.com> | 2006-06-04 05:29:41 +0400 |
---|---|---|
committer | Alfredo de Greef <eeshlo@yahoo.com> | 2006-06-04 05:29:41 +0400 |
commit | 3a0274769b1f8d7ac37f2c0f9f93802972ff6fdf (patch) | |
tree | 8a2f720a0cee25f06e4af7c1b8704e1232eda357 /source/blender | |
parent | a6c97c90fb85d6e233e7083ea498565da84ae29b (diff) |
Bugfix for crashes when rendering with yafray when the render
size was not 100%
Diffstat (limited to 'source/blender')
-rwxr-xr-x | source/blender/yafray/intern/export_File.cpp | 13 | ||||
-rw-r--r-- | source/blender/yafray/intern/export_Plugin.cpp | 11 |
2 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index 10b61a6cc1b..109be6db7fb 100755 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -280,6 +280,8 @@ void yafrayFileRender_t::displayImage() unsigned short height = (unsigned short)(header[14] + (header[15]<<8)); // don't do anything if resolution doesn't match that of rectot if ((width!=re->rectx) || (height!=re->recty)) { + cout << "Wrong image width/height: " << width << "/" << height << + " expected " << re->rectx << "/" << re->recty << endl; fclose(fp); fp = NULL; return; @@ -1709,11 +1711,12 @@ void yafrayFileRender_t::writeCamera() else ostr << "type=\"perspective\""; - // render resolution including the percentage buttons (aleady calculated in initrender for R renderdata) - ostr << " resx=\"" << re->r.xsch << "\" resy=\"" << re->r.ysch << "\""; + // render resolution including the percentage buttons + ostr << " resx=\"" << re->rectx << "\" resy=\"" << re->recty << "\""; float f_aspect = 1; - if ((re->r.xsch*re->r.xasp)<=(re->r.ysch*re->r.yasp)) f_aspect = float(re->r.xsch*re->r.xasp)/float(re->r.ysch*re->r.yasp); + if ((re->rectx * re->r.xasp) <= (re->recty * re->r.yasp)) + f_aspect = float(re->rectx * re->r.xasp) / float(re->recty * re->r.yasp); ostr << "\n\tfocal=\"" << mainCamLens/(f_aspect*32.f); ostr << "\" aspect_ratio=\"" << re->ycor << "\""; @@ -1786,7 +1789,7 @@ void yafrayFileRender_t::writeHemilight() if (re->r.GIcache) { ostr << "<light type=\"pathlight\" name=\"path_LT\" power=\"" << re->r.GIpower << "\" mode=\"occlusion\""; ostr << "\n\tcache=\"on\" use_QMC=\"on\" threshold=\"" << re->r.GIrefinement << "\" " - << "cache_size=\"" << ((2.0/float(re->r.xsch))*re->r.GIpixelspersample) << "\""; + << "cache_size=\"" << ((2.0/float(re->rectx))*re->r.GIpixelspersample) << "\""; ostr << "\n\tshadow_threshold=\"" << (1.0-re->r.GIshadowquality) << "\" grid=\"82\" search=\"35\""; ostr << "\n\tignore_bumpnormals=\"" << (re->r.YF_nobump ? "on" : "off") << "\""; if (fromAO) { @@ -1855,7 +1858,7 @@ void yafrayFileRender_t::writePathlight() } ostr << " cache=\"on\" use_QMC=\"on\" threshold=\"" << re->r.GIrefinement << "\"" << endl; ostr << "\tignore_bumpnormals=\"" << (re->r.YF_nobump ? "on" : "off") << "\"\n"; - float sbase = 2.0/float(re->r.xsch); + float sbase = 2.0/float(re->rectx); ostr << "\tcache_size=\"" << sbase*re->r.GIpixelspersample << "\" shadow_threshold=\"" << 1.0-re->r.GIshadowquality << "\" grid=\"82\" search=\"35\" >\n"; } diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp index f04b7062c6c..a82101b24be 100644 --- a/source/blender/yafray/intern/export_Plugin.cpp +++ b/source/blender/yafray/intern/export_Plugin.cpp @@ -1620,11 +1620,12 @@ void yafrayPluginRender_t::writeCamera() params["type"] = yafray::parameter_t("ortho"); else params["type"] = yafray::parameter_t("perspective"); - params["resx"]=yafray::parameter_t(re->r.xsch); - params["resy"]=yafray::parameter_t(re->r.ysch); + params["resx"] = yafray::parameter_t(re->rectx); + params["resy"] = yafray::parameter_t(re->recty); float f_aspect = 1; - if ((re->r.xsch*re->r.xasp)<=(re->r.ysch*re->r.yasp)) f_aspect = float(re->r.xsch*re->r.xasp)/float(re->r.ysch*re->r.yasp); + if ((re->rectx * re->r.xasp) <= (re->recty * re->r.yasp)) + f_aspect = float(re->rectx * re->r.xasp) / float(re->recty * re->r.yasp); params["focal"] = yafray::parameter_t(mainCamLens/(f_aspect*32.f)); params["aspect_ratio"] = yafray::parameter_t(re->ycor); @@ -1716,7 +1717,7 @@ void yafrayPluginRender_t::writeHemilight() params["cache"] = yafray::parameter_t("on"); params["use_QMC"] = yafray::parameter_t("on"); params["threshold"] = yafray::parameter_t(re->r.GIrefinement); - params["cache_size"] = yafray::parameter_t((2.0/float(re->r.xsch))*re->r.GIpixelspersample); + params["cache_size"] = yafray::parameter_t((2.0/float(re->rectx))*re->r.GIpixelspersample); params["shadow_threshold"] = yafray::parameter_t(1.0 - re->r.GIshadowquality); params["grid"] = yafray::parameter_t(82); params["search"] = yafray::parameter_t(35); @@ -1781,7 +1782,7 @@ void yafrayPluginRender_t::writePathlight() params["cache"] = yafray::parameter_t("on"); params["use_QMC"] = yafray::parameter_t("on"); params["threshold"] = yafray::parameter_t(re->r.GIrefinement); - params["cache_size"] = yafray::parameter_t((2.0/float(re->r.xsch))*re->r.GIpixelspersample); + params["cache_size"] = yafray::parameter_t((2.0/float(re->recty))*re->r.GIpixelspersample); params["shadow_threshold"] = yafray::parameter_t(1.0 - re->r.GIshadowquality); params["grid"] = yafray::parameter_t(82); params["search"] = yafray::parameter_t(35); |