2004-06-16 18:44:12 +00:00
|
|
|
#ifndef __EXPORT_PLUGIN_H
|
|
|
|
|
#define __EXPORT_PLUGIN_H
|
|
|
|
|
|
|
|
|
|
#include"yafray_Render.h"
|
|
|
|
|
#include"yafexternal.h"
|
|
|
|
|
extern "C"
|
|
|
|
|
{
|
|
|
|
|
#include"PIL_dynlib.h"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class yafrayPluginRender_t : public yafrayRender_t
|
|
|
|
|
{
|
|
|
|
|
public:
|
2004-06-21 08:17:05 +00:00
|
|
|
yafrayPluginRender_t()
|
|
|
|
|
{
|
2004-11-29 05:33:32 +00:00
|
|
|
plugin_loaded = false;
|
2004-06-21 08:17:05 +00:00
|
|
|
handle=NULL;
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
corehandle=NULL;
|
|
|
|
|
#endif
|
|
|
|
|
yafrayGate=NULL;
|
|
|
|
|
}
|
2004-06-16 18:44:12 +00:00
|
|
|
virtual ~yafrayPluginRender_t();
|
|
|
|
|
protected:
|
2004-11-29 05:33:32 +00:00
|
|
|
bool plugin_loaded;
|
2004-06-16 18:44:12 +00:00
|
|
|
std::string imgout;
|
|
|
|
|
PILdynlib *handle;
|
2004-06-21 08:17:05 +00:00
|
|
|
#ifdef WIN32
|
|
|
|
|
PILdynlib *corehandle;
|
|
|
|
|
#endif
|
2004-06-16 18:44:12 +00:00
|
|
|
|
|
|
|
|
yafray::yafrayInterface_t *yafrayGate;
|
|
|
|
|
|
|
|
|
|
void displayImage();
|
|
|
|
|
virtual void writeTextures();
|
Bugfixes:
Blender hemilight shadow flag now ignored (reported by varuag).
Texture axes were not exported for procedural textures.
Duplicate armatures were not handled correctly (reported by richie).
Triangle uv-coord splitting (reported by anael, richie & Alvaro).
Additions:
Material 'TexFace' mode now works too, as in Blender it functions as an extra
first texture channel, replacing the base color.
The new noise functions for procedural textures are now supported in yafray,
but is not quite completed yet, still undergoing changes.
(needs yafray from cvs).
The 'power' button has been renamed to 'EmitPwr', since it controls background,
arealight (including lamp with radius) & material emit power.
This button can now be used with the 'SkyDome' method as well to control
background lighting.
To control indirect lighting power, a button called 'GI pwr' has been added,
only use this when really necessary, first try modifying 'EmitPwr' instead.
Removed:
The 'gradient' button. This includes the python code to set
this parameter as well.
2004-10-26 00:52:12 +00:00
|
|
|
virtual void writeShader(const std::string &shader_name, Material* matr, const std::string &facetexname="");
|
2004-06-16 18:44:12 +00:00
|
|
|
virtual void writeMaterialsAndModulators();
|
2008-01-21 23:17:19 +00:00
|
|
|
virtual void writeObject(Object* obj, ObjectRen *obr,
|
2004-06-16 18:44:12 +00:00
|
|
|
const std::vector<VlakRen*> &VLR_list, const float obmat[4][4]);
|
|
|
|
|
virtual void writeAllObjects();
|
Bugfixes:
Blender hemilight shadow flag now ignored (reported by varuag).
Texture axes were not exported for procedural textures.
Duplicate armatures were not handled correctly (reported by richie).
Triangle uv-coord splitting (reported by anael, richie & Alvaro).
Additions:
Material 'TexFace' mode now works too, as in Blender it functions as an extra
first texture channel, replacing the base color.
The new noise functions for procedural textures are now supported in yafray,
but is not quite completed yet, still undergoing changes.
(needs yafray from cvs).
The 'power' button has been renamed to 'EmitPwr', since it controls background,
arealight (including lamp with radius) & material emit power.
This button can now be used with the 'SkyDome' method as well to control
background lighting.
To control indirect lighting power, a button called 'GI pwr' has been added,
only use this when really necessary, first try modifying 'EmitPwr' instead.
Removed:
The 'gradient' button. This includes the python code to set
this parameter as well.
2004-10-26 00:52:12 +00:00
|
|
|
virtual void writeAreaLamp(LampRen* lamp, int num, float iview[4][4]);
|
2004-06-16 18:44:12 +00:00
|
|
|
virtual void writeLamps();
|
|
|
|
|
virtual void writeCamera();
|
|
|
|
|
virtual void writeHemilight();
|
|
|
|
|
virtual void writePathlight();
|
|
|
|
|
virtual bool writeWorld();
|
|
|
|
|
virtual bool writeRender();
|
|
|
|
|
virtual bool initExport();
|
|
|
|
|
virtual bool finishExport();
|
|
|
|
|
|
2008-01-21 23:17:19 +00:00
|
|
|
void genUVcoords(std::vector<yafray::GFLOAT> &uvcoords,ObjectRen *obr,VlakRen *vlr,MTFace* uvc, bool comple=false);
|
|
|
|
|
void genVcol(std::vector<yafray::CFLOAT> &vcol, ObjectRen *obr, VlakRen *vlr, bool comple=false);
|
2004-06-16 18:44:12 +00:00
|
|
|
void genFace(std::vector<int> &faces,std::vector<std::string> &shaders,std::vector<int> &faceshader,
|
2004-06-17 11:24:30 +00:00
|
|
|
std::vector<yafray::GFLOAT> &uvcoords,std::vector<yafray::CFLOAT> &vcol,
|
2008-01-21 23:17:19 +00:00
|
|
|
std::map<VertRen*, int> &vert_idx,ObjectRen *obr,VlakRen *vlr,
|
2006-06-05 02:24:12 +00:00
|
|
|
int has_orco,bool has_uv);
|
2004-06-16 18:44:12 +00:00
|
|
|
void genCompleFace(std::vector<int> &faces,/*std::vector<std::string> &shaders,*/std::vector<int> &faceshader,
|
2004-06-17 11:24:30 +00:00
|
|
|
std::vector<yafray::GFLOAT> &uvcoords,std::vector<yafray::CFLOAT> &vcol,
|
2008-01-21 23:17:19 +00:00
|
|
|
std::map<VertRen*, int> &vert_idx,ObjectRen *obr, VlakRen *vlr,
|
2006-06-05 02:24:12 +00:00
|
|
|
int has_orco,bool has_uv);
|
2004-07-12 03:20:31 +00:00
|
|
|
void genVertices(std::vector<yafray::point3d_t> &verts, int &vidx,
|
2008-01-21 23:17:19 +00:00
|
|
|
std::map<VertRen*, int> &vert_idx, ObjectRen *obr, VlakRen* vlr, int has_orco, Object* obj);
|
2004-06-16 18:44:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class blenderYafrayOutput_t : public yafray::colorOutput_t
|
|
|
|
|
{
|
|
|
|
|
public:
|
2006-05-29 03:59:12 +00:00
|
|
|
blenderYafrayOutput_t(Render* re):out(0) { this->re = re; }
|
|
|
|
|
virtual ~blenderYafrayOutput_t() {}
|
|
|
|
|
virtual bool putPixel(int x, int y, const yafray::color_t &c,
|
|
|
|
|
yafray::CFLOAT alpha=0, yafray::PFLOAT depth=0);
|
|
|
|
|
virtual void flush() {}
|
2004-06-16 18:44:12 +00:00
|
|
|
protected:
|
2006-05-29 03:59:12 +00:00
|
|
|
Render* re;
|
2004-06-16 18:44:12 +00:00
|
|
|
int out;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|