Yafray export code moved to source/blender/yafray to keep blender/src pure C
code. Now all the cpp code is in intern under yafray and the api include file is just plain C Also changed old include in initrender.c and updated Makefiles.am and configure.ac so the new dirs are taken into account.
This commit is contained in:
@@ -102,7 +102,7 @@
|
|||||||
#include "initrender.h"
|
#include "initrender.h"
|
||||||
|
|
||||||
/* yafray: include for yafray export/render */
|
/* yafray: include for yafray export/render */
|
||||||
#include "yafray_Render.h"
|
#include "YafRay_Api.h"
|
||||||
|
|
||||||
/* Some crud :/ */
|
/* Some crud :/ */
|
||||||
#define ELEM3(a, b, c, d) ( ELEM(a, b, c) || (a)==(d) )
|
#define ELEM3(a, b, c, d) ( ELEM(a, b, c) || (a)==(d) )
|
||||||
|
16
source/blender/yafray/YafRay_Api.h
Normal file
16
source/blender/yafray/YafRay_Api.h
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef __YAFRAY_API_H
|
||||||
|
#define __YAFRAY_API_H
|
||||||
|
|
||||||
|
/* C interface for Blender */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
int YAF_exportScene();
|
||||||
|
void YAF_displayImage();
|
||||||
|
void YAF_addDupliMtx(Object* obj);
|
||||||
|
int YAF_objectKnownData(Object* obj);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
@@ -5,6 +5,7 @@
|
|||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "yafray_Render.h"
|
#include "yafray_Render.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -118,7 +119,12 @@ bool yafrayRender_t::exportScene()
|
|||||||
string yfr = "yafray " + xmlpath;
|
string yfr = "yafray " + xmlpath;
|
||||||
if(system(yfr.c_str())==0)
|
if(system(yfr.c_str())==0)
|
||||||
displayImage();
|
displayImage();
|
||||||
else cout<<"Could not execute yafray. Is it in path?";
|
else
|
||||||
|
{
|
||||||
|
G.afbreek=1; //stop render and anim if doing so
|
||||||
|
cout<<"Could not execute yafray. Is it in path?"<<endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -1197,7 +1203,8 @@ bool yafrayRender_t::writeWorld()
|
|||||||
|
|
||||||
yafrayRender_t YAFBLEND;
|
yafrayRender_t YAFBLEND;
|
||||||
|
|
||||||
extern "C" {
|
extern "C"
|
||||||
|
{
|
||||||
|
|
||||||
int YAF_exportScene() { return (int)YAFBLEND.exportScene(); }
|
int YAF_exportScene() { return (int)YAFBLEND.exportScene(); }
|
||||||
void YAF_displayImage() { YAFBLEND.displayImage(); }
|
void YAF_displayImage() { YAFBLEND.displayImage(); }
|
@@ -116,17 +116,4 @@ extern yafrayRender_t YAFBLEND;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* C interface for Blender */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
int YAF_exportScene();
|
|
||||||
void YAF_displayImage();
|
|
||||||
void YAF_addDupliMtx(Object* obj);
|
|
||||||
int YAF_objectKnownData(Object* obj);
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif /*__YAFRAY_RENDER_H */
|
#endif /*__YAFRAY_RENDER_H */
|
Reference in New Issue
Block a user