This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/yafray/intern/export_Plugin.h
Brecht Van Lommel e435fbc3c5 Added custom vertex/edge/face data for meshes:
All data layers, including MVert/MEdge/MFace, are now managed as custom
data layers. The pointers like Mesh.mvert, Mesh.dvert or Mesh.mcol are
still used of course, but allocating, copying or freeing these arrays
should be done through the CustomData API.

Work in progress documentation on this is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData


Replaced TFace by MTFace:

This is the same struct, except that it does not contain color, that now
always stays separated in MCol. This was not a good design decision to
begin with, and it is needed for adding multiple color layers later. Note
that this does mean older Blender versions will not be able to read UV
coordinates from the next release, due to an SDNA limitation.


Removed DispListMesh:

This now fully replaced by DerivedMesh. To provide access to arrays of
vertices, edges and faces, like DispListMesh does. The semantics of the
DerivedMesh.getVertArray() and similar functions were changed to return
a pointer to an array if one exists, or otherwise allocate a temporary
one. On releasing the DerivedMesh, this temporary array will be removed
automatically.


Removed ssDM and meshDM DerivedMesh backends:

The ssDM backend was for DispListMesh, so that became obsolete automatically.
The meshDM backend was replaced by the custom data backend, that now figures
out which layers need to be modified, and only duplicates those.


This changes code in many places, and overall removes 2514 lines of code.
So, there's a good chance this might break some stuff, although I've been
testing it for a few days now. The good news is, adding multiple color and
uv layers should now become easy.
2006-11-20 04:28:02 +00:00

79 lines
2.4 KiB
C++

#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:
yafrayPluginRender_t()
{
plugin_loaded = false;
handle=NULL;
#ifdef WIN32
corehandle=NULL;
#endif
yafrayGate=NULL;
}
virtual ~yafrayPluginRender_t();
protected:
bool plugin_loaded;
std::string imgout;
PILdynlib *handle;
#ifdef WIN32
PILdynlib *corehandle;
#endif
yafray::yafrayInterface_t *yafrayGate;
void displayImage();
virtual void writeTextures();
virtual void writeShader(const std::string &shader_name, Material* matr, const std::string &facetexname="");
virtual void writeMaterialsAndModulators();
virtual void writeObject(Object* obj,
const std::vector<VlakRen*> &VLR_list, const float obmat[4][4]);
virtual void writeAllObjects();
virtual void writeAreaLamp(LampRen* lamp, int num, float iview[4][4]);
virtual void writeLamps();
virtual void writeCamera();
virtual void writeHemilight();
virtual void writePathlight();
virtual bool writeWorld();
virtual bool writeRender();
virtual bool initExport();
virtual bool finishExport();
void genUVcoords(std::vector<yafray::GFLOAT> &uvcoords,VlakRen *vlr,MTFace* uvc, bool comple=false);
void genVcol(std::vector<yafray::CFLOAT> &vcol, VlakRen *vlr, bool comple=false);
void genFace(std::vector<int> &faces,std::vector<std::string> &shaders,std::vector<int> &faceshader,
std::vector<yafray::GFLOAT> &uvcoords,std::vector<yafray::CFLOAT> &vcol,
std::map<VertRen*, int> &vert_idx,VlakRen *vlr,
int has_orco,bool has_uv);
void genCompleFace(std::vector<int> &faces,/*std::vector<std::string> &shaders,*/std::vector<int> &faceshader,
std::vector<yafray::GFLOAT> &uvcoords,std::vector<yafray::CFLOAT> &vcol,
std::map<VertRen*, int> &vert_idx,VlakRen *vlr,
int has_orco,bool has_uv);
void genVertices(std::vector<yafray::point3d_t> &verts, int &vidx,
std::map<VertRen*, int> &vert_idx, VlakRen* vlr, int has_orco, Object* obj);
};
class blenderYafrayOutput_t : public yafray::colorOutput_t
{
public:
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() {}
protected:
Render* re;
int out;
};
#endif