diff options
author | Alejandro Conty Estevez <conty@yafray.org> | 2004-01-26 15:15:33 +0300 |
---|---|---|
committer | Alejandro Conty Estevez <conty@yafray.org> | 2004-01-26 15:15:33 +0300 |
commit | e11754cf12aa422bd47c1d25ab6d2ffe0cf6db9f (patch) | |
tree | 1f45509d153ce46407d13c2349be4bdab09edb8a /source/blender/yafray/intern | |
parent | 57be09f6e2afac2c6e6aa275ea55755506ca51aa (diff) |
possible fix for os x problem, caused by SIGVTALRM
Diffstat (limited to 'source/blender/yafray/intern')
-rwxr-xr-x | source/blender/yafray/intern/export_File.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index d9acf9e344d..0763bbdedca 100755 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -73,6 +73,7 @@ static int createDir(char* name) #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> +#include <signal.h> #include <stdlib.h> #include <unistd.h> @@ -1003,13 +1004,14 @@ void yafrayFileRender_t::writeAreaLamp(LampRen* lamp, int num) ostr.str(""); string md = "off"; if (R.r.GIphotons) md = "on"; - ostr << "<light type=\"arealight\" name=\"LAMP" << num+1 << "\" dummy=\""<< md << "\" power=\"" << lamp->dist << "\" "; + ostr << "<light type=\"arealight\" name=\"LAMP" << num+1 << "\" dummy=\""<< md << "\" power=\"" << lamp->energy << "\" "; if (!R.r.GIphotons) { int psm=0, sm = lamp->ray_totsamp; if (sm>=16) psm = sm/4; ostr << "samples=\"" << sm << "\" psamples=\"" << psm << "\" "; } ostr << ">\n"; + ostr << "\t<a x=\""<< a[0] <<"\" y=\""<< a[1] <<"\" z=\"" << a[2] <<"\" />\n"; ostr << "\t<b x=\""<< b[0] <<"\" y=\""<< b[1] <<"\" z=\"" << b[2] <<"\" />\n"; ostr << "\t<c x=\""<< c[0] <<"\" y=\""<< c[1] <<"\" z=\"" << c[2] <<"\" />\n"; @@ -1230,8 +1232,13 @@ bool yafrayFileRender_t::executeYafray(const string &xmlpath) char yfr[8]; sprintf(yfr, "%d ", R.r.YF_numprocs); string command = command_path + "yafray -c " + yfr + "\"" + xmlpath + "\""; - int ret=system(command.c_str()); #ifndef WIN32 + sigset_t yaf,old; + sigemptyset(&yaf); + sigaddset(&yaf,SIGVTALRM); + sigprocmask(SIG_BLOCK,&yaf,&old); + int ret=system(command.c_str()); + sigprocmask(SIG_SETMASK,&old,NULL); if(WIFEXITED(ret)) { if(WEXITSTATUS(ret)) cout<<"Executed -"<<command<<"-"<<endl; @@ -1249,6 +1256,7 @@ bool yafrayFileRender_t::executeYafray(const string &xmlpath) cout<<"Unknown error\n"; return false; #else + int ret=system(command.c_str()); return ret==0; #endif |