Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-14 07:15:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-14 07:15:25 +0300
commit72bc3f22b7d01349eaa82b58f8b03a1a26b738ba (patch)
tree2ad1f687b487dea019aa0cb4e9cf885e6df06cd1 /source
parent54190dd8e5562cf5f964e6bb60be170c9063c616 (diff)
python api renaming and added headers for some files which didnt have one, no functionality change.
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/generic/CMakeLists.txt24
-rw-r--r--source/blender/python/generic/IDProp.c2
-rw-r--r--source/blender/python/generic/IDProp.h5
-rw-r--r--source/blender/python/generic/bgl.c3
-rw-r--r--source/blender/python/generic/bgl.h2
-rw-r--r--source/blender/python/generic/mathutils.c2
-rw-r--r--source/blender/python/generic/mathutils.h12
-rw-r--r--source/blender/python/generic/mathutils_Color.c (renamed from source/blender/python/generic/mathutils_color.c)4
-rw-r--r--source/blender/python/generic/mathutils_Color.h (renamed from source/blender/python/generic/mathutils_color.h)2
-rw-r--r--source/blender/python/generic/mathutils_Euler.c (renamed from source/blender/python/generic/mathutils_euler.c)4
-rw-r--r--source/blender/python/generic/mathutils_Euler.h (renamed from source/blender/python/generic/mathutils_euler.h)2
-rw-r--r--source/blender/python/generic/mathutils_Matrix.c (renamed from source/blender/python/generic/mathutils_matrix.c)2
-rw-r--r--source/blender/python/generic/mathutils_Matrix.h (renamed from source/blender/python/generic/mathutils_matrix.h)2
-rw-r--r--source/blender/python/generic/mathutils_Quaternion.c (renamed from source/blender/python/generic/mathutils_quat.c)2
-rw-r--r--source/blender/python/generic/mathutils_Quaternion.h (renamed from source/blender/python/generic/mathutils_quat.h)2
-rw-r--r--source/blender/python/generic/mathutils_Vector.c (renamed from source/blender/python/generic/mathutils_vector.c)2
-rw-r--r--source/blender/python/generic/mathutils_Vector.h (renamed from source/blender/python/generic/mathutils_vector.h)2
-rw-r--r--source/blender/python/generic/mathutils_geometry.c2
-rw-r--r--source/blender/python/generic/mathutils_geometry.h1
-rw-r--r--source/blender/python/generic/noise_py_api.c (renamed from source/blender/python/generic/noise.c)2
-rw-r--r--source/blender/python/generic/noise_py_api.h29
-rw-r--r--source/blender/python/generic/py_capi_utils.c1
-rw-r--r--source/blender/python/intern/CMakeLists.txt1
-rw-r--r--source/blender/python/intern/bpy.c2
-rw-r--r--source/blender/python/intern/bpy_app.c3
-rw-r--r--source/blender/python/intern/bpy_app.h12
-rw-r--r--source/blender/python/intern/bpy_driver.h30
-rw-r--r--source/blender/python/intern/bpy_interface.c13
-rw-r--r--source/blender/python/intern/bpy_operator.c7
-rw-r--r--source/blender/python/intern/bpy_operator.h7
-rw-r--r--source/blender/python/intern/bpy_operator_wrap.c2
-rw-r--r--source/blender/python/intern/bpy_operator_wrap.h2
-rw-r--r--source/blender/python/intern/bpy_props.c4
-rw-r--r--source/blender/python/intern/bpy_props.h2
-rw-r--r--source/blender/python/intern/bpy_rna.c3
-rw-r--r--source/blender/python/intern/bpy_rna.h2
-rw-r--r--source/blender/python/intern/bpy_rna_array.c1
-rw-r--r--source/blender/python/intern/bpy_rna_callback.c1
-rw-r--r--source/blender/python/intern/bpy_util.c2
-rw-r--r--source/blender/python/intern/bpy_util.h2
40 files changed, 134 insertions, 71 deletions
diff --git a/source/blender/python/generic/CMakeLists.txt b/source/blender/python/generic/CMakeLists.txt
index 58d69db4a0e..b3dec148e9d 100644
--- a/source/blender/python/generic/CMakeLists.txt
+++ b/source/blender/python/generic/CMakeLists.txt
@@ -34,13 +34,13 @@ set(SRC
blf_py_api.c
bpy_internal_import.c
mathutils.c
- mathutils_color.c
- mathutils_euler.c
+ mathutils_Color.c
+ mathutils_Euler.c
+ mathutils_Matrix.c
+ mathutils_Quaternion.c
+ mathutils_Vector.c
mathutils_geometry.c
- mathutils_matrix.c
- mathutils_quat.c
- mathutils_vector.c
- noise.c
+ noise_py_api.c
py_capi_utils.c
IDProp.h
@@ -48,13 +48,15 @@ set(SRC
blf_py_api.h
bpy_internal_import.h
mathutils.h
- mathutils_color.h
- mathutils_euler.h
+ mathutils_Color.h
+ mathutils_Euler.h
+ mathutils_Matrix.h
+ mathutils_Quaternion.h
+ mathutils_Vector.h
mathutils_geometry.h
- mathutils_matrix.h
- mathutils_quat.h
- mathutils_vector.h
+ noise_py_api.h
py_capi_utils.h
)
+
blender_add_lib(bf_python_ext "${SRC}" "${INC}")
diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c
index ad0c96afa17..8004af95050 100644
--- a/source/blender/python/generic/IDProp.c
+++ b/source/blender/python/generic/IDProp.c
@@ -23,6 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
+
#include "IDProp.h"
#include "MEM_guardedalloc.h"
diff --git a/source/blender/python/generic/IDProp.h b/source/blender/python/generic/IDProp.h
index cd5bff4788e..b0a3b894f08 100644
--- a/source/blender/python/generic/IDProp.h
+++ b/source/blender/python/generic/IDProp.h
@@ -22,7 +22,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#include <Python.h>
+#ifndef IDPROP_H
+#define IDPROP_H
struct ID;
struct IDProperty;
@@ -62,3 +63,5 @@ void IDProp_Init_Types(void);
#define IDPROP_ITER_KEYS 0
#define IDPROP_ITER_ITEMS 1
+
+#endif /* IDPROP_H */
diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c
index 2b15a6f4826..63d310ae4e0 100644
--- a/source/blender/python/generic/bgl.c
+++ b/source/blender/python/generic/bgl.c
@@ -31,6 +31,8 @@
* The BGL submodule "wraps" OpenGL functions and constants,
* allowing script writers to make OpenGL calls in their Python scripts. */
+#include <Python.h>
+
#include "bgl.h" /*This must come first */
#include <GL/glew.h>
#include "MEM_guardedalloc.h"
@@ -38,7 +40,6 @@
#include "BLI_utildefines.h"
-
static char Method_Buffer_doc[] =
"(type, dimensions, [template]) - Create a new Buffer object\n\n\
(type) - The format to store data in\n\
diff --git a/source/blender/python/generic/bgl.h b/source/blender/python/generic/bgl.h
index 049b3f101a0..48462bc108e 100644
--- a/source/blender/python/generic/bgl.h
+++ b/source/blender/python/generic/bgl.h
@@ -36,8 +36,6 @@
#ifndef BGL_H
#define BGL_H
-#include <Python.h>
-
PyObject *BPyInit_bgl(void);
/*@ Create a buffer object */
diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c
index f56ac6c61bf..0098335169b 100644
--- a/source/blender/python/generic/mathutils.c
+++ b/source/blender/python/generic/mathutils.c
@@ -87,6 +87,8 @@
* - geometry.BarycentricTransform -> barycentric_transform
*/
+#include <Python.h>
+
#include "mathutils.h"
#include "BLI_math.h"
diff --git a/source/blender/python/generic/mathutils.h b/source/blender/python/generic/mathutils.h
index 07342f8144b..8442b66a1db 100644
--- a/source/blender/python/generic/mathutils.h
+++ b/source/blender/python/generic/mathutils.h
@@ -31,8 +31,6 @@
#ifndef MATHUTILS_H
#define MATHUTILS_H
-#include <Python.h>
-
/* Can cast different mathutils types to this, use for generic funcs */
extern char BaseMathObject_Wrapped_doc[];
@@ -50,11 +48,11 @@ typedef struct {
BASE_MATH_MEMBERS(data)
} BaseMathObject;
-#include "mathutils_vector.h"
-#include "mathutils_matrix.h"
-#include "mathutils_quat.h"
-#include "mathutils_euler.h"
-#include "mathutils_color.h"
+#include "mathutils_Vector.h"
+#include "mathutils_Matrix.h"
+#include "mathutils_Quaternion.h"
+#include "mathutils_Euler.h"
+#include "mathutils_Color.h"
#include "mathutils_geometry.h"
PyObject *BaseMathObject_getOwner( BaseMathObject * self, void * );
diff --git a/source/blender/python/generic/mathutils_color.c b/source/blender/python/generic/mathutils_Color.c
index f7e62242703..1c870ead438 100644
--- a/source/blender/python/generic/mathutils_color.c
+++ b/source/blender/python/generic/mathutils_Color.c
@@ -22,13 +22,13 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
+
#include "mathutils.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
-
-
#define COLOR_SIZE 3
//----------------------------------mathutils.Color() -------------------
diff --git a/source/blender/python/generic/mathutils_color.h b/source/blender/python/generic/mathutils_Color.h
index f3f185b2991..619cccbe085 100644
--- a/source/blender/python/generic/mathutils_color.h
+++ b/source/blender/python/generic/mathutils_Color.h
@@ -31,8 +31,6 @@
#ifndef MATHUTILS_COLOR_H
#define MATHUTILS_COLOR_H
-#include <Python.h>
-
extern PyTypeObject color_Type;
#define ColorObject_Check(_v) PyObject_TypeCheck((_v), &color_Type)
diff --git a/source/blender/python/generic/mathutils_euler.c b/source/blender/python/generic/mathutils_Euler.c
index b6040274065..c42387f77fb 100644
--- a/source/blender/python/generic/mathutils_euler.c
+++ b/source/blender/python/generic/mathutils_Euler.c
@@ -26,13 +26,13 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
+
#include "mathutils.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
-
-
#ifndef int32_t
#include "BLO_sys_types.h"
#endif
diff --git a/source/blender/python/generic/mathutils_euler.h b/source/blender/python/generic/mathutils_Euler.h
index fc4e4ddb667..1bb26ec21d2 100644
--- a/source/blender/python/generic/mathutils_euler.h
+++ b/source/blender/python/generic/mathutils_Euler.h
@@ -31,8 +31,6 @@
#ifndef MATHUTILS_EULER_H
#define MATHUTILS_EULER_H
-#include <Python.h>
-
extern PyTypeObject euler_Type;
#define EulerObject_Check(_v) PyObject_TypeCheck((_v), &euler_Type)
diff --git a/source/blender/python/generic/mathutils_matrix.c b/source/blender/python/generic/mathutils_Matrix.c
index 1da8141eef1..87979af61b7 100644
--- a/source/blender/python/generic/mathutils_matrix.c
+++ b/source/blender/python/generic/mathutils_Matrix.c
@@ -25,6 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
+
#include "mathutils.h"
#include "BLI_math.h"
diff --git a/source/blender/python/generic/mathutils_matrix.h b/source/blender/python/generic/mathutils_Matrix.h
index 7b980222048..505a7253f1a 100644
--- a/source/blender/python/generic/mathutils_matrix.h
+++ b/source/blender/python/generic/mathutils_Matrix.h
@@ -30,8 +30,6 @@
#ifndef MATHUTILS_MATRIX_H
#define MATHUTILS_MATRIX_H
-#include <Python.h>
-
extern PyTypeObject matrix_Type;
#define MatrixObject_Check(_v) PyObject_TypeCheck((_v), &matrix_Type)
#define MATRIX_MAX_DIM 4
diff --git a/source/blender/python/generic/mathutils_quat.c b/source/blender/python/generic/mathutils_Quaternion.c
index e577d808091..d4affd05abf 100644
--- a/source/blender/python/generic/mathutils_quat.c
+++ b/source/blender/python/generic/mathutils_Quaternion.c
@@ -26,6 +26,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
+
#include "mathutils.h"
#include "BLI_math.h"
diff --git a/source/blender/python/generic/mathutils_quat.h b/source/blender/python/generic/mathutils_Quaternion.h
index cfa82f20d42..6052dfa1a41 100644
--- a/source/blender/python/generic/mathutils_quat.h
+++ b/source/blender/python/generic/mathutils_Quaternion.h
@@ -31,8 +31,6 @@
#ifndef MATHUTILS_QUAT_H
#define MATHUTILS_QUAT_H
-#include <Python.h>
-
extern PyTypeObject quaternion_Type;
#define QuaternionObject_Check(_v) PyObject_TypeCheck((_v), &quaternion_Type)
diff --git a/source/blender/python/generic/mathutils_vector.c b/source/blender/python/generic/mathutils_Vector.c
index 0da5fe983ad..0efd805697f 100644
--- a/source/blender/python/generic/mathutils_vector.c
+++ b/source/blender/python/generic/mathutils_Vector.c
@@ -25,6 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
+
#include "mathutils.h"
#include "BLI_blenlib.h"
diff --git a/source/blender/python/generic/mathutils_vector.h b/source/blender/python/generic/mathutils_Vector.h
index 2dbe9d9d3fe..4013a392ff9 100644
--- a/source/blender/python/generic/mathutils_vector.h
+++ b/source/blender/python/generic/mathutils_Vector.h
@@ -31,8 +31,6 @@
#ifndef MATHUTILS_VECTOR_H
#define MATHUTILS_VECTOR_H
-#include <Python.h>
-
extern PyTypeObject vector_Type;
#define VectorObject_Check(_v) PyObject_TypeCheck((_v), &vector_Type)
diff --git a/source/blender/python/generic/mathutils_geometry.c b/source/blender/python/generic/mathutils_geometry.c
index d1e9a2452f3..62867eb46c1 100644
--- a/source/blender/python/generic/mathutils_geometry.c
+++ b/source/blender/python/generic/mathutils_geometry.c
@@ -27,6 +27,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
+
#include "mathutils_geometry.h"
/* Used for PolyFill */
diff --git a/source/blender/python/generic/mathutils_geometry.h b/source/blender/python/generic/mathutils_geometry.h
index 27c24848efe..1af25c7a751 100644
--- a/source/blender/python/generic/mathutils_geometry.h
+++ b/source/blender/python/generic/mathutils_geometry.h
@@ -31,7 +31,6 @@
#ifndef MATHUTILS_GEOMETRY_H
#define MATHUTILS_GEOMETRY_H
-#include <Python.h>
#include "mathutils.h"
PyMODINIT_FUNC BPyInit_mathutils_geometry(void);
diff --git a/source/blender/python/generic/noise.c b/source/blender/python/generic/noise_py_api.c
index 36147493dc5..73818971564 100644
--- a/source/blender/python/generic/noise.c
+++ b/source/blender/python/generic/noise_py_api.c
@@ -35,6 +35,7 @@
/************************/
#include <Python.h>
+
#include "structseq.h"
#include "BLI_blenlib.h"
@@ -42,6 +43,7 @@
#include "DNA_texture_types.h"
+#include "noise_py_api.h"
/*-----------------------------------------*/
/* 'mersenne twister' random number generator */
diff --git a/source/blender/python/generic/noise_py_api.h b/source/blender/python/generic/noise_py_api.h
new file mode 100644
index 00000000000..d1fe8ccc7b8
--- /dev/null
+++ b/source/blender/python/generic/noise_py_api.h
@@ -0,0 +1,29 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef NOISE_PY_API_H
+#define NOISE_PY_API_H
+
+PyObject *BPyInit_noise(void);
+
+#endif // NOISE_PY_API_H
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 9f7a9f2cabe..dedd6c1bcf4 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -21,6 +21,7 @@
*/
#include <Python.h>
+
#include "py_capi_utils.h"
/* for debugging */
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt
index 3c7804ab7e3..5d1a086bc75 100644
--- a/source/blender/python/intern/CMakeLists.txt
+++ b/source/blender/python/intern/CMakeLists.txt
@@ -52,6 +52,7 @@ set(SRC
bpy.h
bpy_app.h
+ bpy_driver.h
bpy_operator.h
bpy_operator_wrap.h
bpy_props.h
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index 15b705fd374..51e30d75e56 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -27,6 +27,8 @@
#define WITH_PYTHON /* for AUD_PyInit.h, possibly others */
+#include <Python.h>
+
#include "bpy.h"
#include "bpy_util.h"
#include "bpy_rna.h"
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 422563776f4..bc7e981df98 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -22,7 +22,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
+
#include "bpy_app.h"
+#include "bpy_driver.h"
#include "BLI_path_util.h"
#include "BLI_utildefines.h"
diff --git a/source/blender/python/intern/bpy_app.h b/source/blender/python/intern/bpy_app.h
index 02cadc66f48..cb71880ee7e 100644
--- a/source/blender/python/intern/bpy_app.h
+++ b/source/blender/python/intern/bpy_app.h
@@ -21,15 +21,9 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BPY_APP_H__
-#define BPY_APP_H__
-
-#include <Python.h>
+#ifndef BPY_APP_H
+#define BPY_APP_H
PyObject *BPY_app_struct( void );
-/* bpy_driver.c */
-int bpy_pydriver_create_dict(void);
-extern PyObject *bpy_pydriver_Dict;
-
-#endif
+#endif // BPY_APP_H
diff --git a/source/blender/python/intern/bpy_driver.h b/source/blender/python/intern/bpy_driver.h
new file mode 100644
index 00000000000..b9aa1b54b74
--- /dev/null
+++ b/source/blender/python/intern/bpy_driver.h
@@ -0,0 +1,30 @@
+/**
+ * $Id: bpy_app.h 33348 2010-11-27 02:39:51Z campbellbarton $
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef BPY_DRIVER_H
+#define BPY_DRIVER_H
+
+int bpy_pydriver_create_dict(void);
+extern PyObject *bpy_pydriver_Dict;
+
+#endif // BPY_DRIVER_H
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index cf47e40c2ed..0e9532aa726 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -56,6 +56,12 @@
#include "../generic/bpy_internal_import.h" // our own imports
#include "../generic/py_capi_utils.h"
+/* inittab initialization functions */
+#include "../generic/noise_py_api.h"
+#include "../generic/mathutils.h"
+#include "../generic/bgl.h"
+#include "../generic/blf_py_api.h"
+
/* for internal use, when starting and ending python scripts */
/* incase a python script triggers another python call, stop bpy_context_clear from invalidating */
@@ -197,12 +203,7 @@ void BPY_context_set(bContext *C)
BPy_SetContext(C);
}
-/* init-tab */
-extern PyObject *BPyInit_noise(void);
-extern PyObject *BPyInit_mathutils(void);
-// extern PyObject *BPyInit_mathutils_geometry(void); // BPyInit_mathutils calls, py doesnt work with thos :S
-extern PyObject *BPyInit_bgl(void);
-extern PyObject *BPyInit_blf(void);
+/* defined in AUD_C-API.cpp */
extern PyObject *AUD_initPython(void);
static struct _inittab bpy_internal_modules[]= {
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 70aa46c1302..bdf4027e509 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -24,9 +24,11 @@
*/
/* Note, this module is not to be used directly by the user.
- * its accessed from blender with bpy.__ops__
+ * Internally its exposed as '_bpy.ops', which provides functions for 'bpy.ops', a python package.
* */
+#include <Python.h>
+
#include "bpy_operator.h"
#include "bpy_operator_wrap.h"
#include "bpy_rna.h" /* for setting arg props only - pyrna_py_to_prop() */
@@ -41,6 +43,7 @@
#include "MEM_guardedalloc.h"
#include "BKE_report.h"
+#include "BKE_context.h"
static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args)
{
@@ -255,7 +258,7 @@ static PyObject *pyop_as_string(PyObject *UNUSED(self), PyObject *args)
char *buf = NULL;
PyObject *pybuf;
- bContext *C = (bContext *)BPy_GetContext();
+ bContext *C= (bContext *)BPy_GetContext();
if(C==NULL) {
PyErr_SetString(PyExc_SystemError, "Context is None, cant get the string representation of this object.");
diff --git a/source/blender/python/intern/bpy_operator.h b/source/blender/python/intern/bpy_operator.h
index 1a73b3eee55..f45f91dbe1f 100644
--- a/source/blender/python/intern/bpy_operator.h
+++ b/source/blender/python/intern/bpy_operator.h
@@ -25,13 +25,6 @@
#ifndef BPY_OPERATOR_H
#define BPY_OPERATOR_H
-#include <Python.h>
-
-#include "RNA_access.h"
-#include "RNA_types.h"
-#include "DNA_windowmanager_types.h"
-#include "BKE_context.h"
-
extern PyTypeObject pyop_base_Type;
#define BPy_OperatorBase_Check(v) (PyObject_TypeCheck(v, &pyop_base_Type))
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c
index 12c67f9e03f..51ab889e321 100644
--- a/source/blender/python/intern/bpy_operator_wrap.c
+++ b/source/blender/python/intern/bpy_operator_wrap.c
@@ -23,6 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
+
#include "bpy_operator_wrap.h"
#include "WM_api.h"
#include "WM_types.h"
diff --git a/source/blender/python/intern/bpy_operator_wrap.h b/source/blender/python/intern/bpy_operator_wrap.h
index b61fd1323f1..1aae06c302a 100644
--- a/source/blender/python/intern/bpy_operator_wrap.h
+++ b/source/blender/python/intern/bpy_operator_wrap.h
@@ -25,8 +25,6 @@
#ifndef BPY_OPERATOR_WRAP_H
#define BPY_OPERATOR_WRAP_H
-#include <Python.h>
-
/* these are used for operator methods, used by bpy_operator.c */
PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args);
#endif
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 7ed5db6e6dc..e685be2238f 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -22,14 +22,14 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
+
#include "bpy_props.h"
#include "bpy_rna.h"
#include "bpy_util.h"
#include "BLI_utildefines.h"
-
-
#include "RNA_define.h" /* for defining our own rna */
#include "RNA_enum_types.h"
diff --git a/source/blender/python/intern/bpy_props.h b/source/blender/python/intern/bpy_props.h
index fc295ccdf5d..136dd2b5b2f 100644
--- a/source/blender/python/intern/bpy_props.h
+++ b/source/blender/python/intern/bpy_props.h
@@ -25,8 +25,6 @@
#ifndef BPY_PROPS_H
#define BPY_PROPS_H
-#include <Python.h>
-
PyObject *BPY_rna_props( void );
#define PYRNA_STACK_ARRAY 32
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index f3626c5f6b7..184e20a9a4b 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -21,6 +21,9 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
+
+#include <Python.h>
+
#include <float.h> /* FLT_MIN/MAX */
#include "bpy_rna.h"
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h
index bbcc85581b2..c599ab5c95e 100644
--- a/source/blender/python/intern/bpy_rna.h
+++ b/source/blender/python/intern/bpy_rna.h
@@ -24,8 +24,6 @@
#ifndef BPY_RNA_H
#define BPY_RNA_H
-#include <Python.h>
-
#include "RNA_access.h"
#include "RNA_types.h"
#include "BKE_idprop.h"
diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c
index 32efa387196..b4eef666279 100644
--- a/source/blender/python/intern/bpy_rna_array.c
+++ b/source/blender/python/intern/bpy_rna_array.c
@@ -21,6 +21,7 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
#include "bpy_rna.h"
#include "BKE_global.h"
diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c
index 28b540ba418..0ff67430520 100644
--- a/source/blender/python/intern/bpy_rna_callback.c
+++ b/source/blender/python/intern/bpy_rna_callback.c
@@ -22,6 +22,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
#include "bpy_rna.h"
#include "bpy_rna_callback.h"
diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c
index 8ea5e646482..0e030170a25 100644
--- a/source/blender/python/intern/bpy_util.c
+++ b/source/blender/python/intern/bpy_util.c
@@ -22,6 +22,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <Python.h>
+
#include "bpy_util.h"
#include "BLI_dynstr.h"
#include "MEM_guardedalloc.h"
diff --git a/source/blender/python/intern/bpy_util.h b/source/blender/python/intern/bpy_util.h
index e89c8212e1b..e1473a563a6 100644
--- a/source/blender/python/intern/bpy_util.h
+++ b/source/blender/python/intern/bpy_util.h
@@ -22,8 +22,6 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#include <Python.h>
-
#ifndef BPY_UTIL_H
#define BPY_UTIL_H