From edb04d1461536f214f8afa46cce6b34cdc770afc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 24 Feb 2012 09:53:29 +0000 Subject: [PATCH] bmesh docs now written in sphinx doc generator. * http://www.blender.org/documentation/blender_python_api_2_62_0/bmesh.types.html * http://www.blender.org/documentation/blender_python_api_2_62_0/bmesh.utils.html --- doc/python_api/sphinx_doc_gen.py | 30 +++++++++++++++++-- .../Detour/Source/DetourStatNavMesh.cpp | 2 +- .../Recast/Source/RecastLayers.cpp | 2 +- source/blender/makesrna/intern/rna_nodetree.c | 4 +-- source/blender/python/bmesh/bmesh_py_types.c | 26 +++++++++++++++- 5 files changed, 56 insertions(+), 8 deletions(-) diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 9540039882e..9c1dede9019 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -66,12 +66,12 @@ if 1: FILTER_BPY_OPS = None else: - EXCLUDE_INFO_DOCS = False + EXCLUDE_INFO_DOCS = True # for testing so doc-builds dont take so long. EXCLUDE_MODULES = ( "bpy.context", - #"bpy.app", - #"bpy.app.handlers", + "bpy.app", + "bpy.app.handlers", "bpy.path", "bpy.data", "bpy.props", @@ -88,6 +88,9 @@ else: "mathutils", "mathutils.geometry", "mathutils.noise", + #"bmesh", + #"bmesh.types", + #"bmesh.utils", ) FILTER_BPY_TYPES = ("bpy_struct", "Operator", "ID") # allow @@ -1189,12 +1192,14 @@ def rna2sphinx(BASEPATH): fw(".. toctree::\n") fw(" :maxdepth: 1\n\n") + # mathutils if "mathutils" not in EXCLUDE_MODULES: fw(" mathutils.rst\n\n") if "mathutils.geometry" not in EXCLUDE_MODULES: fw(" mathutils.geometry.rst\n\n") if "mathutils.noise" not in EXCLUDE_MODULES: fw(" mathutils.noise.rst\n\n") + # misc if "bgl" not in EXCLUDE_MODULES: fw(" bgl.rst\n\n") if "blf" not in EXCLUDE_MODULES: @@ -1205,6 +1210,13 @@ def rna2sphinx(BASEPATH): fw(" aud.rst\n\n") if "bpy_extras" not in EXCLUDE_MODULES: fw(" bpy_extras.rst\n\n") + # bmesh + if "bmesh" not in EXCLUDE_MODULES: + fw(" bmesh.rst\n\n") + if "bmesh.types" not in EXCLUDE_MODULES: + fw(" bmesh.types.rst\n\n") + if "bmesh.utils" not in EXCLUDE_MODULES: + fw(" bmesh.utils.rst\n\n") # game engine if "bge" not in EXCLUDE_MODULES: @@ -1338,6 +1350,18 @@ def rna2sphinx(BASEPATH): import mathutils.noise as module pymodule2sphinx(BASEPATH, "mathutils.noise", module, "Noise Utilities") + if "bmesh" not in EXCLUDE_MODULES: + import bmesh as module + pymodule2sphinx(BASEPATH, "bmesh", module, "BMesh Module") + + if "bmesh.types" not in EXCLUDE_MODULES: + import bmesh.types as module + pymodule2sphinx(BASEPATH, "bmesh.types", module, "BMesh Types") + + if "bmesh.utils" not in EXCLUDE_MODULES: + import bmesh.utils as module + pymodule2sphinx(BASEPATH, "bmesh.utils", module, "BMesh Utilities") + if "blf" not in EXCLUDE_MODULES: import blf as module pymodule2sphinx(BASEPATH, "blf", module, "Font Drawing") diff --git a/extern/recastnavigation/Detour/Source/DetourStatNavMesh.cpp b/extern/recastnavigation/Detour/Source/DetourStatNavMesh.cpp index bf59cd89dda..8da8e2c1e1e 100644 --- a/extern/recastnavigation/Detour/Source/DetourStatNavMesh.cpp +++ b/extern/recastnavigation/Detour/Source/DetourStatNavMesh.cpp @@ -566,7 +566,7 @@ float dtStatNavMesh::findDistanceToWall(dtStatPolyRef centerRef, const float* ce hitPos[2] = vj[2] + (vi[2] - vj[2])*tseg; } - // Check to see if teh circle expands to one of the neighbours and expand. + // Check to see if the circle expands to one of the neighbours and expand. for (int i = 0, j = (int)poly->nv-1; i < (int)poly->nv; j = i++) { // Skip solid edges. diff --git a/extern/recastnavigation/Recast/Source/RecastLayers.cpp b/extern/recastnavigation/Recast/Source/RecastLayers.cpp index 617cf45fe66..2d9658b2bed 100644 --- a/extern/recastnavigation/Recast/Source/RecastLayers.cpp +++ b/extern/recastnavigation/Recast/Source/RecastLayers.cpp @@ -368,7 +368,7 @@ bool rcBuildHeightfieldLayers(rcContext* ctx, rcCompactHeightfield& chf, rcLayerRegion& rj = regs[j]; if (!rj.base) continue; - // Skip if teh regions are not close to each other. + // Skip if the regions are not close to each other. if (!overlapRange(ri.ymin,ri.ymax+mergeHeight, rj.ymin,rj.ymax+mergeHeight)) continue; // Skip if the height range would become too large. diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 42668c6080c..b20684da658 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -628,7 +628,7 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *UNUSED(C), Repor static bNode *rna_NodeTree_node_composite_new(bNodeTree *ntree, bContext *C, ReportList *reports, int type, bNodeTree *group) { - /* raises error on failier */ + /* raises error on failure */ bNode *node= rna_NodeTree_node_new(ntree, C, reports, type, group); if (node) { @@ -653,7 +653,7 @@ static bNode *rna_NodeTree_node_composite_new(bNodeTree *ntree, bContext *C, Rep static bNode *rna_NodeTree_node_texture_new(bNodeTree *ntree, bContext *C, ReportList *reports, int type, bNodeTree *group) { - /* raises error on failier */ + /* raises error on failure */ bNode *node= rna_NodeTree_node_new(ntree, C, reports, type, group); if (node) { diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 750b6002fa6..b8bfad8bea5 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -126,6 +126,7 @@ static int bpy_bm_elem_hflag_set(BPy_BMElem *self, PyObject *value, void *flag) } } + PyDoc_STRVAR(bpy_bm_elem_index_doc, "Index of this element.\n" "\n" @@ -137,7 +138,7 @@ PyDoc_STRVAR(bpy_bm_elem_index_doc, "\n" " It's also possible to assign any number to this attribute for a scripts internal logic.\n" "\n" -" To ensure the value is up to date - see :class:`BMesh.update` **index** argument.\n" +" To ensure the value is up to date - see :class:`BMElemSeq.index_update`.\n" ); static PyObject *bpy_bm_elem_index_get(BPy_BMElem *self, void *UNUSED(flag)) { @@ -194,6 +195,7 @@ static PyObject *bpy_bmelemseq_get(BPy_BMesh *self, void *itype) return BPy_BMElemSeq_CreatePyObject(self->bm, NULL, GET_INT_FROM_POINTER(itype)); } + /* vert */ PyDoc_STRVAR(bpy_bmvert_link_edges_doc, "Edges connected to this vertex (read-only).\n\n:type: :class:`BMElemSeq` of :class:`BMVert`" @@ -235,6 +237,7 @@ static PyObject *bpy_bmelemseq_elem_get(BPy_BMElem *self, void *itype) return BPy_BMElemSeq_CreatePyObject(self->bm, self, GET_INT_FROM_POINTER(itype)); } + PyDoc_STRVAR(bpy_bm_is_valid_doc, "True when this element is valid (hasn't been removed).\n\n:type: boolean" ); @@ -297,6 +300,7 @@ static int bpy_bmvert_co_set(BPy_BMVert *self, PyObject *value) } } + PyDoc_STRVAR(bpy_bmvert_normal_doc, "The normal for this vertex as a 3D, wrapped vector.\n\n:type: :class:`mathutils.Vector`" ); @@ -318,6 +322,7 @@ static int bpy_bmvert_normal_set(BPy_BMVert *self, PyObject *value) } } + PyDoc_STRVAR(bpy_bmvert_is_manifold_doc, "True when this vertex is manifold (read-only).\n\n:type: boolean" ); @@ -327,6 +332,7 @@ static PyObject *bpy_bmvert_is_manifold_get(BPy_BMVert *self) return PyBool_FromLong(BM_vert_is_manifold(self->bm, self->v)); } + PyDoc_STRVAR(bpy_bmvert_is_wire_doc, "True when this vertex is not connected to any faces (read-only).\n\n:type: boolean" ); @@ -336,6 +342,7 @@ static PyObject *bpy_bmvert_is_wire_get(BPy_BMVert *self) return PyBool_FromLong(BM_vert_is_wire(self->bm, self->v)); } + /* Edge * ^^^^ */ @@ -348,6 +355,7 @@ static PyObject *bpy_bmedge_is_manifold_get(BPy_BMEdge *self) return PyBool_FromLong(BM_edge_is_manifold(self->bm, self->e)); } + PyDoc_STRVAR(bpy_bmedge_is_wire_doc, "True when this edge is not connected to any faces (read-only).\n\n:type: boolean" ); @@ -357,6 +365,7 @@ static PyObject *bpy_bmedge_is_wire_get(BPy_BMEdge *self) return PyBool_FromLong(BM_edge_is_wire(self->bm, self->e)); } + PyDoc_STRVAR(bpy_bmedge_is_boundary_doc, "True when this edge is at the boundary of a face (read-only).\n\n:type: boolean" ); @@ -366,6 +375,7 @@ static PyObject *bpy_bmedge_is_boundary_get(BPy_BMEdge *self) return PyBool_FromLong(BM_edge_is_boundary(self->e)); } + /* Face * ^^^^ */ @@ -493,6 +503,7 @@ static PyGetSetDef bpy_bmloop_getseters[] = { /* Methods * ======= */ + /* Mesh * ---- */ @@ -510,6 +521,7 @@ static PyObject *bpy_bmesh_select_flush_mode(BPy_BMesh *self) Py_RETURN_NONE; } + PyDoc_STRVAR(bpy_bmesh_select_flush_doc, ".. method:: select_flush(select)\n" "\n" @@ -536,6 +548,7 @@ static PyObject *bpy_bmesh_select_flush(BPy_BMesh *self, PyObject *value) Py_RETURN_NONE; } + PyDoc_STRVAR(bpy_bmesh_normal_update_doc, ".. method:: normal_update(skip_hidden=False)\n" "\n" @@ -628,6 +641,7 @@ static PyObject *bpy_bmesh_transform(BPy_BMElem *self, PyObject *args, PyObject Py_RETURN_NONE; } + /* Elem * ---- */ @@ -657,6 +671,7 @@ static PyObject *bpy_bm_elem_select_set(BPy_BMElem *self, PyObject *value) Py_RETURN_NONE; } + PyDoc_STRVAR(bpy_bm_elem_copy_from_doc, ".. method:: copy_from(select)\n" "\n" @@ -693,6 +708,7 @@ static PyObject *bpy_bmvert_calc_edge_angle(BPy_BMVert *self) return PyFloat_FromDouble(BM_vert_edge_angle(self->bm, self->v)); } + /* Edge * ---- */ @@ -710,6 +726,7 @@ static PyObject *bpy_bmedge_calc_face_angle(BPy_BMEdge *self) return PyFloat_FromDouble(BM_edge_face_angle(self->bm, self->e)); } + PyDoc_STRVAR(bpy_bmedge_other_vert_doc, ".. method:: other_vert(vert)\n" "\n" @@ -751,6 +768,7 @@ static PyObject *bpy_bmedge_other_vert(BPy_BMEdge *self, BPy_BMVert *value) } } + /* Face * ---- */ @@ -797,6 +815,7 @@ static PyObject *bpy_bmface_copy(BPy_BMFace *self, PyObject *args, PyObject *kw) } } + PyDoc_STRVAR(bpy_bmface_calc_area_doc, ".. method:: calc_area()\n" "\n" @@ -811,6 +830,7 @@ static PyObject *bpy_bmface_calc_area(BPy_BMFace *self) return PyFloat_FromDouble(BM_face_area_calc(self->bm, self->f)); } + PyDoc_STRVAR(bpy_bmface_calc_center_mean_doc, ".. method:: calc_center_median()\n" "\n" @@ -828,6 +848,7 @@ static PyObject *bpy_bmface_calc_center_mean(BPy_BMFace *self) return Vector_CreatePyObject(cent, 3, Py_NEW, NULL); } + PyDoc_STRVAR(bpy_bmface_calc_center_bounds_doc, ".. method:: calc_center_bounds()\n" "\n" @@ -845,6 +866,7 @@ static PyObject *bpy_bmface_calc_center_bounds(BPy_BMFace *self) return Vector_CreatePyObject(cent, 3, Py_NEW, NULL); } + /* Loop * ---- */ @@ -863,6 +885,7 @@ static PyObject *bpy_bmloop_calc_face_angle(BPy_BMLoop *self) return PyFloat_FromDouble(BM_loop_face_angle(self->bm, self->l)); } + /* Vert Seq * -------- */ @@ -1193,6 +1216,7 @@ static PyObject *bpy_bmelemseq_remove(BPy_BMElemSeq *self, PyObject *value) } } + PyDoc_STRVAR(bpy_bmelemseq_index_update_doc, ".. method:: index_update()\n" "\n"