diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/src/buttons_scene.c | 25 | ||||
-rwxr-xr-x | source/blender/yafray/intern/export_File.cpp | 26 | ||||
-rwxr-xr-x | source/blender/yafray/intern/export_File.h | 1 | ||||
-rw-r--r-- | source/blender/yafray/intern/yafray_Render.cpp | 3 |
4 files changed, 43 insertions, 12 deletions
diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index dbb1734dc2b..2df8333ce59 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -1220,11 +1220,7 @@ static void render_panel_yafrayGI() if (G.scene->r.GIpower==0) G.scene->r.GIpower=1; uiDefButF(block, NUM, 0, "Power:", 5,35,154,20, &G.scene->r.GIpower, 0.01, 100.0, 0, 0, "GI lighting intensity scale, 1 is normal"); } - uiDefButF(block, NUMSLI, 0, "Gam ", 5,10,154,20, &G.scene->r.YF_gamma, 0.001, 5.0, 0, 0, "Gamma correction, 1 is off"); - uiDefButF(block, NUMSLI, 0, "Exp ", 159,10,154,20, &G.scene->r.YF_exposure, 0.0, 10.0, 0, 0, "Exposure adjustment, 0 is off"); - uiDefButI(block, NUM, 0, "Processors:", 159,35,154,20, - &G.scene->r.YF_numprocs, 1.0, 8.0, 10, 10, "Number of processors to use"); if (G.scene->r.GImethod==2) { if (G.scene->r.GIdepth==0) G.scene->r.GIdepth=2; @@ -1242,6 +1238,26 @@ static void render_panel_yafrayGI() } } +/* yafray: global options panel */ +static void render_panel_yafrayGlobal() +{ + uiBlock *block; + + block= uiNewBlock(&curarea->uiblocks, "render_panel_yafrayGlobal", UI_EMBOSS, UI_HELV, curarea->win); + uiNewPanelTabbed("Render", "Render"); + if(uiNewPanel(curarea, block, "YafRay", "Render", 320, 0, 318, 204)==0) return; + + // label to force a boundbox for buttons not to be centered + uiDefBut(block, LABEL, 0, " ", 305,180,10,10, 0, 0, 0, 0, 0, ""); + + uiDefButF(block, NUMSLI, 0, "Gam ", 5,10,154,20, &G.scene->r.YF_gamma, 0.001, 5.0, 0, 0, "Gamma correction, 1 is off"); + uiDefButF(block, NUMSLI, 0, "Exp ", 159,10,154,20,&G.scene->r.YF_exposure, 0.0, 10.0, 0, 0, "Exposure adjustment, 0 is off"); + + uiDefButI(block, NUM, 0, "Processors:", 159,35,154,20, + &G.scene->r.YF_numprocs, 1.0, 8.0, 10, 10, "Number of processors to use"); + +} + void render_panels() { @@ -1253,6 +1269,7 @@ void render_panels() /* yafray: GI panel only available when yafray enabled for rendering */ if (G.scene->r.mode & R_YAFRAY) { if (G.scene->r.YF_gamma==0.0) G.scene->r.YF_gamma=1.0; + render_panel_yafrayGlobal(); render_panel_yafrayGI(); } diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index 1c63c424c34..45df2af9579 100755 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -239,7 +239,7 @@ void yafrayFileRender_t::writeTextures() { for (map<string, pair<Material*, MTex*> >::const_iterator blendtex=used_textures.begin(); blendtex!=used_textures.end();++blendtex) { - Material* matr = blendtex->second.first; + //Material* matr = blendtex->second.first; MTex* mtex = blendtex->second.second; Tex* tex = mtex->tex; switch (tex->type) { @@ -921,7 +921,7 @@ void yafrayFileRender_t::writeAllObjects() writeObject(obj, all_objects[obj], obmat); // all others instances of first - for (int curmtx=16;curmtx<dupMtx->second.size();curmtx+=16) { // number of 4x4 matrices + for (unsigned int curmtx=16;curmtx<dupMtx->second.size();curmtx+=16) { // number of 4x4 matrices // new mtx for (int i=0;i<4;i++) @@ -954,6 +954,21 @@ void yafrayFileRender_t::writeAllObjects() } +void yafrayFileRender_t::writeAreaLamp(LampRen* lamp,int num) +{ + if(lamp->area_shape != LA_AREA_SQUARE) return; + float *a=lamp->area[0],*b=lamp->area[1],*c=lamp->area[2],*d=lamp->area[3]; + ostr.str(""); + ostr << "<light type=\"arealight\" name=\"LAMP" << num+1 << "\" dummy=\"off\" " <<endl; + ostr << "\tpower=\"" << lamp->energy <<"\">" <<endl; + ostr << "\t<color r=\""<<lamp->r<<"\" g=\""<<lamp->g<<"\" b=\""<<lamp->b<<"\"/>"<<endl; + ostr << "\t<a x=\""<<a[0]<<"\" y=\""<<a[1]<<"\" z=\""<<a[2]<<"\"/>"<<endl; + ostr << "\t<b x=\""<<b[0]<<"\" y=\""<<b[1]<<"\" z=\""<<b[2]<<"\"/>"<<endl; + ostr << "\t<c x=\""<<c[0]<<"\" y=\""<<c[1]<<"\" z=\""<<c[2]<<"\"/>"<<endl; + ostr << "\t<d x=\""<<d[0]<<"\" y=\""<<d[1]<<"\" z=\""<<d[2]<<"\"/>"<<endl; + ostr << "</light>"<<endl<<endl; + xmlfile << ostr.str(); +} void yafrayFileRender_t::writeLamps() { @@ -962,6 +977,7 @@ void yafrayFileRender_t::writeLamps() { ostr.str(""); LampRen* lamp = R.la[i]; + if(lamp->type==LA_AREA) {writeAreaLamp(lamp,i);continue;} // TODO: add decay setting in yafray ostr << "<light type=\""; if (lamp->type==LA_LOCAL) @@ -970,12 +986,6 @@ void yafrayFileRender_t::writeLamps() ostr << "spotlight"; else if (lamp->type==LA_SUN) // for now, hemi == sun ostr << "sunlight"; - /* TODO - else if (lamp->type==LA_AREA) { - // new blender area light - ostr << "arealight"; - } - */ else { // possibly unknown type, ignore cout << "Unknown Blender lamp type: " << lamp->type << endl; diff --git a/source/blender/yafray/intern/export_File.h b/source/blender/yafray/intern/export_File.h index 69f47420d8c..144dc35752e 100755 --- a/source/blender/yafray/intern/export_File.h +++ b/source/blender/yafray/intern/export_File.h @@ -20,6 +20,7 @@ class yafrayFileRender_t : public yafrayRender_t virtual void writeObject(Object* obj, const std::vector<VlakRen*> &VLR_list, const float obmat[4][4]); virtual void writeAllObjects(); + void writeAreaLamp(LampRen* lamp,int num); virtual void writeLamps(); virtual void writeCamera(); virtual void writeHemilight(); diff --git a/source/blender/yafray/intern/yafray_Render.cpp b/source/blender/yafray/intern/yafray_Render.cpp index 8096676f0db..aa031126966 100644 --- a/source/blender/yafray/intern/yafray_Render.cpp +++ b/source/blender/yafray/intern/yafray_Render.cpp @@ -59,7 +59,10 @@ bool yafrayRender_t::exportScene() clearAll(); if(!finishExport()) + { G.afbreek = 1; //stop render and anim if doing so + return false; + } else return true; } |