[Bf-blender-cvs] [8736b10] temp-mathutils-doc: Tweaks to documentation strings
Campbell Barton
noreply at git.blender.org
Sun Feb 1 17:25:11 CET 2015
Commit: 8736b10e2260b119cc3b71a83912e4fefd5b2499
Author: Campbell Barton
Date: Mon Feb 2 03:24:53 2015 +1100
Branches: temp-mathutils-doc
https://developer.blender.org/rB8736b10e2260b119cc3b71a83912e4fefd5b2499
Tweaks to documentation strings
===================================================================
M source/blender/python/mathutils/mathutils.c
M source/blender/python/mathutils/mathutils_Color.c
M source/blender/python/mathutils/mathutils_Euler.c
M source/blender/python/mathutils/mathutils_Matrix.c
M source/blender/python/mathutils/mathutils_Quaternion.c
M source/blender/python/mathutils/mathutils_Vector.c
===================================================================
diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c
index ad73d77..0cfd1fe 100644
--- a/source/blender/python/mathutils/mathutils.c
+++ b/source/blender/python/mathutils/mathutils.c
@@ -41,8 +41,10 @@ PyDoc_STRVAR(M_Mathutils_doc,
"This module provides access to the math classes :class:`Color`,\n"
":class:`Euler`, :class:`Matrix`, :class:`Quaternion` and :class:`Vector`.\n"
"\n"
-"Classes and methods that accept Vectors also accept other numeric sequences,\n"
-"such as tuples and lists."
+".. note::\n"
+"\n"
+" Classes, methods and functions that accept Vector args also accept other numeric sequences,\n"
+" such as tuples, lists."
);
static int mathutils_array_parse_fast(float *array,
int size,
diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c
index 17b36f8..ce59099 100644
--- a/source/blender/python/mathutils/mathutils_Color.c
+++ b/source/blender/python/mathutils/mathutils_Color.c
@@ -813,10 +813,10 @@ static struct PyMethodDef Color_methods[] = {
PyDoc_STRVAR(color_doc,
".. class:: Color(rgb)\n"
"\n"
-" :param rgb: (r, g, b) color values\n"
-" :type rgb: 3-:class:`Vector`\n"
-"\n"
" This object gives access to Colors in Blender.\n"
+"\n"
+" :param rgb: (r, g, b) color values\n"
+" :type rgb: 3d vector\n"
);
PyTypeObject color_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c
index b9893b9..edb4af0 100644
--- a/source/blender/python/mathutils/mathutils_Euler.c
+++ b/source/blender/python/mathutils/mathutils_Euler.c
@@ -659,12 +659,12 @@ static struct PyMethodDef Euler_methods[] = {
PyDoc_STRVAR(euler_doc,
".. class:: Euler(angles, order='XYZ')\n"
"\n"
-" :param angles: three angles, in radians\n"
-" :type angles: 3-:class:`Vector`\n"
-" :param order: order of the angles, a permutation of 'XYZ'\n"
-" :type order: str\n"
+" This object gives access to Eulers in Blender.\n"
"\n"
-"This object gives access to Eulers in Blender."
+" :param angles: Three angles, in radians.\n"
+" :type angles: 3d vector\n"
+" :param order: Optional order of the angles, a permutation of ``XYZ``.\n"
+" :type order: str\n"
);
PyTypeObject euler_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index 298925e..95b5325 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -2716,14 +2716,14 @@ static struct PyMethodDef Matrix_methods[] = {
/*------------------PY_OBECT DEFINITION--------------------------*/
PyDoc_STRVAR(matrix_doc,
-".. class:: Matrix([sequence_of_rows])\n"
+".. class:: Matrix([rows])\n"
"\n"
-" :param sequence_of_rows: Sequence of rows (which are sequences of floats).\n"
-" When ommitted, a 4x4 identity matrix is constructed.\n"
-" :type sequence_of_rows: tuple or list\n"
+" This object gives access to Matrices in Blender, supporting square and rectangular\n"
+" matrices from 2x2 up to 4x4.\n"
"\n"
-"This object gives access to Matrices in Blender, supporting square and rectangular\n"
-"matrices from 2x2 up to 4x4.\n"
+" :param rows: Sequence of rows.\n"
+" When ommitted, a 4x4 identity matrix is constructed.\n"
+" :type rows: 2d number sequence\n"
);
PyTypeObject matrix_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c
index 2d782e8..543c268 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.c
+++ b/source/blender/python/mathutils/mathutils_Quaternion.c
@@ -1228,30 +1228,29 @@ static PyGetSetDef Quaternion_getseters[] = {
/* ------------------PY_OBECT DEFINITION-------------------------- */
PyDoc_STRVAR(quaternion_doc,
-".. class:: Quaternion([vector, [angle]])\n"
+".. class:: Quaternion([seq, [angle]])\n"
"\n"
-" :param vector: size 3 or 4\n"
-" :type vector: :class:`Vector`\n"
+" This object gives access to Quaternions in Blender.\n"
+"\n"
+" :param seq: size 3 or 4\n"
+" :type seq: :class:`Vector`\n"
" :param angle: rotation angle, in radians\n"
" :type angle: float\n"
"\n"
-" This object gives access to Quaternions in Blender. The constructor takes\n"
-" arguments in various forms:\n"
+" The constructor takes arguments in various forms:\n"
"\n"
-" no arguments\n"
+" (), *no args*\n"
" Create an identity quaternion\n"
+" (**wxyz**)\n"
+" Create a quaternion from a ``(w, x, y, z)`` vector.\n"
+" (**exponential_map**)\n"
+" Create a quaternion from a 3d exponential map vector.\n"
"\n"
-" (`wxyz`)\n"
-" Create a quaternion from a `(w, x, y, z)` vector.\n"
-"\n"
-" (`exponential_map`)\n"
-" Create a quaternion from an exponential map vector.\n"
-" See also :meth:`to_exponential_map`\n"
-"\n"
-" (`axis`, `angle`)\n"
-" Create a quaternion representing a rotation of `angle` radians over `axis`.\n"
-" See also :meth:`to_axis_angle`\n"
+" .. seealso:: :meth:`to_exponential_map`\n"
+" (**axis**, **angle**)\n"
+" Create a quaternion representing a rotation of *angle* radians over *axis*.\n"
"\n"
+" .. seealso:: :meth:`to_axis_angle`\n"
);
PyTypeObject quaternion_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c
index d6f7648..091412b 100644
--- a/source/blender/python/mathutils/mathutils_Vector.c
+++ b/source/blender/python/mathutils/mathutils_Vector.c
@@ -2904,12 +2904,12 @@ static struct PyMethodDef Vector_methods[] = {
*/
PyDoc_STRVAR(vector_doc,
-".. class:: Vector(sequence_of_floats=(0, 0, 0))\n"
-"\n"
-" :param sequence_of_floats: components of the vector, must be a sequence of at least two elements\n"
-" :type sequence_of_floats: tuple or :class:`Vector`\n"
+".. class:: Vector(seq)\n"
"\n"
" This object gives access to Vectors in Blender.\n"
+"\n"
+" :param seq: Components of the vector, must be a sequence of at least two\n"
+" :type seq: sequence of numbers\n"
);
PyTypeObject vector_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
More information about the Bf-blender-cvs
mailing list