[Bf-blender-cvs] [baa24f1c91d] blender-v2.91-release: Pydoc: Fix sphinx compile warnings about freestyle

Aaron Carlisle noreply at git.blender.org
Thu Oct 22 23:28:12 CEST 2020


Commit: baa24f1c91d21e10f51881f8fad012f30f99e26f
Author: Aaron Carlisle
Date:   Thu Oct 22 17:20:57 2020 -0400
Branches: blender-v2.91-release
https://developer.blender.org/rBbaa24f1c91d21e10f51881f8fad012f30f99e26f

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

===================================================================

M	source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp
M	source/blender/freestyle/intern/python/BPy_Id.cpp
M	source/blender/freestyle/intern/python/BPy_Operators.cpp
M	source/blender/freestyle/intern/python/BPy_SShape.cpp
M	source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp
M	source/blender/freestyle/intern/python/BPy_ViewShape.cpp
M	source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp
M	source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp
M	source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp
M	source/blender/freestyle/intern/python/Interface0D/ViewVertex/BPy_NonTVertex.cpp
M	source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp
M	source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp
M	source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp
M	source/blender/freestyle/intern/python/Interface1D/BPy_ViewEdge.cpp
M	source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
M	source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp
M	source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp
M	source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp
M	source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp
M	source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp
M	source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp
M	source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp
M	source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp
M	source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp
M	source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
M	source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp
M	source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp
M	source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DDouble.cpp
M	source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DEdgeNature.cpp
M	source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DFloat.cpp
M	source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DUnsigned.cpp
M	source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec2f.cpp
M	source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp
M	source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp
M	source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVoid.cpp

===================================================================

