diff options
author | Aaron Carlisle <Blendify> | 2020-10-23 00:20:57 +0300 |
---|---|---|
committer | Aaron Carlisle <carlisle.b3d@gmail.com> | 2020-10-23 00:22:05 +0300 |
commit | baa24f1c91d21e10f51881f8fad012f30f99e26f (patch) | |
tree | e3872d6dd8d50ddb657d9610a2ce3b7a6a31bef9 /source/blender/freestyle/intern/python/Interface0D | |
parent | 956af161893f70198bd89d5ab338a24a011d30c2 (diff) |
Pydoc: Fix sphinx compile warnings about freestyle
Sphinx expects functions and methods with the same name and different
parameters to be written using one directive. See:
https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#basic-markup
Unfortunately this makes giving different descriptions for each harder.
This was already a request for better support for this in sphinx, see:
https://github.com/sphinx-doc/sphinx/issues/7787
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D9170
Diffstat (limited to 'source/blender/freestyle/intern/python/Interface0D')
4 files changed, 38 insertions, 74 deletions
diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp index 81dd79ff270..7b3571c479f 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp @@ -44,40 +44,28 @@ PyDoc_STRVAR(CurvePoint_doc, "given resolution.\n" "\n" ".. method:: __init__()\n" + " __init__(brother)\n" + " __init__(first_vertex, second_vertex, t2d)\n" + " __init__(first_point, second_point, t2d)\n" "\n" - " Default constructor.\n" - "\n" - ".. method:: __init__(brother)\n" - "\n" - " Copy constructor.\n" + " Builds a CurvePoint using the default constructor, copy constructor,\n" + " or one of the overloaded constructors. The over loaded constructors\n" + " can either take two :class:`SVertex` or two :class:`CurvePoint`\n" + " objects and an interpolation parameter\n" "\n" " :arg brother: A CurvePoint object.\n" " :type brother: :class:`CurvePoint`\n" - "\n" - ".. method:: __init__(first_vertex, second_vertex, t2d)\n" - "\n" - " Builds a CurvePoint from two SVertex objects and an interpolation parameter.\n" - "\n" " :arg first_vertex: The first SVertex.\n" " :type first_vertex: :class:`SVertex`\n" " :arg second_vertex: The second SVertex.\n" " :type second_vertex: :class:`SVertex`\n" - " :arg t2d: A 2D interpolation parameter used to linearly interpolate\n" - " first_vertex and second_vertex.\n" - " :type t2d: float\n" - "\n" - ".. method:: __init__(first_point, second_point, t2d)\n" - "\n" - " Builds a CurvePoint from two CurvePoint objects and an interpolation\n" - " parameter.\n" - "\n" " :arg first_point: The first CurvePoint.\n" " :type first_point: :class:`CurvePoint`\n" " :arg second_point: The second CurvePoint.\n" " :type second_point: :class:`CurvePoint`\n" - " :arg t2d: The 2D interpolation parameter used to linearly interpolate\n" - " first_point and second_point.\n" - " :type t2d: float"); + " :arg t2d: A 2D interpolation parameter used to linearly interpolate\n" + " first_vertex and second_vertex or first_point and second_point.\n" + " :type t2d: float\n"); static int CurvePoint_init(BPy_CurvePoint *self, PyObject *args, PyObject *kwds) { diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp index c01f1f17000..63725c6b0e8 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp @@ -38,20 +38,15 @@ PyDoc_STRVAR(SVertex_doc, "Class to define a vertex of the embedding.\n" "\n" ".. method:: __init__()\n" + " __init__(brother)\n" + " __init__(point_3d, id)\n" "\n" - " Default constructor.\n" - "\n" - ".. method:: __init__(brother)\n" - "\n" - " Copy constructor.\n" + " Builds a :class:`SVertex` using the default constructor,\n" + " copy constructor or the overloaded constructor which builds" + " a :class:`SVertex` from 3D coordinates and an Id.\n" "\n" " :arg brother: A SVertex object.\n" " :type brother: :class:`SVertex`\n" - "\n" - ".. method:: __init__(point_3d, id)\n" - "\n" - " Builds a SVertex from 3D coordinates and an Id.\n" - "\n" " :arg point_3d: A three-dimensional vector.\n" " :type point_3d: :class:`mathutils.Vector`\n" " :arg id: An Id object.\n" diff --git a/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp index 519bd72db3b..5c1a8f8482f 100644 --- a/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp @@ -40,46 +40,29 @@ PyDoc_STRVAR( "Class to define a stroke vertex.\n" "\n" ".. method:: __init__()\n" + " __init__(brother)\n" + " __init__(first_vertex, second_vertex, t3d)\n" + " __init__(point)\n" + " __init__(svertex)\n" + " __init__(svertex, attribute)\n" "\n" - " Default constructor.\n" - "\n" - ".. method:: __init__(brother)\n" - "\n" - " Copy constructor.\n" + " Builds a :class:`StrokeVertex` using the default constructor,\n" + " copy constructor, from 2 :class:`StrokeVertex` and an interpolation parameter,\n" + " from a CurvePoint, from a SVertex, or a :class:`SVertex`" + " and a :class:`StrokeAttribute` object.\n" "\n" " :arg brother: A StrokeVertex object.\n" " :type brother: :class:`StrokeVertex`\n" - "\n" - ".. method:: __init__(first_vertex, second_vertex, t3d)\n" - "\n" - " Build a stroke vertex from 2 stroke vertices and an interpolation\n" - " parameter.\n" - "\n" " :arg first_vertex: The first StrokeVertex.\n" " :type first_vertex: :class:`StrokeVertex`\n" " :arg second_vertex: The second StrokeVertex.\n" " :type second_vertex: :class:`StrokeVertex`\n" " :arg t3d: An interpolation parameter.\n" " :type t3d: float\n" - "\n" - ".. method:: __init__(point)\n" - "\n" - " Build a stroke vertex from a CurvePoint\n" - "\n" " :arg point: A CurvePoint object.\n" " :type point: :class:`CurvePoint`\n" - "\n" - ".. method:: __init__(svertex)\n" - "\n" - " Build a stroke vertex from a SVertex\n" - "\n" " :arg svertex: An SVertex object.\n" " :type svertex: :class:`SVertex`\n" - "\n" - ".. method:: __init__(svertex, attribute)\n" - "\n" - " Build a stroke vertex from an SVertex and a StrokeAttribute object.\n" - "\n" " :arg svertex: An SVertex object.\n" " :type svertex: :class:`SVertex`\n" " :arg attribute: A StrokeAttribute object.\n" diff --git a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp index 9295e4f424b..ff53f5bfcbe 100644 --- a/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp @@ -31,22 +31,20 @@ extern "C" { /*----------------------NonTVertex methods ----------------------------*/ -PyDoc_STRVAR(NonTVertex_doc, - "Class hierarchy: :class:`Interface0D` > :class:`ViewVertex` > :class:`NonTVertex`\n" - "\n" - "View vertex for corners, cusps, etc. associated to a single SVertex.\n" - "Can be associated to 2 or more view edges.\n" - "\n" - ".. method:: __init__()\n" - "\n" - " Default constructor.\n" - "\n" - ".. method:: __init__(svertex)\n" - "\n" - " Build a NonTVertex from a SVertex.\n" - "\n" - " :arg svertex: An SVertex object.\n" - " :type svertex: :class:`SVertex`"); +PyDoc_STRVAR( + NonTVertex_doc, + "Class hierarchy: :class:`Interface0D` > :class:`ViewVertex` > :class:`NonTVertex`\n" + "\n" + "View vertex for corners, cusps, etc. associated to a single SVertex.\n" + "Can be associated to 2 or more view edges.\n" + "\n" + ".. method:: __init__()\n" + " __init__(svertex)\n" + "\n" + " Builds a :class:`NonTVertex` using the default constructor or a :class:`SVertex`.\n" + "\n" + " :arg svertex: An SVertex object.\n" + " :type svertex: :class:`SVertex`"); /* Note: No copy constructor in Python because the C++ copy constructor is 'protected'. */ |