own recent commit broke this python import:
from mathutils.geometry import PolyFill I couldn't find a way for python's inittab to do this so just inserting mathutils.geometry into sys.modules manually.
This commit is contained in:
		@@ -248,6 +248,7 @@ static struct PyModuleDef M_Mathutils_module_def = {
 | 
			
		||||
PyMODINIT_FUNC BPyInit_mathutils(void)
 | 
			
		||||
{
 | 
			
		||||
	PyObject *submodule;
 | 
			
		||||
	PyObject *item;
 | 
			
		||||
 | 
			
		||||
	if( PyType_Ready( &vector_Type ) < 0 )
 | 
			
		||||
		return NULL;
 | 
			
		||||
@@ -270,8 +271,13 @@ PyMODINIT_FUNC BPyInit_mathutils(void)
 | 
			
		||||
	PyModule_AddObject( submodule, "Color",			(PyObject *)&color_Type );
 | 
			
		||||
	
 | 
			
		||||
	/* submodule */
 | 
			
		||||
	PyModule_AddObject( submodule, "geometry",		BPyInit_mathutils_geometry());
 | 
			
		||||
	
 | 
			
		||||
	PyModule_AddObject( submodule, "geometry",		(item=BPyInit_mathutils_geometry()));
 | 
			
		||||
	/* XXX, python doesnt do imports with this usefully yet
 | 
			
		||||
	 * 'from mathutils.geometry import PolyFill'
 | 
			
		||||
	 * ...fails without this. */
 | 
			
		||||
	PyDict_SetItemString(PyThreadState_GET()->interp->modules, "mathutils.geometry", item);
 | 
			
		||||
	Py_INCREF(item);
 | 
			
		||||
 | 
			
		||||
	mathutils_matrix_vector_cb_index= Mathutils_RegisterCallback(&mathutils_matrix_vector_cb);
 | 
			
		||||
 | 
			
		||||
	return submodule;
 | 
			
		||||
 
 | 
			
		||||
@@ -199,6 +199,7 @@ void BPY_set_context(bContext *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);
 | 
			
		||||
extern PyObject *AUD_initPython(void);
 | 
			
		||||
@@ -206,6 +207,7 @@ extern PyObject *AUD_initPython(void);
 | 
			
		||||
static struct _inittab bpy_internal_modules[]= {
 | 
			
		||||
	{"noise", BPyInit_noise},
 | 
			
		||||
	{"mathutils", BPyInit_mathutils},
 | 
			
		||||
//	{"mathutils.geometry", BPyInit_mathutils_geometry},
 | 
			
		||||
	{"bgl", BPyInit_bgl},
 | 
			
		||||
	{"blf", BPyInit_blf},
 | 
			
		||||
	{"aud", AUD_initPython},
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user