diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-24 08:59:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-24 08:59:13 +0400 |
commit | b9b0c3dfb44e929b4b9f7181e8ee16ea7cff8deb (patch) | |
tree | ab4b0e25c2c8dde31ff7befdd34bab99741b4732 /source/blender/python/bmesh/bmesh_py_api.c | |
parent | 8aa569b52e8402f010ca3a8cc9a880c1c7729f49 (diff) |
bmesh python api - add/improve rst docstrings.
Diffstat (limited to 'source/blender/python/bmesh/bmesh_py_api.c')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_api.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c index ec8a5c1acf0..96604e7337d 100644 --- a/source/blender/python/bmesh/bmesh_py_api.c +++ b/source/blender/python/bmesh/bmesh_py_api.c @@ -49,7 +49,10 @@ PyDoc_STRVAR(bpy_bm_from_mesh_doc, ".. method:: from_mesh(mesh)\n" "\n" -" todo.\n" +" Return a BMesh from this mesh, currently the mesh must already be in editmode.\n" +"\n" +" :return: the BMesh assosiated with this mesh.\n" +" :rtype: :class:`bmesh.types.BMesh`\n" ); static PyObject *bpy_bm_from_mesh(PyObject *UNUSED(self), PyObject *value) @@ -88,15 +91,22 @@ static struct PyModuleDef BPy_BM_module_def = { PyObject *BPyInit_bmesh(void) { + PyObject *mod; PyObject *submodule; + PyObject *sys_modules = PySys_GetObject("modules"); /* not pretty */ BPy_BM_init_types(); - submodule = PyModule_Create(&BPy_BM_module_def); + mod = PyModule_Create(&BPy_BM_module_def); /* bmesh.types */ - PyModule_AddObject(submodule, "types", BPyInit_bmesh_types()); - PyModule_AddObject(submodule, "utils", BPyInit_bmesh_utils()); + PyModule_AddObject(mod, "types", (submodule=BPyInit_bmesh_types())); + PyDict_SetItemString(sys_modules, "bmesh.types", submodule); + Py_INCREF(submodule); + + PyModule_AddObject(mod, "utils", (submodule=BPyInit_bmesh_utils())); + PyDict_SetItemString(sys_modules, "bmesh.utils", submodule); + Py_INCREF(submodule); - return submodule; + return mod; } |