diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-26 02:44:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-26 02:44:01 +0400 |
commit | 3264ced377ff159c7201b1c7d312c2f48d1327cf (patch) | |
tree | 435fd62a88e1efa75219332fb2faa9aeb8ffb838 /source/blender/python | |
parent | 29605fc06ddd8fb9a5d80df1389a0cbfb150c9b9 (diff) |
move geometry python module into mathutils.geometry, since it provides utility functions using mathutils types.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/generic/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/python/generic/mathutils.c | 5 | ||||
-rw-r--r-- | source/blender/python/generic/mathutils.h | 1 | ||||
-rw-r--r-- | source/blender/python/generic/mathutils_geometry.c (renamed from source/blender/python/generic/geometry.c) | 4 | ||||
-rw-r--r-- | source/blender/python/generic/mathutils_geometry.h (renamed from source/blender/python/generic/geometry.h) | 0 | ||||
-rw-r--r-- | source/blender/python/intern/bpy.c | 3 |
6 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/python/generic/CMakeLists.txt b/source/blender/python/generic/CMakeLists.txt index 4ac3fc36ebd..2f5551d4c96 100644 --- a/source/blender/python/generic/CMakeLists.txt +++ b/source/blender/python/generic/CMakeLists.txt @@ -34,10 +34,10 @@ SET(SRC bgl.c blf_api.c bpy_internal_import.c - geometry.c mathutils.c mathutils_color.c mathutils_euler.c + mathutils_geometry.c mathutils_matrix.c mathutils_quat.c mathutils_vector.c diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c index c1f24e413c8..f6b291622e3 100644 --- a/source/blender/python/generic/mathutils.c +++ b/source/blender/python/generic/mathutils.c @@ -249,6 +249,8 @@ PyObject *Mathutils_Init(void) { PyObject *submodule; + + if( PyType_Ready( &vector_Type ) < 0 ) return NULL; if( PyType_Ready( &matrix_Type ) < 0 ) @@ -270,6 +272,9 @@ PyObject *Mathutils_Init(void) PyModule_AddObject( submodule, "Quaternion", (PyObject *)&quaternion_Type ); PyModule_AddObject( submodule, "Color", (PyObject *)&color_Type ); + /* submodule */ + PyModule_AddObject( submodule, "geometry", Geometry_Init()); + mathutils_matrix_vector_cb_index= Mathutils_RegisterCallback(&mathutils_matrix_vector_cb); return (submodule); diff --git a/source/blender/python/generic/mathutils.h b/source/blender/python/generic/mathutils.h index 85fbe3225ba..d5dc48bd589 100644 --- a/source/blender/python/generic/mathutils.h +++ b/source/blender/python/generic/mathutils.h @@ -55,6 +55,7 @@ typedef struct { #include "mathutils_quat.h" #include "mathutils_euler.h" #include "mathutils_color.h" +#include "mathutils_geometry.h" PyObject *BaseMathObject_getOwner( BaseMathObject * self, void * ); PyObject *BaseMathObject_getWrapped( BaseMathObject *self, void * ); diff --git a/source/blender/python/generic/geometry.c b/source/blender/python/generic/mathutils_geometry.c index e0583cc0028..1644a502fa8 100644 --- a/source/blender/python/generic/geometry.c +++ b/source/blender/python/generic/mathutils_geometry.c @@ -27,7 +27,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -#include "geometry.h" +#include "mathutils_geometry.h" /* Used for PolyFill */ #include "BKE_displist.h" @@ -819,7 +819,7 @@ struct PyMethodDef M_Geometry_methods[] = { static struct PyModuleDef M_Geometry_module_def = { PyModuleDef_HEAD_INIT, - "geometry", /* m_name */ + "mathutils.geometry", /* m_name */ M_Geometry_doc, /* m_doc */ 0, /* m_size */ M_Geometry_methods, /* m_methods */ diff --git a/source/blender/python/generic/geometry.h b/source/blender/python/generic/mathutils_geometry.h index 401efcc7888..401efcc7888 100644 --- a/source/blender/python/generic/geometry.h +++ b/source/blender/python/generic/mathutils_geometry.h diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index afcf7e757e6..5a74e8412d1 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -38,7 +38,7 @@ #include "BKE_utildefines.h" /* external util modules */ -#include "../generic/geometry.h" +#include "../generic/mathutils.h" #include "../generic/bgl.h" #include "../generic/blf_api.h" #include "../generic/IDProp.h" @@ -195,7 +195,6 @@ void BPy_init_modules( void ) printf("bpy: couldnt find 'scripts/modules', blender probably wont start.\n"); } /* stand alone utility modules not related to blender directly */ - Geometry_Init(); Mathutils_Init(); Noise_Init(); BGL_Init(); |