[Bf-blender-cvs] [8d52f856993] fluid-mantaflow: cleanup in blender python

Sebastián Barschkis noreply at git.blender.org
Sun Mar 26 20:41:18 CEST 2017


Commit: 8d52f856993bee4dfe8513c90369694800b4a877
Author: Sebastián Barschkis
Date:   Thu Mar 16 00:28:11 2017 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB8d52f856993bee4dfe8513c90369694800b4a877

cleanup in blender python

===================================================================

M	intern/mantaflow/extern/manta_python_API.h
M	intern/mantaflow/intern/manta_python_API.cpp
M	source/blender/python/intern/bpy_app_build_options.c
M	source/blender/python/intern/bpy_interface.c

===================================================================

diff --git a/intern/mantaflow/extern/manta_python_API.h b/intern/mantaflow/extern/manta_python_API.h
index 85bae124629..9802bc657f6 100644
--- a/intern/mantaflow/extern/manta_python_API.h
+++ b/intern/mantaflow/extern/manta_python_API.h
@@ -34,7 +34,7 @@
 extern "C" {
 #endif
 
-PyObject* PyInit_Manta(void);
+PyObject* Manta_initPython(void);
 
 #ifdef __cplusplus
 }
diff --git a/intern/mantaflow/intern/manta_python_API.cpp b/intern/mantaflow/intern/manta_python_API.cpp
index a37eadbb7c7..6b0b2c78472 100644
--- a/intern/mantaflow/intern/manta_python_API.cpp
+++ b/intern/mantaflow/intern/manta_python_API.cpp
@@ -31,7 +31,7 @@
 #include "manta_python_API.h"
 #include "manta.h"
 
-PyObject* PyInit_Manta(void)
+PyObject* Manta_initPython(void)
 {
 	return Pb::PyInit_Main();
 }
diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c
index a6b98567a9a..5f9b6ca73a1 100644
--- a/source/blender/python/intern/bpy_app_build_options.c
+++ b/source/blender/python/intern/bpy_app_build_options.c
@@ -70,6 +70,7 @@ static PyStructSequence_Field app_builtopts_info_fields[] = {
 	{(char *)"openmp", NULL},
 	{(char *)"openvdb", NULL},
 	{(char *)"alembic", NULL},
+	{(char *)"manta", NULL},
 	{NULL}
 };
 
@@ -310,6 +311,12 @@ static PyObject *make_builtopts_info(void)
 	SetObjIncref(Py_False);
 #endif
 
+#ifdef WITH_MANTA
+	SetObjIncref(Py_True);
+#else
+	SetObjIncref(Py_False);
+#endif
+
 #undef SetObjIncref
 
 	return builtopts_info;
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index f6178f7c0fc..0447940bb18 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -75,9 +75,6 @@
 #include "../bmesh/bmesh_py_api.h"
 #include "../mathutils/mathutils.h"
 
-#include "manta_python_API.h"
-
-
 /* for internal use, when starting and ending python scripts */
 
 /* in case a python script triggers another python call, stop bpy_context_clear from invalidating */
@@ -195,8 +192,15 @@ void BPY_context_set(bContext *C)
 	BPy_SetContext(C);
 }
 
+#ifdef WITH_MANTA
+/* defined in manta module */
+extern PyObject *Manta_initPython(void);
+#endif
+
+#ifdef WITH_AUDASPACE
 /* defined in AUD_C-API.cpp */
 extern PyObject *AUD_initPython(void);
+#endif
 
 #ifdef WITH_CYCLES
 /* defined in cycles module */
@@ -217,12 +221,14 @@ static struct _inittab bpy_internal_modules[] = {
 	{"bgl", BPyInit_bgl},
 	{"blf", BPyInit_blf},
 	{"bmesh", BPyInit_bmesh},
-	{ "manta", PyInit_Manta},
 #if 0
 	{"bmesh.types", BPyInit_bmesh_types},
 	{"bmesh.utils", BPyInit_bmesh_utils},
 	{"bmesh.utils", BPyInit_bmesh_geometry},
 #endif
+#ifdef WITH_MANTA
+	{"manta", Manta_initPython},
+#endif
 #ifdef WITH_AUDASPACE
 	{"aud", AUD_initPython},
 #endif




More information about the Bf-blender-cvs mailing list