diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 7a78816a2db..9d6180d870f 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -364,7 +364,7 @@ def rna2sphinx(BASEPATH): fw(" These parts of the API are relatively stable and are unlikely to change significantly\n") fw(" * data API, access to attributes of blender data such as mesh verts, material color, timeline frames and scene objects\n") fw(" * user interface functions for defining buttons, creation of menus, headers, panels\n") - fw(" * modules: bgl, mathutils and geometry\n") + fw(" * modules: bgl and mathutils\n") fw(" * game engine modules\n") fw("\n") diff --git a/release/scripts/op/console_python.py b/release/scripts/op/console_python.py index 3d9ed098de7..23ee157b279 100644 --- a/release/scripts/op/console_python.py +++ b/release/scripts/op/console_python.py @@ -268,7 +268,7 @@ def banner(context): add_scrollback("Execute: Enter", 'OUTPUT') add_scrollback("Autocomplete: Ctrl+Space", 'OUTPUT') add_scrollback("Ctrl +/- Wheel: Zoom", 'OUTPUT') - add_scrollback("Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bgl, blf, mathutils, geometry", 'OUTPUT') + add_scrollback("Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bgl, blf, mathutils", 'OUTPUT') add_scrollback("", 'OUTPUT') add_scrollback(" WARNING!!! Blender 2.5 API is subject to change, see API reference for more info.", 'ERROR') add_scrollback("", 'OUTPUT') diff --git a/release/scripts/op/io_scene_obj/import_obj.py b/release/scripts/op/io_scene_obj/import_obj.py index f6c5e625fb0..0a97d08bf99 100644 --- a/release/scripts/op/io_scene_obj/import_obj.py +++ b/release/scripts/op/io_scene_obj/import_obj.py @@ -35,7 +35,7 @@ import os import time import bpy import mathutils -from geometry import PolyFill +from mathutils.geometry import PolyFill from io_utils import load_image, unpack_list, unpack_face_list diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index 61a4478c5e4..38dfe79f1d6 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -256,7 +256,7 @@ class ShapeTransfer(bpy.types.Operator): ob.active_shape_key_index = len(me.shape_keys.keys) - 1 ob.show_shape_key = True - from geometry import BarycentricTransform + from mathutils.geometry import BarycentricTransform from mathutils import Vector if use_clamp and mode == 'OFFSET': diff --git a/release/scripts/op/uvcalc_smart_project.py b/release/scripts/op/uvcalc_smart_project.py index 83303f8f7f1..f82acf69b54 100644 --- a/release/scripts/op/uvcalc_smart_project.py +++ b/release/scripts/op/uvcalc_smart_project.py @@ -22,9 +22,8 @@ # -from mathutils import Matrix, Vector +from mathutils import Matrix, Vector, geometry import time -import geometry import bpy from math import cos, radians 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 similarity index 99% rename from source/blender/python/generic/geometry.c rename to 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 similarity index 100% rename from source/blender/python/generic/geometry.h rename to 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(); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 56ec61f9f4c..3ffef0db803 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -40,7 +40,6 @@ extern "C" { #include "bpy_internal_import.h" /* from the blender python api, but we want to import text too! */ #include "py_capi_utils.h" #include "mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use. - #include "geometry.h" // Blender.Geometry module copied here so the blenderlayer can use. #include "bgl.h" #include "blf_api.h"