[Bf-blender-cvs] [41a28c2] soc-2014-fluid: Compiling intermediate files for linking c++ code from bpy_interface.c
Roman Pogribnyi
noreply at git.blender.org
Thu Jul 10 23:02:48 CEST 2014
Commit: 41a28c2106481fdcd8912046f1efda4c09c947ef
Author: Roman Pogribnyi
Date: Thu Jul 10 23:02:13 2014 +0200
https://developer.blender.org/rB41a28c2106481fdcd8912046f1efda4c09c947ef
Compiling intermediate files for linking c++ code from bpy_interface.c
===================================================================
M source/blender/python/intern/bpy_interface.c
M source/blender/python/manta_pp/CMakeLists.txt
M source/blender/python/manta_pp/general.h
M source/blender/python/manta_pp/pwrapper/manta.h
A source/blender/python/manta_pp/pwrapper/manta_api.cpp
M source/blender/python/manta_pp/pwrapper/manta_api.h
M source/blender/python/manta_pp/pwrapper/registry.cpp
M source/blender/python/manta_pp/pwrapper/registry.h
===================================================================
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 89f39fe..6e5593f 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -222,7 +222,7 @@ static struct _inittab bpy_internal_modules[] = {
{(char *)"bgl", BPyInit_bgl},
{(char *)"blf", BPyInit_blf},
{(char *)"bmesh", BPyInit_bmesh},
- {(char *)"manta", PyInit_Main},
+ {(char *)"manta", PyInit_Manta},
// {(char *)"bmesh.types", BPyInit_bmesh_types},
// {(char *)"bmesh.utils", BPyInit_bmesh_utils},
// {(char *)"bmesh.utils", BPyInit_bmesh_geometry},
diff --git a/source/blender/python/manta_pp/CMakeLists.txt b/source/blender/python/manta_pp/CMakeLists.txt
index d58c81c..a386426 100644
--- a/source/blender/python/manta_pp/CMakeLists.txt
+++ b/source/blender/python/manta_pp/CMakeLists.txt
@@ -212,6 +212,7 @@ pwrapper/pythonInclude.h
pwrapper/registry.cpp
pwrapper/registry.h
pwrapper/manta_api.h
+pwrapper/manta_api.cpp
python/defines.py.reg.cpp
diff --git a/source/blender/python/manta_pp/general.h b/source/blender/python/manta_pp/general.h
index a4ac58a..9fc6766 100644
--- a/source/blender/python/manta_pp/general.h
+++ b/source/blender/python/manta_pp/general.h
@@ -130,6 +130,7 @@ template<class T> inline T clamp(const T& val, const T& vmin, const T& vmax) {
return val;
}
+ int test_test(){return 55;}
template<class T> inline T nmod(const T& a, const T& b);
template<> inline int nmod(const int& a, const int& b) { int c=a%b; return (c<0) ? (c+b) : c; }
template<> inline float nmod(const float& a, const float& b) { float c=std::fmod(a,b); return (c<0) ? (c+b) : c; }
diff --git a/source/blender/python/manta_pp/pwrapper/manta.h b/source/blender/python/manta_pp/pwrapper/manta.h
index e6905bd..ac0dbd3 100644
--- a/source/blender/python/manta_pp/pwrapper/manta.h
+++ b/source/blender/python/manta_pp/pwrapper/manta.h
@@ -23,8 +23,8 @@
//! @defgroup Plugins Plugins
//! @defgroup PyClasses Classes exposed to Python
-#include "../general.h"
#include "../util/vectorbase.h"
+#include "../general.h"
#include "registry.h"
#include "pclass.h"
#include "pconvert.h"
diff --git a/source/blender/python/manta_pp/pwrapper/manta_api.cpp b/source/blender/python/manta_pp/pwrapper/manta_api.cpp
new file mode 100644
index 0000000..2753229
--- /dev/null
+++ b/source/blender/python/manta_pp/pwrapper/manta_api.cpp
@@ -0,0 +1,14 @@
+#include "Python.h"
+#include "manta_api.h"
+#include "../manta.h"
+
+//#ifdef __cplusplus
+//extern "C" {
+//#endif
+ PyObject * PyInit_Manta(void)
+ {
+ return Pb::PyInit_Main();
+ }
+//#ifdef __cplusplus
+//}
+//#endif
\ No newline at end of file
diff --git a/source/blender/python/manta_pp/pwrapper/manta_api.h b/source/blender/python/manta_pp/pwrapper/manta_api.h
index 8a62db3..481e3b2 100644
--- a/source/blender/python/manta_pp/pwrapper/manta_api.h
+++ b/source/blender/python/manta_pp/pwrapper/manta_api.h
@@ -1,4 +1,5 @@
#ifndef _MANTA_API_H_
#define _MANTA_API_H_
-PyObject * PyInit_Main(void);
+//#include "pythonInclude.h"
+PyObject * PyInit_Manta(void);
#endif
diff --git a/source/blender/python/manta_pp/pwrapper/registry.cpp b/source/blender/python/manta_pp/pwrapper/registry.cpp
index 604b78f..3dce5b0 100644
--- a/source/blender/python/manta_pp/pwrapper/registry.cpp
+++ b/source/blender/python/manta_pp/pwrapper/registry.cpp
@@ -168,7 +168,7 @@ namespace Pb {
}
//PyMODINIT_FUNC PyInit_Main(void) {
-extern "C" PyObject *PyInit_Main(void) {
+PyObject *PyInit_Main(void) {
WrapperRegistry::instance().construct_lite();
#if PY_MAJOR_VERSION >= 3
return WrapperRegistry::instance().initModule();
diff --git a/source/blender/python/manta_pp/pwrapper/registry.h b/source/blender/python/manta_pp/pwrapper/registry.h
index 9fe7fbc..6fb4743 100644
--- a/source/blender/python/manta_pp/pwrapper/registry.h
+++ b/source/blender/python/manta_pp/pwrapper/registry.h
@@ -44,6 +44,7 @@ template<class T> struct Namify {
static const char* S;
};
}
+
namespace Pb {
// internal registry access
void setup(const std::string& filename, const std::vector<std::string>& args);
@@ -53,6 +54,7 @@ Manta::PbClass* objFromPy(PyObject* obj);
Manta::PbClass* createPy(const std::string& classname, const std::string& name, Manta::PbArgs& args, Manta::PbClass* parent);
void setReference(Manta::PbClass* cls, PyObject* obj);
PyObject* copyObject(Manta::PbClass* cls, const std::string& classname);
+PyObject *PyInit_Main(void);
// callback type
typedef void (*InitFunc)(PyObject*);
More information about the Bf-blender-cvs
mailing list