diff --git a/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp b/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp
index dbf1c12fb01..3efabbfbdf5 100644
--- a/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp
+++ b/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp
@@ -55,21 +55,14 @@ PyDoc_STRVAR(
     "Class defining a material.\n"
     "\n"
     ".. method:: __init__()\n"
+    "            __init__(brother)\n"
+    "            __init__(line, diffuse, ambient, specular, emission, shininess, priority)\n"
     "\n"
-    "   Default constructor.\n"
+    "   Creates a :class:`FrsMaterial` using either default constructor,\n"
+    "   copy constructor, or an overloaded constructor\n"
     "\n"
-    ".. method:: __init__(brother)\n"
-    "\n"
-    "   Copy constructor.\n"
-    "\n"
-    "   :arg brother: A Material object.\n"
+    "   :arg brother: A Material object to be used as a copy constructor.\n"
     "   :type brother: :class:`Material`\n"
-    "\n"
-    ".. method:: __init__(line, diffuse, ambient, specular, emission, shininess, priority)\n"
-    "\n"
-    "   Builds a Material from its line, diffuse, ambient, specular, emissive\n"
-    "   colors, a shininess coefficient and line color priority.\n"
-    "\n"
     "   :arg line: The line color.\n"
     "   :type line: :class:`mathutils.Vector`, list or tuple of 4 float values\n"
     "   :arg diffuse: The diffuse color.\n"
diff --git a/source/blender/freestyle/intern/python/BPy_Id.cpp b/source/blender/freestyle/intern/python/BPy_Id.cpp
index eb0eb661e3d..8f61f7f3e14 100644
--- a/source/blender/freestyle/intern/python/BPy_Id.cpp
+++ b/source/blender/freestyle/intern/python/BPy_Id.cpp
@@ -46,24 +46,21 @@ int Id_Init(PyObject *module)
 
 //------------------------INSTANCE METHODS ----------------------------------
 
-PyDoc_STRVAR(Id_doc,
-             "Class for representing an object Id.\n"
-             "\n"
-             ".. method:: __init__(first=0, second=0)\n"
-             "\n"
-             "   Build the Id from two numbers.\n"
-             "\n"
-             "   :arg first: The first number.\n"
-             "   :type first: int\n"
-             "   :arg second: The second number.\n"
-             "   :type second: int\n"
-             "\n"
-             ".. method:: __init__(brother)\n"
-             "\n"
-             "   Copy constructor.\n"
-             "\n"
-             "   :arg brother: An Id object.\n"
-             "   :type brother: :class:`Id`");
+PyDoc_STRVAR(
+    Id_doc,
+    "Class for representing an object Id.\n"
+    "\n"
+    ".. method:: __init__(brother)\n"
+    "            __init__(first=0, second=0)\n"
+    "\n"
+    "   Build the Id from two numbers or another :class:`Id` using the copy constructor.\n"
+    "\n"
+    "   :arg brother: An Id object.\n"
+    "   :type brother: :class:`Id`"
+    "   :arg first: The first number.\n"
+    "   :type first: int\n"
+    "   :arg second: The second number.\n"
+    "   :type second: int\n");
 
 static int Id_init(BPy_Id *self, PyObject *args, PyObject *kwds)
 {
diff --git a/source/blender/freestyle/intern/python/BPy_Operators.cpp b/source/blender/freestyle/intern/python/BPy_Operators.cpp
index 56f95b8ecbb..1235786d5d3 100644
--- a/source/blender/freestyle/intern/python/BPy_Operators.cpp
+++ b/source/blender/freestyle/intern/python/BPy_Operators.cpp
@@ -101,6 +101,7 @@ static PyObject *Operators_select(BPy_Operators * /*self*/, PyObject *args, PyOb
 
 PyDoc_STRVAR(Operators_chain_doc,
              ".. staticmethod:: chain(it, pred, modifier)\n"
+             "                  chain(it, pred)\n"
              "\n"
              "   Builds a set of chains from the current set of ViewEdges.  Each\n"
              "   ViewEdge of the current list starts a new chain.  The chaining\n"
@@ -116,28 +117,9 @@ PyDoc_STRVAR(Operators_chain_doc,
              "   :type pred: :class:`UnaryPredicate1D`\n"
              "   :arg modifier: A function that takes a ViewEdge as argument and\n"
              "      that is used to modify the processed ViewEdge state (the\n"
-             "      timestamp incrementation is a typical illustration of such a\n"
-             "      modifier).\n"
-             "   :type modifier: :class:`UnaryFunction1DVoid`\n"
-             "\n"
-             ".. staticmethod:: chain(it, pred)\n"
-             "\n"
-             "   Builds a set of chains from the current set of ViewEdges.  Each\n"
-             "   ViewEdge of the current list starts a new chain.  The chaining\n"
-             "   operator then iterates over the ViewEdges of the ViewMap using the\n"
-             "   user specified iterator.  This operator only iterates using the\n"
-             "   increment operator and is therefore unidirectional.  This chaining\n"
-             "   operator is different from the previous one because it doesn't take\n"
-             "   any modifier as argument.  Indeed, the time stamp (insuring that a\n"
-             "   ViewEdge is processed one time) is automatically managed in this\n"
-             "   case.\n"
-             "\n"
-             "   :arg it: The iterator on the ViewEdges of the ViewMap. It contains\n"
-             "      the chaining rule. \n"
-             "   :type it: :class:`ViewEdgeIterator`\n"
-             "   :arg pred: The predicate on the ViewEdge that expresses the\n"
-             "      stopping condition.\n"
-             "   :type pred: :class:`UnaryPredicate1D`");
+             "      timestamp incrementation is a typical illustration of such a modifier).\n"
+             "      If this argument is not given, the time stamp is automatically managed.\n"
+             "   :type modifier: :class:`UnaryFunction1DVoid`\n");
 
 static PyObject *Operators_chain(BPy_Operators * /*self*/, PyObject *args, PyObject *kwds)
 {
@@ -195,6 +177,7 @@ static PyObject *Operators_chain(BPy_Operators * /*self*/, PyObject *args, PyObj
 
 PyDoc_STRVAR(Operators_bidirectional_chain_doc,
              ".. staticmethod:: bidirectional_chain(it, pred)\n"
+             "                  bidirectional_chain(it)\n"
              "\n"
              "   Builds a set of chains from the current set of ViewEdges.  Each\n"
              "   ViewEdge of the current list potentially starts a new chain.  The\n"
@@ -211,30 +194,10 @@ PyDoc_STRVAR(Operators_bidirectional_chain_doc,
              "   :arg it: The ChainingIterator on the ViewEdges of the ViewMap.  It\n"
              "      contains the chaining rule.\n"
              "   :type it: :class:`ChainingIterator`\n"
-             "   :arg pred: The predicate on the ViewEdge that expresses the\n"
-             "      stopping condition.\n"
-             "   :type pred: :class:`UnaryPredicate1D`\n"
-             "\n"
-             ".. staticmethod:: bidirectional_chain(it)\n"
-             "\n"
-             "   The only difference with the above bidirectional chaining algorithm\n"
-             "   is that we don't need to pass a stopping criterion.  This might be\n"
-             "   desirable when the stopping criterion is already contained in the\n"
-             "   iterator definition.  Builds a set of chains from the current set of\n"
-             "   ViewEdges.  Each ViewEdge of the current list potentially starts a new\n"
-             "   chain.  The chaining operator then iterates over the ViewEdges of the\n"
-             "   ViewMap using the user specified iterator.  This operator iterates\n"
-             "   both using the increment and decrement operators and is therefore\n"
-             "   bidirectional.  This operator works with a ChainingIterator which\n"
-             "   contains the chaining rules.  It is this last one which can be told to\n"
-             "   chain only edges that belong to the selection or not to process twice\n"
-             "   a ViewEdge during the chaining.  Each time a ViewEdge is added to a\n"
-             "   chain, its chaining time stamp is incremented.  This allows you to\n"
-             "   keep track of the number of chains to which a ViewEdge belongs to.\n"
-             "\n"
-             "   :arg it: The ChainingIterator on the ViewEdges of the ViewMap.  It\n"
-             "      contains the chaining rule.\n"
-             "   :type it: :class:`ChainingIterator`");
+             "   :arg pred: The predicate on the ViewEdge that expresses the stopping condition.\n"
+             "      This parameter is optional, you make not want to pass a stopping criterion\n"
+             "      when the stopping criterion is already contained in the iterator definition.\n"
+             "   :type pred: :class:`UnaryPredicate1D`\n");
 
 static PyObject *Operators_bidirectional_chain(BPy_Operators * /*self*/,
                                                PyObject *args,
@@ -287,44 +250,34 @@ static PyObject *Operators_bidirectional_chain(BPy_Operators * /*self*/,
 
 PyDoc_STRVAR(Operators_sequential_split_doc,
              ".. staticmethod:: sequential_split(starting_pred, stopping_pred, sampling=0.0)\n"
+             "                  sequential_split(pred, sampling=0.0)\n"
              "\n"
              "   Splits each chain of the current set of chains in a sequential way.\n"
              "   The points of each chain are processed (with a specified sampling)\n"
-             "   sequentially. Each time a user specified starting condition is\n"
-             "   verified, a new chain begins and ends as soon as a user-defined\n"
-             "   stopping predicate is verified. This allows chains overlapping rather\n"
-             "   than chains partitioning. The first point of the initial chain is the\n"
+             "   sequentially. The first point of the initial chain is the\n"
              "   first point of one of the resulting chains. The splitting ends when\n"
              "   no more chain can start.\n"
              "\n"
+             "   .. tip::\n"
+             "\n"
+             "      By specifiying a starting and stopping predicate allows\n"
+             "      the chains to overlapp rather than chains partitioning.\n"
+             "\n"
              "   :arg starting_pred: The predicate on a point that expresses the\n"
-            

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list