Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Conty Estevez <conty@yafray.org>2004-01-12 19:46:47 +0300
committerAlejandro Conty Estevez <conty@yafray.org>2004-01-12 19:46:47 +0300
commit501adfba4228e1338eb74f0dc5706083438dbe4e (patch)
tree2b602b33be07851eea6b3b8ac6006b7f9d20ec37 /source/blender/yafray/intern
parent3ed49f3299afb08762809a9babca72078e22ea54 (diff)
Yafray panel splitted in two so we can add more settings.
Also preliminar square arealight export, not usable yet, will be usefull as soon as photon export is added.
Diffstat (limited to 'source/blender/yafray/intern')
-rwxr-xr-xsource/blender/yafray/intern/export_File.cpp26
-rwxr-xr-xsource/blender/yafray/intern/export_File.h1
-rw-r--r--source/blender/yafray/intern/yafray_Render.cpp3
3 files changed, 22 insertions, 8 deletions
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;
}