use PyDoc_STRVAR macro, so its possible to build without docstrings.
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
|
||||
static char Method_Buffer_doc[] =
|
||||
PyDoc_STRVAR(Method_Buffer_doc,
|
||||
"(type, dimensions, [template]) - Create a new Buffer object\n\n\
|
||||
(type) - The format to store data in\n\
|
||||
(dimensions) - An int or sequence specifying the dimensions of the buffer\n\
|
||||
@@ -59,7 +59,8 @@ will have len(sequence) dimensions, where the size for each dimension\n\
|
||||
is determined by the value in the sequence at that index.\n\n\
|
||||
For example, passing [100, 100] will create a 2 dimensional\n\
|
||||
square buffer. Passing [16, 16, 32] will create a 3 dimensional\n\
|
||||
buffer which is twice as deep as it is wide or high.";
|
||||
buffer which is twice as deep as it is wide or high."
|
||||
);
|
||||
|
||||
static PyObject *Method_Buffer( PyObject * self, PyObject *args );
|
||||
|
||||
|
@@ -36,7 +36,7 @@
|
||||
|
||||
|
||||
|
||||
static char py_blf_position_doc[] =
|
||||
PyDoc_STRVAR(py_blf_position_doc,
|
||||
".. function:: position(fontid, x, y, z)\n"
|
||||
"\n"
|
||||
" Set the position for drawing text.\n"
|
||||
@@ -48,7 +48,8 @@ static char py_blf_position_doc[] =
|
||||
" :arg y: Y axis position to draw the text.\n"
|
||||
" :type y: float\n"
|
||||
" :arg z: Z axis position to draw the text.\n"
|
||||
" :type z: float\n";
|
||||
" :type z: float\n"
|
||||
);
|
||||
|
||||
static PyObject *py_blf_position(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
@@ -64,7 +65,7 @@ static PyObject *py_blf_position(PyObject *UNUSED(self), PyObject *args)
|
||||
}
|
||||
|
||||
|
||||
static char py_blf_size_doc[] =
|
||||
PyDoc_STRVAR(py_blf_size_doc,
|
||||
".. function:: size(fontid, size, dpi)\n"
|
||||
"\n"
|
||||
" Set the size and dpi for drawing text.\n"
|
||||
@@ -74,8 +75,8 @@ static char py_blf_size_doc[] =
|
||||
" :arg size: Point size of the font.\n"
|
||||
" :type size: int\n"
|
||||
" :arg dpi: dots per inch value to use for drawing.\n"
|
||||
" :type dpi: int\n";
|
||||
|
||||
" :type dpi: int\n"
|
||||
);
|
||||
static PyObject *py_blf_size(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
int fontid, size, dpi;
|
||||
@@ -89,7 +90,7 @@ static PyObject *py_blf_size(PyObject *UNUSED(self), PyObject *args)
|
||||
}
|
||||
|
||||
|
||||
static char py_blf_aspect_doc[] =
|
||||
PyDoc_STRVAR(py_blf_aspect_doc,
|
||||
".. function:: aspect(fontid, aspect)\n"
|
||||
"\n"
|
||||
" Set the aspect for drawing text.\n"
|
||||
@@ -97,8 +98,8 @@ static char py_blf_aspect_doc[] =
|
||||
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
|
||||
" :type fontid: int\n"
|
||||
" :arg aspect: The aspect ratio for text drawing to use.\n"
|
||||
" :type aspect: float\n";
|
||||
|
||||
" :type aspect: float\n"
|
||||
);
|
||||
static PyObject *py_blf_aspect(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
float aspect;
|
||||
@@ -113,7 +114,7 @@ static PyObject *py_blf_aspect(PyObject *UNUSED(self), PyObject *args)
|
||||
}
|
||||
|
||||
|
||||
static char py_blf_blur_doc[] =
|
||||
PyDoc_STRVAR(py_blf_blur_doc,
|
||||
".. function:: blur(fontid, radius)\n"
|
||||
"\n"
|
||||
" Set the blur radius for drawing text.\n"
|
||||
@@ -121,8 +122,8 @@ static char py_blf_blur_doc[] =
|
||||
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
|
||||
" :type fontid: int\n"
|
||||
" :arg radius: The radius for blurring text (in pixels).\n"
|
||||
" :type radius: int\n";
|
||||
|
||||
" :type radius: int\n"
|
||||
);
|
||||
static PyObject *py_blf_blur(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
int blur, fontid;
|
||||
@@ -136,7 +137,7 @@ static PyObject *py_blf_blur(PyObject *UNUSED(self), PyObject *args)
|
||||
}
|
||||
|
||||
|
||||
static char py_blf_draw_doc[] =
|
||||
PyDoc_STRVAR(py_blf_draw_doc,
|
||||
".. function:: draw(fontid, text)\n"
|
||||
"\n"
|
||||
" Draw text in the current context.\n"
|
||||
@@ -144,8 +145,8 @@ static char py_blf_draw_doc[] =
|
||||
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
|
||||
" :type fontid: int\n"
|
||||
" :arg text: the text to draw.\n"
|
||||
" :type text: string\n";
|
||||
|
||||
" :type text: string\n"
|
||||
);
|
||||
static PyObject *py_blf_draw(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
char *text;
|
||||
@@ -160,7 +161,7 @@ static PyObject *py_blf_draw(PyObject *UNUSED(self), PyObject *args)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char py_blf_dimensions_doc[] =
|
||||
PyDoc_STRVAR(py_blf_dimensions_doc,
|
||||
".. function:: dimensions(fontid, text)\n"
|
||||
"\n"
|
||||
" Return the width and height of the text.\n"
|
||||
@@ -170,8 +171,8 @@ static char py_blf_dimensions_doc[] =
|
||||
" :arg text: the text to draw.\n"
|
||||
" :type text: string\n"
|
||||
" :return: the width and height of the text.\n"
|
||||
" :rtype: tuple of 2 floats\n";
|
||||
|
||||
" :rtype: tuple of 2 floats\n"
|
||||
);
|
||||
static PyObject *py_blf_dimensions(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
char *text;
|
||||
@@ -190,7 +191,7 @@ static PyObject *py_blf_dimensions(PyObject *UNUSED(self), PyObject *args)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char py_blf_clipping_doc[] =
|
||||
PyDoc_STRVAR(py_blf_clipping_doc,
|
||||
".. function:: clipping(fontid, xmin, ymin, xmax, ymax)\n"
|
||||
"\n"
|
||||
" Set the clipping, enable/disable using CLIPPING.\n"
|
||||
@@ -204,8 +205,8 @@ static char py_blf_clipping_doc[] =
|
||||
" :arg xmax: Clip the drawing area by these bounds.\n"
|
||||
" :type xmax: float\n"
|
||||
" :arg ymax: Clip the drawing area by these bounds.\n"
|
||||
" :type ymax: float\n";
|
||||
|
||||
" :type ymax: float\n"
|
||||
);
|
||||
static PyObject *py_blf_clipping(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
float xmin, ymin, xmax, ymax;
|
||||
@@ -219,7 +220,7 @@ static PyObject *py_blf_clipping(PyObject *UNUSED(self), PyObject *args)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char py_blf_disable_doc[] =
|
||||
PyDoc_STRVAR(py_blf_disable_doc,
|
||||
".. function:: disable(fontid, option)\n"
|
||||
"\n"
|
||||
" Disable option.\n"
|
||||
@@ -227,8 +228,8 @@ static char py_blf_disable_doc[] =
|
||||
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
|
||||
" :type fontid: int\n"
|
||||
" :arg option: One of ROTATION, CLIPPING, SHADOW or KERNING_DEFAULT.\n"
|
||||
" :type option: int\n";
|
||||
|
||||
" :type option: int\n"
|
||||
);
|
||||
static PyObject *py_blf_disable(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
int option, fontid;
|
||||
@@ -241,7 +242,7 @@ static PyObject *py_blf_disable(PyObject *UNUSED(self), PyObject *args)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char py_blf_enable_doc[] =
|
||||
PyDoc_STRVAR(py_blf_enable_doc,
|
||||
".. function:: enable(fontid, option)\n"
|
||||
"\n"
|
||||
" Enable option.\n"
|
||||
@@ -249,8 +250,8 @@ static char py_blf_enable_doc[] =
|
||||
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
|
||||
" :type fontid: int\n"
|
||||
" :arg option: One of ROTATION, CLIPPING, SHADOW or KERNING_DEFAULT.\n"
|
||||
" :type option: int\n";
|
||||
|
||||
" :type option: int\n"
|
||||
);
|
||||
static PyObject *py_blf_enable(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
int option, fontid;
|
||||
@@ -263,7 +264,7 @@ static PyObject *py_blf_enable(PyObject *UNUSED(self), PyObject *args)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char py_blf_rotation_doc[] =
|
||||
PyDoc_STRVAR(py_blf_rotation_doc,
|
||||
".. function:: rotation(fontid, angle)\n"
|
||||
"\n"
|
||||
" Set the text rotation angle, enable/disable using ROTATION.\n"
|
||||
@@ -271,8 +272,8 @@ static char py_blf_rotation_doc[] =
|
||||
" :arg fontid: The id of the typeface as returned by :func:`blf.load`, for default font use 0.\n"
|
||||
" :type fontid: int\n"
|
||||
" :arg angle: The angle for text drawing to use.\n"
|
||||
" :type angle: float\n";
|
||||
|
||||
" :type angle: float\n"
|
||||
);
|
||||
static PyObject *py_blf_rotation(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
float angle;
|
||||
@@ -286,7 +287,7 @@ static PyObject *py_blf_rotation(PyObject *UNUSED(self), PyObject *args)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char py_blf_shadow_doc[] =
|
||||
PyDoc_STRVAR(py_blf_shadow_doc,
|
||||
".. function:: shadow(fontid, level, r, g, b, a)\n"
|
||||
"\n"
|
||||
" Shadow options, enable/disable using SHADOW .\n"
|
||||
@@ -302,8 +303,8 @@ static char py_blf_shadow_doc[] =
|
||||
" :arg b: Shadow color (blue channel 0.0 - 1.0).\n"
|
||||
" :type b: float\n"
|
||||
" :arg a: Shadow color (alpha channel 0.0 - 1.0).\n"
|
||||
" :type a: float\n";
|
||||
|
||||
" :type a: float\n"
|
||||
);
|
||||
static PyObject *py_blf_shadow(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
int level, fontid;
|
||||
@@ -322,7 +323,7 @@ static PyObject *py_blf_shadow(PyObject *UNUSED(self), PyObject *args)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char py_blf_shadow_offset_doc[] =
|
||||
PyDoc_STRVAR(py_blf_shadow_offset_doc,
|
||||
".. function:: shadow_offset(fontid, x, y)\n"
|
||||
"\n"
|
||||
" Set the offset for shadow text.\n"
|
||||
@@ -332,8 +333,8 @@ static char py_blf_shadow_offset_doc[] =
|
||||
" :arg x: Vertical shadow offset value in pixels.\n"
|
||||
" :type x: float\n"
|
||||
" :arg y: Horizontal shadow offset value in pixels.\n"
|
||||
" :type y: float\n";
|
||||
|
||||
" :type y: float\n"
|
||||
);
|
||||
static PyObject *py_blf_shadow_offset(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
int x, y, fontid;
|
||||
@@ -346,7 +347,7 @@ static PyObject *py_blf_shadow_offset(PyObject *UNUSED(self), PyObject *args)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char py_blf_load_doc[] =
|
||||
PyDoc_STRVAR(py_blf_load_doc,
|
||||
".. function:: load(filename)\n"
|
||||
"\n"
|
||||
" Load a new font.\n"
|
||||
@@ -354,8 +355,8 @@ static char py_blf_load_doc[] =
|
||||
" :arg filename: the filename of the font.\n"
|
||||
" :type filename: string\n"
|
||||
" :return: the new font's fontid or -1 if there was an error.\n"
|
||||
" :rtype: integer\n";
|
||||
|
||||
" :rtype: integer\n"
|
||||
);
|
||||
static PyObject *py_blf_load(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
char* filename;
|
||||
@@ -384,9 +385,9 @@ static PyMethodDef BLF_methods[] = {
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
static char BLF_doc[] =
|
||||
"This module provides access to blenders text drawing functions.\n";
|
||||
|
||||
PyDoc_STRVAR(BLF_doc,
|
||||
"This module provides access to blenders text drawing functions."
|
||||
);
|
||||
static struct PyModuleDef BLF_module_def = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
"blf", /* m_name */
|
||||
|
@@ -38,9 +38,9 @@
|
||||
#include "BLI_math.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
static char M_Mathutils_doc[] =
|
||||
PyDoc_STRVAR(M_Mathutils_doc,
|
||||
"This module provides access to matrices, eulers, quaternions and vectors."
|
||||
;
|
||||
);
|
||||
static int mathutils_array_parse_fast(float *array, int array_min, int array_max, PyObject *value, const char *error_prefix)
|
||||
{
|
||||
PyObject *value_fast= NULL;
|
||||
|
@@ -85,7 +85,7 @@ static PyObject *Color_ToTupleExt(ColorObject *self, int ndigits)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char Color_copy_doc[] =
|
||||
PyDoc_STRVAR(Color_copy_doc,
|
||||
".. function:: copy()\n"
|
||||
"\n"
|
||||
" Returns a copy of this color.\n"
|
||||
@@ -94,7 +94,7 @@ static char Color_copy_doc[] =
|
||||
" :rtype: :class:`Color`\n"
|
||||
"\n"
|
||||
" .. note:: use this to get a copy of a wrapped color with no reference to the original data.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Color_copy(ColorObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -458,9 +458,9 @@ static struct PyMethodDef Color_methods[] = {
|
||||
};
|
||||
|
||||
//------------------PY_OBECT DEFINITION--------------------------
|
||||
static char color_doc[] =
|
||||
PyDoc_STRVAR(color_doc,
|
||||
"This object gives access to Colors in Blender."
|
||||
;
|
||||
);
|
||||
PyTypeObject color_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"mathutils.Color", //tp_name
|
||||
|
@@ -126,14 +126,14 @@ static PyObject *Euler_ToTupleExt(EulerObject *self, int ndigits)
|
||||
//-----------------------------METHODS----------------------------
|
||||
//return a quaternion representation of the euler
|
||||
|
||||
static char Euler_to_quaternion_doc[] =
|
||||
PyDoc_STRVAR(Euler_to_quaternion_doc,
|
||||
".. method:: to_quaternion()\n"
|
||||
"\n"
|
||||
" Return a quaternion representation of the euler.\n"
|
||||
"\n"
|
||||
" :return: Quaternion representation of the euler.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Euler_to_quaternion(EulerObject * self)
|
||||
{
|
||||
float quat[4];
|
||||
@@ -147,14 +147,14 @@ static PyObject *Euler_to_quaternion(EulerObject * self)
|
||||
}
|
||||
|
||||
//return a matrix representation of the euler
|
||||
static char Euler_to_matrix_doc[] =
|
||||
PyDoc_STRVAR(Euler_to_matrix_doc,
|
||||
".. method:: to_matrix()\n"
|
||||
"\n"
|
||||
" Return a matrix representation of the euler.\n"
|
||||
"\n"
|
||||
" :return: A 3x3 roation matrix representation of the euler.\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Euler_to_matrix(EulerObject * self)
|
||||
{
|
||||
float mat[9];
|
||||
@@ -167,12 +167,11 @@ static PyObject *Euler_to_matrix(EulerObject * self)
|
||||
return newMatrixObject(mat, 3, 3 , Py_NEW, NULL);
|
||||
}
|
||||
|
||||
//sets the euler to 0,0,0
|
||||
static char Euler_zero_doc[] =
|
||||
PyDoc_STRVAR(Euler_zero_doc,
|
||||
".. method:: zero()\n"
|
||||
"\n"
|
||||
" Set all values to zero.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Euler_zero(EulerObject * self)
|
||||
{
|
||||
zero_v3(self->eul);
|
||||
@@ -183,7 +182,7 @@ static PyObject *Euler_zero(EulerObject * self)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char Euler_rotate_axis_doc[] =
|
||||
PyDoc_STRVAR(Euler_rotate_axis_doc,
|
||||
".. method:: rotate_axis(axis, angle)\n"
|
||||
"\n"
|
||||
" Rotates the euler a certain amount and returning a unique euler rotation (no 720 degree pitches).\n"
|
||||
@@ -192,7 +191,7 @@ static char Euler_rotate_axis_doc[] =
|
||||
" :type axis: string\n"
|
||||
" :arg angle: angle in radians.\n"
|
||||
" :type angle: float\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Euler_rotate_axis(EulerObject * self, PyObject *args)
|
||||
{
|
||||
float angle = 0.0f;
|
||||
@@ -218,14 +217,14 @@ static PyObject *Euler_rotate_axis(EulerObject * self, PyObject *args)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char Euler_rotate_doc[] =
|
||||
PyDoc_STRVAR(Euler_rotate_doc,
|
||||
".. method:: rotate(other)\n"
|
||||
"\n"
|
||||
" Rotates the euler a by another mathutils value.\n"
|
||||
"\n"
|
||||
" :arg other: rotation component of mathutils value\n"
|
||||
" :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Euler_rotate(EulerObject * self, PyObject *value)
|
||||
{
|
||||
float self_rmat[3][3], other_rmat[3][3], rmat[3][3];
|
||||
@@ -245,13 +244,13 @@ static PyObject *Euler_rotate(EulerObject * self, PyObject *value)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char Euler_make_compatible_doc[] =
|
||||
PyDoc_STRVAR(Euler_make_compatible_doc,
|
||||
".. method:: make_compatible(other)\n"
|
||||
"\n"
|
||||
" Make this euler compatible with another, so interpolating between them works as intended.\n"
|
||||
"\n"
|
||||
" .. note:: the rotation order is not taken into account for this function.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Euler_make_compatible(EulerObject * self, PyObject *value)
|
||||
{
|
||||
float teul[EULER_SIZE];
|
||||
@@ -272,7 +271,7 @@ static PyObject *Euler_make_compatible(EulerObject * self, PyObject *value)
|
||||
//----------------------------Euler.rotate()-----------------------
|
||||
// return a copy of the euler
|
||||
|
||||
static char Euler_copy_doc[] =
|
||||
PyDoc_STRVAR(Euler_copy_doc,
|
||||
".. function:: copy()\n"
|
||||
"\n"
|
||||
" Returns a copy of this euler.\n"
|
||||
@@ -281,7 +280,7 @@ static char Euler_copy_doc[] =
|
||||
" :rtype: :class:`Euler`\n"
|
||||
"\n"
|
||||
" .. note:: use this to get a copy of a wrapped euler with no reference to the original data.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Euler_copy(EulerObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -593,9 +592,9 @@ static struct PyMethodDef Euler_methods[] = {
|
||||
};
|
||||
|
||||
//------------------PY_OBECT DEFINITION--------------------------
|
||||
static char euler_doc[] =
|
||||
PyDoc_STRVAR(euler_doc,
|
||||
"This object gives access to Eulers in Blender."
|
||||
;
|
||||
);
|
||||
PyTypeObject euler_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"mathutils.Euler", //tp_name
|
||||
|
@@ -186,7 +186,7 @@ static void matrix_3x3_as_4x4(float mat[16])
|
||||
/*-----------------------CLASS-METHODS----------------------------*/
|
||||
|
||||
//mat is a 1D array of floats - row[0][0], row[0][1], row[1][0], etc.
|
||||
static char C_Matrix_Rotation_doc[] =
|
||||
PyDoc_STRVAR(C_Matrix_Rotation_doc,
|
||||
".. classmethod:: Rotation(angle, size, axis)\n"
|
||||
"\n"
|
||||
" Create a matrix representing a rotation.\n"
|
||||
@@ -199,7 +199,7 @@ static char C_Matrix_Rotation_doc[] =
|
||||
" :type axis: string or :class:`Vector`\n"
|
||||
" :return: A new rotation matrix.\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
|
||||
{
|
||||
PyObject *vec= NULL;
|
||||
@@ -295,7 +295,7 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args)
|
||||
}
|
||||
|
||||
|
||||
static char C_Matrix_Translation_doc[] =
|
||||
PyDoc_STRVAR(C_Matrix_Translation_doc,
|
||||
".. classmethod:: Translation(vector)\n"
|
||||
"\n"
|
||||
" Create a matrix representing a translation.\n"
|
||||
@@ -304,7 +304,7 @@ static char C_Matrix_Translation_doc[] =
|
||||
" :type vector: :class:`Vector`\n"
|
||||
" :return: An identity matrix with a translation.\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *C_Matrix_Translation(PyObject *cls, PyObject *value)
|
||||
{
|
||||
float mat[16], tvec[3];
|
||||
@@ -319,7 +319,7 @@ static PyObject *C_Matrix_Translation(PyObject *cls, PyObject *value)
|
||||
}
|
||||
//----------------------------------mathutils.Matrix.Scale() -------------
|
||||
//mat is a 1D array of floats - row[0][0], row[0][1], row[1][0], etc.
|
||||
static char C_Matrix_Scale_doc[] =
|
||||
PyDoc_STRVAR(C_Matrix_Scale_doc,
|
||||
".. classmethod:: Scale(factor, size, axis)\n"
|
||||
"\n"
|
||||
" Create a matrix representing a scaling.\n"
|
||||
@@ -332,7 +332,7 @@ static char C_Matrix_Scale_doc[] =
|
||||
" :type axis: :class:`Vector`\n"
|
||||
" :return: A new scale matrix.\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args)
|
||||
{
|
||||
PyObject *vec= NULL;
|
||||
@@ -402,7 +402,7 @@ static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args)
|
||||
}
|
||||
//----------------------------------mathutils.Matrix.OrthoProjection() ---
|
||||
//mat is a 1D array of floats - row[0][0], row[0][1], row[1][0], etc.
|
||||
static char C_Matrix_OrthoProjection_doc[] =
|
||||
PyDoc_STRVAR(C_Matrix_OrthoProjection_doc,
|
||||
".. classmethod:: OrthoProjection(axis, size)\n"
|
||||
"\n"
|
||||
" Create a matrix to represent an orthographic projection.\n"
|
||||
@@ -413,7 +413,7 @@ static char C_Matrix_OrthoProjection_doc[] =
|
||||
" :type size: int\n"
|
||||
" :return: A new projection matrix.\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
|
||||
{
|
||||
PyObject *axis;
|
||||
@@ -508,7 +508,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args)
|
||||
return newMatrixObject(mat, matSize, matSize, Py_NEW, (PyTypeObject *)cls);
|
||||
}
|
||||
|
||||
static char C_Matrix_Shear_doc[] =
|
||||
PyDoc_STRVAR(C_Matrix_Shear_doc,
|
||||
".. classmethod:: Shear(plane, size, factor)\n"
|
||||
"\n"
|
||||
" Create a matrix to represent an shear transformation.\n"
|
||||
@@ -521,7 +521,7 @@ static char C_Matrix_Shear_doc[] =
|
||||
" :type factor: float or float pair\n"
|
||||
" :return: A new shear matrix.\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *C_Matrix_Shear(PyObject *cls, PyObject *args)
|
||||
{
|
||||
int matSize;
|
||||
@@ -626,14 +626,14 @@ static float matrix_determinant_internal(MatrixObject *self)
|
||||
|
||||
|
||||
/*-----------------------------METHODS----------------------------*/
|
||||
static char Matrix_to_quaternion_doc[] =
|
||||
PyDoc_STRVAR(Matrix_to_quaternion_doc,
|
||||
".. method:: to_quaternion()\n"
|
||||
"\n"
|
||||
" Return a quaternion representation of the rotation matrix.\n"
|
||||
"\n"
|
||||
" :return: Quaternion representation of the rotation matrix.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_to_quaternion(MatrixObject *self)
|
||||
{
|
||||
float quat[4];
|
||||
@@ -657,7 +657,7 @@ static PyObject *Matrix_to_quaternion(MatrixObject *self)
|
||||
}
|
||||
|
||||
/*---------------------------Matrix.toEuler() --------------------*/
|
||||
static char Matrix_to_euler_doc[] =
|
||||
PyDoc_STRVAR(Matrix_to_euler_doc,
|
||||
".. method:: to_euler(order, euler_compat)\n"
|
||||
"\n"
|
||||
" Return an Euler representation of the rotation matrix (3x3 or 4x4 matrix only).\n"
|
||||
@@ -668,7 +668,7 @@ static char Matrix_to_euler_doc[] =
|
||||
" :type euler_compat: :class:`Euler`\n"
|
||||
" :return: Euler representation of the matrix.\n"
|
||||
" :rtype: :class:`Euler`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_to_euler(MatrixObject *self, PyObject *args)
|
||||
{
|
||||
const char *order_str= NULL;
|
||||
@@ -724,11 +724,11 @@ static PyObject *Matrix_to_euler(MatrixObject *self, PyObject *args)
|
||||
return newEulerObject(eul, order, Py_NEW, NULL);
|
||||
}
|
||||
|
||||
static char Matrix_resize_4x4_doc[] =
|
||||
PyDoc_STRVAR(Matrix_resize_4x4_doc,
|
||||
".. method:: resize_4x4()\n"
|
||||
"\n"
|
||||
" Resize the matrix to 4x4.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_resize_4x4(MatrixObject *self)
|
||||
{
|
||||
int x, first_row_elem, curr_pos, new_pos, blank_columns, blank_rows, index;
|
||||
@@ -781,14 +781,14 @@ static PyObject *Matrix_resize_4x4(MatrixObject *self)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char Matrix_to_4x4_doc[] =
|
||||
PyDoc_STRVAR(Matrix_to_4x4_doc,
|
||||
".. method:: to_4x4()\n"
|
||||
"\n"
|
||||
" Return a 4x4 copy of this matrix.\n"
|
||||
"\n"
|
||||
" :return: a new matrix.\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_to_4x4(MatrixObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -808,14 +808,14 @@ static PyObject *Matrix_to_4x4(MatrixObject *self)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static char Matrix_to_3x3_doc[] =
|
||||
PyDoc_STRVAR(Matrix_to_3x3_doc,
|
||||
".. method:: to_3x3()\n"
|
||||
"\n"
|
||||
" Return a 3x3 copy of this matrix.\n"
|
||||
"\n"
|
||||
" :return: a new matrix.\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_to_3x3(MatrixObject *self)
|
||||
{
|
||||
float mat[3][3];
|
||||
@@ -833,14 +833,14 @@ static PyObject *Matrix_to_3x3(MatrixObject *self)
|
||||
return newMatrixObject((float *)mat, 3, 3, Py_NEW, Py_TYPE(self));
|
||||
}
|
||||
|
||||
static char Matrix_to_translation_doc[] =
|
||||
PyDoc_STRVAR(Matrix_to_translation_doc,
|
||||
".. method:: to_translation()\n"
|
||||
"\n"
|
||||
" Return a the translation part of a 4 row matrix.\n"
|
||||
"\n"
|
||||
" :return: Return a the translation of a matrix.\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_to_translation(MatrixObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -854,7 +854,7 @@ static PyObject *Matrix_to_translation(MatrixObject *self)
|
||||
return newVectorObject(self->matrix[3], 3, Py_NEW, NULL);
|
||||
}
|
||||
|
||||
static char Matrix_to_scale_doc[] =
|
||||
PyDoc_STRVAR(Matrix_to_scale_doc,
|
||||
".. method:: to_scale()\n"
|
||||
"\n"
|
||||
" Return a the scale part of a 3x3 or 4x4 matrix.\n"
|
||||
@@ -863,7 +863,7 @@ static char Matrix_to_scale_doc[] =
|
||||
" :rtype: :class:`Vector`\n"
|
||||
"\n"
|
||||
" .. note:: This method does not return negative a scale on any axis because it is not possible to obtain this data from the matrix alone.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_to_scale(MatrixObject *self)
|
||||
{
|
||||
float rot[3][3];
|
||||
@@ -888,7 +888,7 @@ static PyObject *Matrix_to_scale(MatrixObject *self)
|
||||
}
|
||||
|
||||
/*---------------------------Matrix.invert() ---------------------*/
|
||||
static char Matrix_invert_doc[] =
|
||||
PyDoc_STRVAR(Matrix_invert_doc,
|
||||
".. method:: invert()\n"
|
||||
"\n"
|
||||
" Set the matrix to its inverse.\n"
|
||||
@@ -896,7 +896,7 @@ static char Matrix_invert_doc[] =
|
||||
" .. note:: :exc:`ValueError` exception is raised.\n"
|
||||
"\n"
|
||||
" .. seealso:: <http://en.wikipedia.org/wiki/Inverse_matrix>\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_invert(MatrixObject *self)
|
||||
{
|
||||
|
||||
@@ -950,7 +950,7 @@ static PyObject *Matrix_invert(MatrixObject *self)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char Matrix_inverted_doc[] =
|
||||
PyDoc_STRVAR(Matrix_inverted_doc,
|
||||
".. method:: inverted()\n"
|
||||
"\n"
|
||||
" Return an inverted copy of the matrix.\n"
|
||||
@@ -959,13 +959,13 @@ static char Matrix_inverted_doc[] =
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
"\n"
|
||||
" .. note:: :exc:`ValueError` exception is raised.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_inverted(MatrixObject *self)
|
||||
{
|
||||
return matrix__apply_to_copy((PyNoArgsFunction)Matrix_invert, self);
|
||||
}
|
||||
|
||||
static char Matrix_rotate_doc[] =
|
||||
PyDoc_STRVAR(Matrix_rotate_doc,
|
||||
".. method:: rotate(other)\n"
|
||||
"\n"
|
||||
" Rotates the matrix a by another mathutils value.\n"
|
||||
@@ -974,7 +974,7 @@ static char Matrix_rotate_doc[] =
|
||||
" :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n"
|
||||
"\n"
|
||||
" .. note:: If any of the columns are not unit length this may not have desired results.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_rotate(MatrixObject *self, PyObject *value)
|
||||
{
|
||||
float self_rmat[3][3], other_rmat[3][3], rmat[3][3];
|
||||
@@ -1000,14 +1000,14 @@ static PyObject *Matrix_rotate(MatrixObject *self, PyObject *value)
|
||||
}
|
||||
|
||||
/*---------------------------Matrix.decompose() ---------------------*/
|
||||
static char Matrix_decompose_doc[] =
|
||||
PyDoc_STRVAR(Matrix_decompose_doc,
|
||||
".. method:: decompose()\n"
|
||||
"\n"
|
||||
" Return the location, rotaion and scale components of this matrix.\n"
|
||||
"\n"
|
||||
" :return: loc, rot, scale triple.\n"
|
||||
" :rtype: (:class:`Vector`, :class:`Quaternion`, :class:`Vector`)"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_decompose(MatrixObject *self)
|
||||
{
|
||||
PyObject *ret;
|
||||
@@ -1037,7 +1037,7 @@ static PyObject *Matrix_decompose(MatrixObject *self)
|
||||
|
||||
|
||||
|
||||
static char Matrix_lerp_doc[] =
|
||||
PyDoc_STRVAR(Matrix_lerp_doc,
|
||||
".. function:: lerp(other, factor)\n"
|
||||
"\n"
|
||||
" Returns the interpolation of two matricies.\n"
|
||||
@@ -1048,7 +1048,7 @@ static char Matrix_lerp_doc[] =
|
||||
" :type factor: float\n"
|
||||
" :return: The interpolated rotation.\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_lerp(MatrixObject *self, PyObject *args)
|
||||
{
|
||||
MatrixObject *mat2 = NULL;
|
||||
@@ -1081,7 +1081,7 @@ static PyObject *Matrix_lerp(MatrixObject *self, PyObject *args)
|
||||
}
|
||||
|
||||
/*---------------------------Matrix.determinant() ----------------*/
|
||||
static char Matrix_determinant_doc[] =
|
||||
PyDoc_STRVAR(Matrix_determinant_doc,
|
||||
".. method:: determinant()\n"
|
||||
"\n"
|
||||
" Return the determinant of a matrix.\n"
|
||||
@@ -1090,7 +1090,7 @@ static char Matrix_determinant_doc[] =
|
||||
" :rtype: float\n"
|
||||
"\n"
|
||||
" .. seealso:: <http://en.wikipedia.org/wiki/Determinant>\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_determinant(MatrixObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -1104,13 +1104,13 @@ static PyObject *Matrix_determinant(MatrixObject *self)
|
||||
return PyFloat_FromDouble((double)matrix_determinant_internal(self));
|
||||
}
|
||||
/*---------------------------Matrix.transpose() ------------------*/
|
||||
static char Matrix_transpose_doc[] =
|
||||
PyDoc_STRVAR(Matrix_transpose_doc,
|
||||
".. method:: transpose()\n"
|
||||
"\n"
|
||||
" Set the matrix to its transpose.\n"
|
||||
"\n"
|
||||
" .. seealso:: <http://en.wikipedia.org/wiki/Transpose>\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_transpose(MatrixObject *self)
|
||||
{
|
||||
float t = 0.0f;
|
||||
@@ -1137,28 +1137,28 @@ static PyObject *Matrix_transpose(MatrixObject *self)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char Matrix_transposed_doc[] =
|
||||
PyDoc_STRVAR(Matrix_transposed_doc,
|
||||
".. method:: transposed()\n"
|
||||
"\n"
|
||||
" Return a new, transposed matrix.\n"
|
||||
"\n"
|
||||
" :return: a transposed matrix\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_transposed(MatrixObject *self)
|
||||
{
|
||||
return matrix__apply_to_copy((PyNoArgsFunction)Matrix_transpose, self);
|
||||
}
|
||||
|
||||
/*---------------------------Matrix.zero() -----------------------*/
|
||||
static char Matrix_zero_doc[] =
|
||||
PyDoc_STRVAR(Matrix_zero_doc,
|
||||
".. method:: zero()\n"
|
||||
"\n"
|
||||
" Set all the matrix values to zero.\n"
|
||||
"\n"
|
||||
" :return: an instance of itself\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_zero(MatrixObject *self)
|
||||
{
|
||||
fill_vn(self->contigPtr, self->row_size * self->col_size, 0.0f);
|
||||
@@ -1169,7 +1169,7 @@ static PyObject *Matrix_zero(MatrixObject *self)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/*---------------------------Matrix.identity(() ------------------*/
|
||||
static char Matrix_identity_doc[] =
|
||||
PyDoc_STRVAR(Matrix_identity_doc,
|
||||
".. method:: identity()\n"
|
||||
"\n"
|
||||
" Set the matrix to the identity matrix.\n"
|
||||
@@ -1177,7 +1177,7 @@ static char Matrix_identity_doc[] =
|
||||
" .. note:: An object with zero location and rotation, a scale of one, will have an identity matrix.\n"
|
||||
"\n"
|
||||
" .. seealso:: <http://en.wikipedia.org/wiki/Identity_matrix>\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_identity(MatrixObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -1206,14 +1206,14 @@ static PyObject *Matrix_identity(MatrixObject *self)
|
||||
}
|
||||
|
||||
/*---------------------------Matrix.copy() ------------------*/
|
||||
static char Matrix_copy_doc[] =
|
||||
PyDoc_STRVAR(Matrix_copy_doc,
|
||||
".. method:: copy()\n"
|
||||
"\n"
|
||||
" Returns a copy of this matrix.\n"
|
||||
"\n"
|
||||
" :return: an instance of itself\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Matrix_copy(MatrixObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -1780,9 +1780,9 @@ static struct PyMethodDef Matrix_methods[] = {
|
||||
};
|
||||
|
||||
/*------------------PY_OBECT DEFINITION--------------------------*/
|
||||
static char matrix_doc[] =
|
||||
PyDoc_STRVAR(matrix_doc,
|
||||
"This object gives access to Matrices in Blender."
|
||||
;
|
||||
);
|
||||
PyTypeObject matrix_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"mathutils.Matrix", /*tp_name*/
|
||||
|
@@ -67,7 +67,7 @@ static PyObject *Quaternion_to_tuple_ext(QuaternionObject *self, int ndigits)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char Quaternion_to_euler_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_to_euler_doc,
|
||||
".. method:: to_euler(order, euler_compat)\n"
|
||||
"\n"
|
||||
" Return Euler representation of the quaternion.\n"
|
||||
@@ -78,7 +78,7 @@ static char Quaternion_to_euler_doc[] =
|
||||
" :type euler_compat: :class:`Euler`\n"
|
||||
" :return: Euler representation of the quaternion.\n"
|
||||
" :rtype: :class:`Euler`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_to_euler(QuaternionObject *self, PyObject *args)
|
||||
{
|
||||
float tquat[4];
|
||||
@@ -121,14 +121,14 @@ static PyObject *Quaternion_to_euler(QuaternionObject *self, PyObject *args)
|
||||
return newEulerObject(eul, order, Py_NEW, NULL);
|
||||
}
|
||||
//----------------------------Quaternion.toMatrix()------------------
|
||||
static char Quaternion_to_matrix_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_to_matrix_doc,
|
||||
".. method:: to_matrix()\n"
|
||||
"\n"
|
||||
" Return a matrix representation of the quaternion.\n"
|
||||
"\n"
|
||||
" :return: A 3x3 rotation matrix representation of the quaternion.\n"
|
||||
" :rtype: :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_to_matrix(QuaternionObject *self)
|
||||
{
|
||||
float mat[9]; /* all values are set */
|
||||
@@ -141,7 +141,7 @@ static PyObject *Quaternion_to_matrix(QuaternionObject *self)
|
||||
}
|
||||
|
||||
//----------------------------Quaternion.cross(other)------------------
|
||||
static char Quaternion_cross_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_cross_doc,
|
||||
".. method:: cross(other)\n"
|
||||
"\n"
|
||||
" Return the cross product of this quaternion and another.\n"
|
||||
@@ -150,7 +150,7 @@ static char Quaternion_cross_doc[] =
|
||||
" :type other: :class:`Quaternion`\n"
|
||||
" :return: The cross product.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_cross(QuaternionObject *self, PyObject *value)
|
||||
{
|
||||
float quat[QUAT_SIZE], tquat[QUAT_SIZE];
|
||||
@@ -166,7 +166,7 @@ static PyObject *Quaternion_cross(QuaternionObject *self, PyObject *value)
|
||||
}
|
||||
|
||||
//----------------------------Quaternion.dot(other)------------------
|
||||
static char Quaternion_dot_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_dot_doc,
|
||||
".. method:: dot(other)\n"
|
||||
"\n"
|
||||
" Return the dot product of this quaternion and another.\n"
|
||||
@@ -175,7 +175,7 @@ static char Quaternion_dot_doc[] =
|
||||
" :type other: :class:`Quaternion`\n"
|
||||
" :return: The dot product.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_dot(QuaternionObject *self, PyObject *value)
|
||||
{
|
||||
float tquat[QUAT_SIZE];
|
||||
@@ -189,7 +189,7 @@ static PyObject *Quaternion_dot(QuaternionObject *self, PyObject *value)
|
||||
return PyFloat_FromDouble(dot_qtqt(self->quat, tquat));
|
||||
}
|
||||
|
||||
static char Quaternion_rotation_difference_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_rotation_difference_doc,
|
||||
".. function:: difference(other)\n"
|
||||
"\n"
|
||||
" Returns a quaternion representing the rotational difference.\n"
|
||||
@@ -198,7 +198,7 @@ static char Quaternion_rotation_difference_doc[] =
|
||||
" :type other: :class:`Quaternion`\n"
|
||||
" :return: the rotational difference between the two quat rotations.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_rotation_difference(QuaternionObject *self, PyObject *value)
|
||||
{
|
||||
float tquat[QUAT_SIZE], quat[QUAT_SIZE];
|
||||
@@ -214,7 +214,7 @@ static PyObject *Quaternion_rotation_difference(QuaternionObject *self, PyObject
|
||||
return newQuaternionObject(quat, Py_NEW, Py_TYPE(self));
|
||||
}
|
||||
|
||||
static char Quaternion_slerp_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_slerp_doc,
|
||||
".. function:: slerp(other, factor)\n"
|
||||
"\n"
|
||||
" Returns the interpolation of two quaternions.\n"
|
||||
@@ -225,7 +225,7 @@ static char Quaternion_slerp_doc[] =
|
||||
" :type factor: float\n"
|
||||
" :return: The interpolated rotation.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_slerp(QuaternionObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *value;
|
||||
@@ -252,14 +252,14 @@ static PyObject *Quaternion_slerp(QuaternionObject *self, PyObject *args)
|
||||
return newQuaternionObject(quat, Py_NEW, Py_TYPE(self));
|
||||
}
|
||||
|
||||
static char Quaternion_rotate_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_rotate_doc,
|
||||
".. method:: rotate(other)\n"
|
||||
"\n"
|
||||
" Rotates the quaternion a by another mathutils value.\n"
|
||||
"\n"
|
||||
" :arg other: rotation component of mathutils value\n"
|
||||
" :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_rotate(QuaternionObject *self, PyObject *value)
|
||||
{
|
||||
float self_rmat[3][3], other_rmat[3][3], rmat[3][3];
|
||||
@@ -284,11 +284,11 @@ static PyObject *Quaternion_rotate(QuaternionObject *self, PyObject *value)
|
||||
|
||||
//----------------------------Quaternion.normalize()----------------
|
||||
//normalize the axis of rotation of [theta, vector]
|
||||
static char Quaternion_normalize_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_normalize_doc,
|
||||
".. function:: normalize()\n"
|
||||
"\n"
|
||||
" Normalize the quaternion.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_normalize(QuaternionObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -299,25 +299,25 @@ static PyObject *Quaternion_normalize(QuaternionObject *self)
|
||||
(void)BaseMath_WriteCallback(self);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
static char Quaternion_normalized_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_normalized_doc,
|
||||
".. function:: normalized()\n"
|
||||
"\n"
|
||||
" Return a new normalized quaternion.\n"
|
||||
"\n"
|
||||
" :return: a normalized copy.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_normalized(QuaternionObject *self)
|
||||
{
|
||||
return quat__apply_to_copy((PyNoArgsFunction)Quaternion_normalize, self);
|
||||
}
|
||||
|
||||
//----------------------------Quaternion.invert()------------------
|
||||
static char Quaternion_invert_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_invert_doc,
|
||||
".. function:: invert()\n"
|
||||
"\n"
|
||||
" Set the quaternion to its inverse.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_invert(QuaternionObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -328,28 +328,28 @@ static PyObject *Quaternion_invert(QuaternionObject *self)
|
||||
(void)BaseMath_WriteCallback(self);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
static char Quaternion_inverted_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_inverted_doc,
|
||||
".. function:: inverted()\n"
|
||||
"\n"
|
||||
" Return a new, inverted quaternion.\n"
|
||||
"\n"
|
||||
" :return: the inverted value.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_inverted(QuaternionObject *self)
|
||||
{
|
||||
return quat__apply_to_copy((PyNoArgsFunction)Quaternion_invert, self);
|
||||
}
|
||||
|
||||
//----------------------------Quaternion.identity()-----------------
|
||||
static char Quaternion_identity_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_identity_doc,
|
||||
".. function:: identity()\n"
|
||||
"\n"
|
||||
" Set the quaternion to an identity quaternion.\n"
|
||||
"\n"
|
||||
" :return: an instance of itself.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_identity(QuaternionObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -361,14 +361,14 @@ static PyObject *Quaternion_identity(QuaternionObject *self)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
//----------------------------Quaternion.negate()-------------------
|
||||
static char Quaternion_negate_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_negate_doc,
|
||||
".. function:: negate()\n"
|
||||
"\n"
|
||||
" Set the quaternion to its negative.\n"
|
||||
"\n"
|
||||
" :return: an instance of itself.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_negate(QuaternionObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -380,11 +380,11 @@ static PyObject *Quaternion_negate(QuaternionObject *self)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
//----------------------------Quaternion.conjugate()----------------
|
||||
static char Quaternion_conjugate_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_conjugate_doc,
|
||||
".. function:: conjugate()\n"
|
||||
"\n"
|
||||
" Set the quaternion to its conjugate (negate x, y, z).\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_conjugate(QuaternionObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -395,21 +395,21 @@ static PyObject *Quaternion_conjugate(QuaternionObject *self)
|
||||
(void)BaseMath_WriteCallback(self);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
static char Quaternion_conjugated_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_conjugated_doc,
|
||||
".. function:: conjugated()\n"
|
||||
"\n"
|
||||
" Return a new conjugated quaternion.\n"
|
||||
"\n"
|
||||
" :return: a new quaternion.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_conjugated(QuaternionObject *self)
|
||||
{
|
||||
return quat__apply_to_copy((PyNoArgsFunction)Quaternion_conjugate, self);
|
||||
}
|
||||
|
||||
//----------------------------Quaternion.copy()----------------
|
||||
static char Quaternion_copy_doc[] =
|
||||
PyDoc_STRVAR(Quaternion_copy_doc,
|
||||
".. function:: copy()\n"
|
||||
"\n"
|
||||
" Returns a copy of this quaternion.\n"
|
||||
@@ -418,7 +418,7 @@ static char Quaternion_copy_doc[] =
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
"\n"
|
||||
" .. note:: use this to get a copy of a wrapped quaternion with no reference to the original data.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Quaternion_copy(QuaternionObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -1026,9 +1026,9 @@ static PyGetSetDef Quaternion_getseters[] = {
|
||||
};
|
||||
|
||||
//------------------PY_OBECT DEFINITION--------------------------
|
||||
static char quaternion_doc[] =
|
||||
PyDoc_STRVAR(quaternion_doc,
|
||||
"This object gives access to Quaternions in Blender."
|
||||
;
|
||||
);
|
||||
PyTypeObject quaternion_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
"mathutils.Quaternion", //tp_name
|
||||
|
@@ -87,11 +87,11 @@ static PyObject *vec__apply_to_copy(PyNoArgsFunction vec_func, VectorObject *sel
|
||||
}
|
||||
|
||||
/*-----------------------------METHODS---------------------------- */
|
||||
static char Vector_zero_doc[] =
|
||||
PyDoc_STRVAR(Vector_zero_doc,
|
||||
".. method:: zero()\n"
|
||||
"\n"
|
||||
" Set all values to zero.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_zero(VectorObject *self)
|
||||
{
|
||||
fill_vn(self->vec, self->size, 0.0f);
|
||||
@@ -102,7 +102,7 @@ static PyObject *Vector_zero(VectorObject *self)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char Vector_normalize_doc[] =
|
||||
PyDoc_STRVAR(Vector_normalize_doc,
|
||||
".. method:: normalize()\n"
|
||||
"\n"
|
||||
" Normalize the vector, making the length of the vector always 1.0.\n"
|
||||
@@ -110,7 +110,7 @@ static char Vector_normalize_doc[] =
|
||||
" .. warning:: Normalizing a vector where all values are zero results in all axis having a nan value (not a number).\n"
|
||||
"\n"
|
||||
" .. note:: Normalize works for vectors of all sizes, however 4D Vectors w axis is left untouched.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_normalize(VectorObject *self)
|
||||
{
|
||||
int i;
|
||||
@@ -130,27 +130,27 @@ static PyObject *Vector_normalize(VectorObject *self)
|
||||
(void)BaseMath_WriteCallback(self);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
static char Vector_normalized_doc[] =
|
||||
PyDoc_STRVAR(Vector_normalized_doc,
|
||||
".. method:: normalized()\n"
|
||||
"\n"
|
||||
" Return a new, normalized vector.\n"
|
||||
"\n"
|
||||
" :return: a normalized copy of the vector\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_normalized(VectorObject *self)
|
||||
{
|
||||
return vec__apply_to_copy((PyNoArgsFunction)Vector_normalize, self);
|
||||
}
|
||||
|
||||
static char Vector_resize_2d_doc[] =
|
||||
PyDoc_STRVAR(Vector_resize_2d_doc,
|
||||
".. method:: resize_2d()\n"
|
||||
"\n"
|
||||
" Resize the vector to 2D (x, y).\n"
|
||||
"\n"
|
||||
" :return: an instance of itself\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_resize_2d(VectorObject *self)
|
||||
{
|
||||
if(self->wrapped==Py_WRAP) {
|
||||
@@ -172,14 +172,14 @@ static PyObject *Vector_resize_2d(VectorObject *self)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char Vector_resize_3d_doc[] =
|
||||
PyDoc_STRVAR(Vector_resize_3d_doc,
|
||||
".. method:: resize_3d()\n"
|
||||
"\n"
|
||||
" Resize the vector to 3D (x, y, z).\n"
|
||||
"\n"
|
||||
" :return: an instance of itself\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_resize_3d(VectorObject *self)
|
||||
{
|
||||
if (self->wrapped==Py_WRAP) {
|
||||
@@ -204,14 +204,14 @@ static PyObject *Vector_resize_3d(VectorObject *self)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char Vector_resize_4d_doc[] =
|
||||
PyDoc_STRVAR(Vector_resize_4d_doc,
|
||||
".. method:: resize_4d()\n"
|
||||
"\n"
|
||||
" Resize the vector to 4D (x, y, z, w).\n"
|
||||
"\n"
|
||||
" :return: an instance of itself\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_resize_4d(VectorObject *self)
|
||||
{
|
||||
if(self->wrapped==Py_WRAP) {
|
||||
@@ -239,14 +239,14 @@ static PyObject *Vector_resize_4d(VectorObject *self)
|
||||
self->size = 4;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
static char Vector_to_2d_doc[] =
|
||||
PyDoc_STRVAR(Vector_to_2d_doc,
|
||||
".. method:: to_2d()\n"
|
||||
"\n"
|
||||
" Return a 2d copy of the vector.\n"
|
||||
"\n"
|
||||
" :return: a new vector\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_to_2d(VectorObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -254,14 +254,14 @@ static PyObject *Vector_to_2d(VectorObject *self)
|
||||
|
||||
return newVectorObject(self->vec, 2, Py_NEW, Py_TYPE(self));
|
||||
}
|
||||
static char Vector_to_3d_doc[] =
|
||||
PyDoc_STRVAR(Vector_to_3d_doc,
|
||||
".. method:: to_3d()\n"
|
||||
"\n"
|
||||
" Return a 3d copy of the vector.\n"
|
||||
"\n"
|
||||
" :return: a new vector\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_to_3d(VectorObject *self)
|
||||
{
|
||||
float tvec[3]= {0.0f};
|
||||
@@ -272,14 +272,14 @@ static PyObject *Vector_to_3d(VectorObject *self)
|
||||
memcpy(tvec, self->vec, sizeof(float) * MIN2(self->size, 3));
|
||||
return newVectorObject(tvec, 3, Py_NEW, Py_TYPE(self));
|
||||
}
|
||||
static char Vector_to_4d_doc[] =
|
||||
PyDoc_STRVAR(Vector_to_4d_doc,
|
||||
".. method:: to_4d()\n"
|
||||
"\n"
|
||||
" Return a 4d copy of the vector.\n"
|
||||
"\n"
|
||||
" :return: a new vector\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_to_4d(VectorObject *self)
|
||||
{
|
||||
float tvec[4]= {0.0f, 0.0f, 0.0f, 1.0f};
|
||||
@@ -291,7 +291,7 @@ static PyObject *Vector_to_4d(VectorObject *self)
|
||||
return newVectorObject(tvec, 4, Py_NEW, Py_TYPE(self));
|
||||
}
|
||||
|
||||
static char Vector_to_tuple_doc[] =
|
||||
PyDoc_STRVAR(Vector_to_tuple_doc,
|
||||
".. method:: to_tuple(precision=-1)\n"
|
||||
"\n"
|
||||
" Return this vector as a tuple with.\n"
|
||||
@@ -300,7 +300,7 @@ static char Vector_to_tuple_doc[] =
|
||||
" :type precision: int\n"
|
||||
" :return: the values of the vector rounded by *precision*\n"
|
||||
" :rtype: tuple\n"
|
||||
;
|
||||
);
|
||||
/* note: BaseMath_ReadCallback must be called beforehand */
|
||||
static PyObject *Vector_to_tuple_ext(VectorObject *self, int ndigits)
|
||||
{
|
||||
@@ -344,7 +344,7 @@ static PyObject *Vector_to_tuple(VectorObject *self, PyObject *args)
|
||||
return Vector_to_tuple_ext(self, ndigits);
|
||||
}
|
||||
|
||||
static char Vector_to_track_quat_doc[] =
|
||||
PyDoc_STRVAR(Vector_to_track_quat_doc,
|
||||
".. method:: to_track_quat(track, up)\n"
|
||||
"\n"
|
||||
" Return a quaternion rotation from the vector and the track and up axis.\n"
|
||||
@@ -355,7 +355,7 @@ static char Vector_to_track_quat_doc[] =
|
||||
" :type up: string\n"
|
||||
" :return: rotation from the vector and the track and up axis.\n"
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
|
||||
{
|
||||
float vec[3], quat[4];
|
||||
@@ -462,7 +462,7 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
|
||||
* Vector.reflect(mirror): return a reflected vector on the mirror normal
|
||||
* vec - ((2 * DotVecs(vec, mirror)) * mirror)
|
||||
*/
|
||||
static char Vector_reflect_doc[] =
|
||||
PyDoc_STRVAR(Vector_reflect_doc,
|
||||
".. method:: reflect(mirror)\n"
|
||||
"\n"
|
||||
" Return the reflection vector from the *mirror* argument.\n"
|
||||
@@ -471,7 +471,7 @@ static char Vector_reflect_doc[] =
|
||||
" :type mirror: :class:`Vector`\n"
|
||||
" :return: The reflected vector matching the size of this vector.\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_reflect(VectorObject *self, PyObject *value)
|
||||
{
|
||||
int value_size;
|
||||
@@ -501,7 +501,7 @@ static PyObject *Vector_reflect(VectorObject *self, PyObject *value)
|
||||
return newVectorObject(reflect, self->size, Py_NEW, Py_TYPE(self));
|
||||
}
|
||||
|
||||
static char Vector_cross_doc[] =
|
||||
PyDoc_STRVAR(Vector_cross_doc,
|
||||
".. method:: cross(other)\n"
|
||||
"\n"
|
||||
" Return the cross product of this vector and another.\n"
|
||||
@@ -512,7 +512,7 @@ static char Vector_cross_doc[] =
|
||||
" :rtype: :class:`Vector`\n"
|
||||
"\n"
|
||||
" .. note:: both vectors must be 3D\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_cross(VectorObject *self, PyObject *value)
|
||||
{
|
||||
VectorObject *ret;
|
||||
@@ -529,7 +529,7 @@ static PyObject *Vector_cross(VectorObject *self, PyObject *value)
|
||||
return (PyObject *)ret;
|
||||
}
|
||||
|
||||
static char Vector_dot_doc[] =
|
||||
PyDoc_STRVAR(Vector_dot_doc,
|
||||
".. method:: dot(other)\n"
|
||||
"\n"
|
||||
" Return the dot product of this vector and another.\n"
|
||||
@@ -538,7 +538,7 @@ static char Vector_dot_doc[] =
|
||||
" :type other: :class:`Vector`\n"
|
||||
" :return: The dot product.\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_dot(VectorObject *self, PyObject *value)
|
||||
{
|
||||
float tvec[MAX_DIMENSIONS];
|
||||
@@ -558,7 +558,7 @@ static PyObject *Vector_dot(VectorObject *self, PyObject *value)
|
||||
return PyFloat_FromDouble(dot);
|
||||
}
|
||||
|
||||
static char Vector_angle_doc[] =
|
||||
PyDoc_STRVAR(Vector_angle_doc,
|
||||
".. function:: angle(other, fallback)\n"
|
||||
"\n"
|
||||
" Return the angle between two vectors.\n"
|
||||
@@ -571,7 +571,7 @@ static char Vector_angle_doc[] =
|
||||
" :rtype: float\n"
|
||||
"\n"
|
||||
" .. note:: Zero length vectors raise an :exc:`AttributeError`.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_angle(VectorObject *self, PyObject *args)
|
||||
{
|
||||
const int size= self->size;
|
||||
@@ -615,7 +615,7 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args)
|
||||
return PyFloat_FromDouble(saacos(dot));
|
||||
}
|
||||
|
||||
static char Vector_rotation_difference_doc[] =
|
||||
PyDoc_STRVAR(Vector_rotation_difference_doc,
|
||||
".. function:: difference(other)\n"
|
||||
"\n"
|
||||
" Returns a quaternion representing the rotational difference between this vector and another.\n"
|
||||
@@ -626,7 +626,7 @@ static char Vector_rotation_difference_doc[] =
|
||||
" :rtype: :class:`Quaternion`\n"
|
||||
"\n"
|
||||
" .. note:: 2D vectors raise an :exc:`AttributeError`.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_rotation_difference(VectorObject *self, PyObject *value)
|
||||
{
|
||||
float quat[4], vec_a[3], vec_b[3];
|
||||
@@ -650,7 +650,7 @@ static PyObject *Vector_rotation_difference(VectorObject *self, PyObject *value)
|
||||
return newQuaternionObject(quat, Py_NEW, NULL);
|
||||
}
|
||||
|
||||
static char Vector_project_doc[] =
|
||||
PyDoc_STRVAR(Vector_project_doc,
|
||||
".. function:: project(other)\n"
|
||||
"\n"
|
||||
" Return the projection of this vector onto the *other*.\n"
|
||||
@@ -659,7 +659,7 @@ static char Vector_project_doc[] =
|
||||
" :type other: :class:`Vector`\n"
|
||||
" :return: the parallel projection vector\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_project(VectorObject *self, PyObject *value)
|
||||
{
|
||||
const int size= self->size;
|
||||
@@ -690,7 +690,7 @@ static PyObject *Vector_project(VectorObject *self, PyObject *value)
|
||||
return newVectorObject(vec, size, Py_NEW, Py_TYPE(self));
|
||||
}
|
||||
|
||||
static char Vector_lerp_doc[] =
|
||||
PyDoc_STRVAR(Vector_lerp_doc,
|
||||
".. function:: lerp(other, factor)\n"
|
||||
"\n"
|
||||
" Returns the interpolation of two vectors.\n"
|
||||
@@ -701,7 +701,7 @@ static char Vector_lerp_doc[] =
|
||||
" :type factor: float\n"
|
||||
" :return: The interpolated rotation.\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_lerp(VectorObject *self, PyObject *args)
|
||||
{
|
||||
const int size= self->size;
|
||||
@@ -727,14 +727,14 @@ static PyObject *Vector_lerp(VectorObject *self, PyObject *args)
|
||||
return newVectorObject(vec, size, Py_NEW, Py_TYPE(self));
|
||||
}
|
||||
|
||||
static char Vector_rotate_doc[] =
|
||||
PyDoc_STRVAR(Vector_rotate_doc,
|
||||
".. function:: rotate(other)\n"
|
||||
"\n"
|
||||
" Return vector by a rotation value.\n"
|
||||
"\n"
|
||||
" :arg other: rotation component of mathutils value\n"
|
||||
" :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_rotate(VectorObject *self, PyObject *value)
|
||||
{
|
||||
float other_rmat[3][3];
|
||||
@@ -756,7 +756,7 @@ static PyObject *Vector_rotate(VectorObject *self, PyObject *value)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static char Vector_copy_doc[] =
|
||||
PyDoc_STRVAR(Vector_copy_doc,
|
||||
".. function:: copy()\n"
|
||||
"\n"
|
||||
" Returns a copy of this vector.\n"
|
||||
@@ -765,7 +765,7 @@ static char Vector_copy_doc[] =
|
||||
" :rtype: :class:`Vector`\n"
|
||||
"\n"
|
||||
" .. note:: use this to get a copy of a wrapped vector with no reference to the original data.\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_copy(VectorObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -2094,14 +2094,14 @@ static int row_vector_multiplication(float rvec[4], VectorObject* vec, MatrixObj
|
||||
#endif
|
||||
|
||||
/*----------------------------Vector.negate() -------------------- */
|
||||
static char Vector_negate_doc[] =
|
||||
PyDoc_STRVAR(Vector_negate_doc,
|
||||
".. method:: negate()\n"
|
||||
"\n"
|
||||
" Set all values to their negative.\n"
|
||||
"\n"
|
||||
" :return: an instance of itself\n"
|
||||
" :rtype: :class:`Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *Vector_negate(VectorObject *self)
|
||||
{
|
||||
if(BaseMath_ReadCallback(self) == -1)
|
||||
@@ -2153,9 +2153,9 @@ static struct PyMethodDef Vector_methods[] = {
|
||||
vec*mat and mat*vec both get sent to Vector_mul and it neesd to sort out the order
|
||||
*/
|
||||
|
||||
static char vector_doc[] =
|
||||
PyDoc_STRVAR(vector_doc,
|
||||
"This object gives access to Vectors in Blender."
|
||||
;
|
||||
);
|
||||
PyTypeObject vector_Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
/* For printing, in format "<module>.<name>" */
|
||||
|
@@ -53,11 +53,13 @@
|
||||
|
||||
|
||||
/*-------------------------DOC STRINGS ---------------------------*/
|
||||
static char M_Geometry_doc[]= "The Blender geometry module\n\n";
|
||||
PyDoc_STRVAR(M_Geometry_doc,
|
||||
"The Blender geometry module"
|
||||
);
|
||||
|
||||
//---------------------------------INTERSECTION FUNCTIONS--------------------
|
||||
|
||||
static char M_Geometry_intersect_ray_tri_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_intersect_ray_tri_doc,
|
||||
".. function:: intersect_ray_tri(v1, v2, v3, ray, orig, clip=True)\n"
|
||||
"\n"
|
||||
" Returns the intersection between a ray and a triangle, if possible, returns None otherwise.\n"
|
||||
@@ -76,7 +78,7 @@ static char M_Geometry_intersect_ray_tri_doc[] =
|
||||
" :type clip: boolean\n"
|
||||
" :return: The point of intersection or None if no intersection is found\n"
|
||||
" :rtype: :class:`mathutils.Vector` or None\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_intersect_ray_tri(PyObject *UNUSED(self), PyObject* args)
|
||||
{
|
||||
VectorObject *ray, *ray_off, *vec1, *vec2, *vec3;
|
||||
@@ -150,7 +152,7 @@ static PyObject *M_Geometry_intersect_ray_tri(PyObject *UNUSED(self), PyObject*
|
||||
|
||||
/* Line-Line intersection using algorithm from mathworld.wolfram.com */
|
||||
|
||||
static char M_Geometry_intersect_line_line_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_intersect_line_line_doc,
|
||||
".. function:: intersect_line_line(v1, v2, v3, v4)\n"
|
||||
"\n"
|
||||
" Returns a tuple with the points on each line respectively closest to the other.\n"
|
||||
@@ -164,7 +166,7 @@ static char M_Geometry_intersect_line_line_doc[] =
|
||||
" :arg v4: Second point of the second line\n"
|
||||
" :type v4: :class:`mathutils.Vector`\n"
|
||||
" :rtype: tuple of :class:`mathutils.Vector`'s\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
PyObject * tuple;
|
||||
@@ -232,7 +234,7 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject
|
||||
|
||||
|
||||
//----------------------------geometry.normal() -------------------
|
||||
static char M_Geometry_normal_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_normal_doc,
|
||||
".. function:: normal(v1, v2, v3, v4=None)\n"
|
||||
"\n"
|
||||
" Returns the normal of the 3D tri or quad.\n"
|
||||
@@ -246,7 +248,7 @@ static char M_Geometry_normal_doc[] =
|
||||
" :arg v4: Point4 (optional)\n"
|
||||
" :type v4: :class:`mathutils.Vector`\n"
|
||||
" :rtype: :class:`mathutils.Vector`\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_normal(PyObject *UNUSED(self), PyObject* args)
|
||||
{
|
||||
VectorObject *vec1, *vec2, *vec3, *vec4;
|
||||
@@ -294,7 +296,7 @@ static PyObject *M_Geometry_normal(PyObject *UNUSED(self), PyObject* args)
|
||||
|
||||
//--------------------------------- AREA FUNCTIONS--------------------
|
||||
|
||||
static char M_Geometry_area_tri_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_area_tri_doc,
|
||||
".. function:: area_tri(v1, v2, v3)\n"
|
||||
"\n"
|
||||
" Returns the area size of the 2D or 3D triangle defined.\n"
|
||||
@@ -306,7 +308,7 @@ static char M_Geometry_area_tri_doc[] =
|
||||
" :arg v3: Point3\n"
|
||||
" :type v3: :class:`mathutils.Vector`\n"
|
||||
" :rtype: float\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_area_tri(PyObject *UNUSED(self), PyObject* args)
|
||||
{
|
||||
VectorObject *vec1, *vec2, *vec3;
|
||||
@@ -336,14 +338,14 @@ static PyObject *M_Geometry_area_tri(PyObject *UNUSED(self), PyObject* args)
|
||||
}
|
||||
|
||||
/*----------------------------------geometry.PolyFill() -------------------*/
|
||||
static char M_Geometry_tesselate_polygon_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_tesselate_polygon_doc,
|
||||
".. function:: tesselate_polygon(veclist_list)\n"
|
||||
"\n"
|
||||
" Takes a list of polylines (each point a vector) and returns the point indices for a polyline filled with triangles.\n"
|
||||
"\n"
|
||||
" :arg veclist_list: list of polylines\n"
|
||||
" :rtype: list\n"
|
||||
;
|
||||
);
|
||||
/* PolyFill function, uses Blenders scanfill to fill multiple poly lines */
|
||||
static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *polyLineSeq)
|
||||
{
|
||||
@@ -456,7 +458,7 @@ static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject *
|
||||
return tri_list;
|
||||
}
|
||||
|
||||
static char M_Geometry_intersect_line_line_2d_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_intersect_line_line_2d_doc,
|
||||
".. function:: intersect_line_line_2d(lineA_p1, lineA_p2, lineB_p1, lineB_p2)\n"
|
||||
"\n"
|
||||
" Takes 2 lines (as 4 vectors) and returns a vector for their point of intersection or None.\n"
|
||||
@@ -471,7 +473,7 @@ static char M_Geometry_intersect_line_line_2d_doc[] =
|
||||
" :type lineB_p2: :class:`mathutils.Vector`\n"
|
||||
" :return: The point of intersection or None when not found\n"
|
||||
" :rtype: :class:`mathutils.Vector` or None\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_intersect_line_line_2d(PyObject *UNUSED(self), PyObject* args)
|
||||
{
|
||||
VectorObject *line_a1, *line_a2, *line_b1, *line_b2;
|
||||
@@ -497,7 +499,7 @@ static PyObject *M_Geometry_intersect_line_line_2d(PyObject *UNUSED(self), PyObj
|
||||
}
|
||||
|
||||
|
||||
static char M_Geometry_intersect_line_plane_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_intersect_line_plane_doc,
|
||||
".. function:: intersect_line_plane(line_a, line_b, plane_co, plane_no, no_flip=False)\n"
|
||||
"\n"
|
||||
" Takes 2 lines (as 4 vectors) and returns a vector for their point of intersection or None.\n"
|
||||
@@ -514,7 +516,7 @@ static char M_Geometry_intersect_line_plane_doc[] =
|
||||
" :type no_flip: :boolean\n"
|
||||
" :return: The point of intersection or None when not found\n"
|
||||
" :rtype: :class:`mathutils.Vector` or None\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObject* args)
|
||||
{
|
||||
VectorObject *line_a, *line_b, *plane_co, *plane_no;
|
||||
@@ -551,7 +553,7 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec
|
||||
}
|
||||
}
|
||||
|
||||
static char M_Geometry_intersect_point_line_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_intersect_point_line_doc,
|
||||
".. function:: intersect_point_line(pt, line_p1, line_p2)\n"
|
||||
"\n"
|
||||
" Takes a point and a line and returns a tuple with the closest point on the line and its distance from the first point of the line as a percentage of the length of the line.\n"
|
||||
@@ -563,7 +565,7 @@ static char M_Geometry_intersect_point_line_doc[] =
|
||||
" :arg line_p1: Second point of the line\n"
|
||||
" :type line_p1: :class:`mathutils.Vector`\n"
|
||||
" :rtype: (:class:`mathutils.Vector`, float)\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_intersect_point_line(PyObject *UNUSED(self), PyObject* args)
|
||||
{
|
||||
VectorObject *pt, *line_1, *line_2;
|
||||
@@ -601,7 +603,7 @@ static PyObject *M_Geometry_intersect_point_line(PyObject *UNUSED(self), PyObjec
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char M_Geometry_intersect_point_tri_2d_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_intersect_point_tri_2d_doc,
|
||||
".. function:: intersect_point_tri_2d(pt, tri_p1, tri_p2, tri_p3)\n"
|
||||
"\n"
|
||||
" Takes 4 vectors (using only the x and y coordinates): one is the point and the next 3 define the triangle. Returns 1 if the point is within the triangle, otherwise 0.\n"
|
||||
@@ -615,7 +617,7 @@ static char M_Geometry_intersect_point_tri_2d_doc[] =
|
||||
" :arg tri_p3: Third point of the triangle\n"
|
||||
" :type tri_p3: :class:`mathutils.Vector`\n"
|
||||
" :rtype: int\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_intersect_point_tri_2d(PyObject *UNUSED(self), PyObject* args)
|
||||
{
|
||||
VectorObject *pt_vec, *tri_p1, *tri_p2, *tri_p3;
|
||||
@@ -635,7 +637,7 @@ static PyObject *M_Geometry_intersect_point_tri_2d(PyObject *UNUSED(self), PyObj
|
||||
return PyLong_FromLong(isect_point_tri_v2(pt_vec->vec, tri_p1->vec, tri_p2->vec, tri_p3->vec));
|
||||
}
|
||||
|
||||
static char M_Geometry_intersect_point_quad_2d_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_intersect_point_quad_2d_doc,
|
||||
".. function:: intersect_point_quad_2d(pt, quad_p1, quad_p2, quad_p3, quad_p4)\n"
|
||||
"\n"
|
||||
" Takes 5 vectors (using only the x and y coordinates): one is the point and the next 4 define the quad, only the x and y are used from the vectors. Returns 1 if the point is within the quad, otherwise 0.\n"
|
||||
@@ -651,7 +653,7 @@ static char M_Geometry_intersect_point_quad_2d_doc[] =
|
||||
" :arg quad_p4: Forth point of the quad\n"
|
||||
" :type quad_p4: :class:`mathutils.Vector`\n"
|
||||
" :rtype: int\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_intersect_point_quad_2d(PyObject *UNUSED(self), PyObject* args)
|
||||
{
|
||||
VectorObject *pt_vec, *quad_p1, *quad_p2, *quad_p3, *quad_p4;
|
||||
@@ -735,7 +737,7 @@ static void boxPack_ToPyObject(PyObject * value, boxPack **boxarray)
|
||||
MEM_freeN(*boxarray);
|
||||
}
|
||||
|
||||
static char M_Geometry_box_pack_2d_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_box_pack_2d_doc,
|
||||
".. function:: box_pack_2d(boxes)\n"
|
||||
"\n"
|
||||
" Returns the normal of the 3D tri or quad.\n"
|
||||
@@ -744,7 +746,7 @@ static char M_Geometry_box_pack_2d_doc[] =
|
||||
" :type boxes: list\n"
|
||||
" :return: the width and height of the packed bounding box\n"
|
||||
" :rtype: tuple, pair of floats\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_box_pack_2d(PyObject *UNUSED(self), PyObject *boxlist)
|
||||
{
|
||||
float tot_width= 0.0f, tot_height= 0.0f;
|
||||
@@ -776,7 +778,7 @@ static PyObject *M_Geometry_box_pack_2d(PyObject *UNUSED(self), PyObject *boxlis
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char M_Geometry_interpolate_bezier_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_interpolate_bezier_doc,
|
||||
".. function:: interpolate_bezier(knot1, handle1, handle2, knot2, resolution)\n"
|
||||
"\n"
|
||||
" Interpolate a bezier spline segment.\n"
|
||||
@@ -793,7 +795,7 @@ static char M_Geometry_interpolate_bezier_doc[] =
|
||||
" :type resolution: int\n"
|
||||
" :return: The interpolated points\n"
|
||||
" :rtype: list of :class:`mathutils.Vector`'s\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_interpolate_bezier(PyObject *UNUSED(self), PyObject* args)
|
||||
{
|
||||
VectorObject *vec_k1, *vec_h1, *vec_k2, *vec_h2;
|
||||
@@ -847,7 +849,7 @@ static PyObject *M_Geometry_interpolate_bezier(PyObject *UNUSED(self), PyObject*
|
||||
return list;
|
||||
}
|
||||
|
||||
static char M_Geometry_barycentric_transform_doc[] =
|
||||
PyDoc_STRVAR(M_Geometry_barycentric_transform_doc,
|
||||
".. function:: barycentric_transform(point, tri_a1, tri_a2, tri_a3, tri_b1, tri_b2, tri_b3)\n"
|
||||
"\n"
|
||||
" Return a transformed point, the transformation is defined by 2 triangles.\n"
|
||||
@@ -868,7 +870,7 @@ static char M_Geometry_barycentric_transform_doc[] =
|
||||
" :type tri_a3: :class:`mathutils.Vector`\n"
|
||||
" :return: The transformed point\n"
|
||||
" :rtype: :class:`mathutils.Vector`'s\n"
|
||||
;
|
||||
);
|
||||
static PyObject *M_Geometry_barycentric_transform(PyObject *UNUSED(self), PyObject *args)
|
||||
{
|
||||
VectorObject *vec_pt;
|
||||
|
@@ -478,111 +478,134 @@ static PyObject *Noise_cell_vector(PyObject *UNUSED(self), PyObject *args)
|
||||
In the original module I actually kept the docs stings with the functions themselves,
|
||||
but I grouped them here so that it can easily be moved to a header if anyone thinks that is necessary. */
|
||||
|
||||
static char random__doc__[] = "() No arguments.\n\n\
|
||||
Returns a random floating point number in the range [0, 1)";
|
||||
PyDoc_STRVAR(random__doc__,
|
||||
"() No arguments.\n\n\
|
||||
Returns a random floating point number in the range [0, 1)"
|
||||
);
|
||||
|
||||
static char random_unit_vector__doc__[] =
|
||||
"() No arguments.\n\nReturns a random unit vector (3-float list).";
|
||||
PyDoc_STRVAR(random_unit_vector__doc__,
|
||||
"() No arguments.\n\nReturns a random unit vector (3-float list)."
|
||||
);
|
||||
|
||||
static char seed_set__doc__[] = "(seed value)\n\n\
|
||||
PyDoc_STRVAR(seed_set__doc__,
|
||||
"(seed value)\n\n\
|
||||
Initializes random number generator.\n\
|
||||
if seed is zero, the current time will be used instead.";
|
||||
if seed is zero, the current time will be used instead."
|
||||
);
|
||||
|
||||
static char noise__doc__[] = "((x,y,z) tuple, [noisetype])\n\n\
|
||||
PyDoc_STRVAR(noise__doc__,
|
||||
"((x,y,z) tuple, [noisetype])\n\n\
|
||||
Returns general noise of the optional specified type.\n\
|
||||
Optional argument noisetype determines the type of noise, STDPERLIN by default, see NoiseTypes.";
|
||||
Optional argument noisetype determines the type of noise, STDPERLIN by default, see NoiseTypes."
|
||||
);
|
||||
|
||||
static char noise_vector__doc__[] = "((x,y,z) tuple, [noisetype])\n\n\
|
||||
PyDoc_STRVAR(noise_vector__doc__,
|
||||
"((x,y,z) tuple, [noisetype])\n\n\
|
||||
Returns noise vector (3-float list) of the optional specified type.\
|
||||
Optional argument noisetype determines the type of noise, STDPERLIN by default, see NoiseTypes.";
|
||||
Optional argument noisetype determines the type of noise, STDPERLIN by default, see NoiseTypes."
|
||||
);
|
||||
|
||||
static char turbulence__doc__[] =
|
||||
"((x,y,z) tuple, octaves, hard, [noisebasis], [ampscale], [freqscale])\n\n\
|
||||
PyDoc_STRVAR(turbulence__doc__,
|
||||
"((x,y,z) tuple, octaves, hard, [noisebasis], [ampscale], [freqscale])\n\n\
|
||||
Returns general turbulence value using the optional specified noisebasis function.\n\
|
||||
octaves (integer) is the number of noise values added.\n\
|
||||
hard (bool), when false (0) returns 'soft' noise, when true (1) returns 'hard' noise (returned value always positive).\n\
|
||||
Optional arguments:\n\
|
||||
noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.\n\
|
||||
ampscale sets the amplitude scale value of the noise frequencies added, 0.5 by default.\n\
|
||||
freqscale sets the frequency scale factor, 2.0 by default.";
|
||||
freqscale sets the frequency scale factor, 2.0 by default."
|
||||
);
|
||||
|
||||
static char turbulence_vector__doc__[] =
|
||||
"((x,y,z) tuple, octaves, hard, [noisebasis], [ampscale], [freqscale])\n\n\
|
||||
PyDoc_STRVAR(turbulence_vector__doc__,
|
||||
"((x,y,z) tuple, octaves, hard, [noisebasis], [ampscale], [freqscale])\n\n\
|
||||
Returns general turbulence vector (3-float list) using the optional specified noisebasis function.\n\
|
||||
octaves (integer) is the number of noise values added.\n\
|
||||
hard (bool), when false (0) returns 'soft' noise, when true (1) returns 'hard' noise (returned vector always positive).\n\
|
||||
Optional arguments:\n\
|
||||
noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.\n\
|
||||
ampscale sets the amplitude scale value of the noise frequencies added, 0.5 by default.\n\
|
||||
freqscale sets the frequency scale factor, 2.0 by default.";
|
||||
freqscale sets the frequency scale factor, 2.0 by default."
|
||||
);
|
||||
|
||||
static char fractal__doc__[] =
|
||||
"((x,y,z) tuple, H, lacunarity, octaves, [noisebasis])\n\n\
|
||||
PyDoc_STRVAR(fractal__doc__,
|
||||
"((x,y,z) tuple, H, lacunarity, octaves, [noisebasis])\n\n\
|
||||
Returns Fractal Brownian Motion noise value(fBm).\n\
|
||||
H is the fractal increment parameter.\n\
|
||||
lacunarity is the gap between successive frequencies.\n\
|
||||
octaves is the number of frequencies in the fBm.\n\
|
||||
Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.";
|
||||
Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes."
|
||||
);
|
||||
|
||||
static char multi_fractal__doc__[] =
|
||||
"((x,y,z) tuple, H, lacunarity, octaves, [noisebasis])\n\n\
|
||||
PyDoc_STRVAR(multi_fractal__doc__,
|
||||
"((x,y,z) tuple, H, lacunarity, octaves, [noisebasis])\n\n\
|
||||
Returns Multifractal noise value.\n\
|
||||
H determines the highest fractal dimension.\n\
|
||||
lacunarity is gap between successive frequencies.\n\
|
||||
octaves is the number of frequencies in the fBm.\n\
|
||||
Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.";
|
||||
Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes."
|
||||
);
|
||||
|
||||
static char vl_vector__doc__[] =
|
||||
"((x,y,z) tuple, distortion, [noisetype1], [noisetype2])\n\n\
|
||||
PyDoc_STRVAR(vl_vector__doc__,
|
||||
"((x,y,z) tuple, distortion, [noisetype1], [noisetype2])\n\n\
|
||||
Returns Variable Lacunarity Noise value, a distorted variety of noise.\n\
|
||||
distortion sets the amount of distortion.\n\
|
||||
Optional arguments noisetype1 and noisetype2 set the noisetype to distort and the noisetype used for the distortion respectively.\n\
|
||||
See NoiseTypes, both are STDPERLIN by default.";
|
||||
See NoiseTypes, both are STDPERLIN by default."
|
||||
);
|
||||
|
||||
static char hetero_terrain__doc__[] =
|
||||
"((x,y,z) tuple, H, lacunarity, octaves, offset, [noisebasis])\n\n\
|
||||
PyDoc_STRVAR(hetero_terrain__doc__,
|
||||
"((x,y,z) tuple, H, lacunarity, octaves, offset, [noisebasis])\n\n\
|
||||
returns Heterogeneous Terrain value\n\
|
||||
H determines the fractal dimension of the roughest areas.\n\
|
||||
lacunarity is the gap between successive frequencies.\n\
|
||||
octaves is the number of frequencies in the fBm.\n\
|
||||
offset raises the terrain from 'sea level'.\n\
|
||||
Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.";
|
||||
Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes."
|
||||
);
|
||||
|
||||
static char hybrid_multi_fractal__doc__[] =
|
||||
"((x,y,z) tuple, H, lacunarity, octaves, offset, gain, [noisebasis])\n\n\
|
||||
PyDoc_STRVAR(hybrid_multi_fractal__doc__,
|
||||
"((x,y,z) tuple, H, lacunarity, octaves, offset, gain, [noisebasis])\n\n\
|
||||
returns Hybrid Multifractal value.\n\
|
||||
H determines the fractal dimension of the roughest areas.\n\
|
||||
lacunarity is the gap between successive frequencies.\n\
|
||||
octaves is the number of frequencies in the fBm.\n\
|
||||
offset raises the terrain from 'sea level'.\n\
|
||||
gain scales the values.\n\
|
||||
Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.";
|
||||
Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes."
|
||||
);
|
||||
|
||||
static char ridged_multi_fractal__doc__[] =
|
||||
"((x,y,z) tuple, H, lacunarity, octaves, offset, gain [noisebasis])\n\n\
|
||||
PyDoc_STRVAR(ridged_multi_fractal__doc__,
|
||||
"((x,y,z) tuple, H, lacunarity, octaves, offset, gain [noisebasis])\n\n\
|
||||
returns Ridged Multifractal value.\n\
|
||||
H determines the fractal dimension of the roughest areas.\n\
|
||||
lacunarity is the gap between successive frequencies.\n\
|
||||
octaves is the number of frequencies in the fBm.\n\
|
||||
offset raises the terrain from 'sea level'.\n\
|
||||
gain scales the values.\n\
|
||||
Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes.";
|
||||
Optional argument noisebasis determines the type of noise used for the turbulence, STDPERLIN by default, see NoiseTypes."
|
||||
);
|
||||
|
||||
static char voronoi__doc__[] =
|
||||
"((x,y,z) tuple, distance_metric, [exponent])\n\n\
|
||||
PyDoc_STRVAR(voronoi__doc__,
|
||||
"((x,y,z) tuple, distance_metric, [exponent])\n\n\
|
||||
returns a list, containing a list of distances in order of closest feature,\n\
|
||||
and a list containing the positions of the four closest features\n\
|
||||
Optional arguments:\n\
|
||||
distance_metric: see DistanceMetrics, default is DISTANCE\n\
|
||||
exponent is only used with MINKOVSKY, default is 2.5.";
|
||||
exponent is only used with MINKOVSKY, default is 2.5."
|
||||
);
|
||||
|
||||
static char cell__doc__[] = "((x,y,z) tuple)\n\n\
|
||||
returns cellnoise float value.";
|
||||
PyDoc_STRVAR(cell__doc__,
|
||||
"((x,y,z) tuple)\n\n\
|
||||
returns cellnoise float value."
|
||||
);
|
||||
|
||||
static char cell_vector__doc__[] = "((x,y,z) tuple)\n\n\
|
||||
returns cellnoise vector/point/color (3-float list).";
|
||||
PyDoc_STRVAR(cell_vector__doc__,
|
||||
"((x,y,z) tuple)\n\n\
|
||||
returns cellnoise vector/point/color (3-float list)."
|
||||
);
|
||||
|
||||
static char Noise__doc__[] = "Blender Noise and Turbulence Module\n\n\
|
||||
PyDoc_STRVAR(Noise__doc__,
|
||||
"Blender Noise and Turbulence Module\n\n\
|
||||
This module can be used to generate noise of various types.\n\
|
||||
This can be used for terrain generation, to create textures,\n\
|
||||
make animations more 'animated', object deformation, etc.\n\
|
||||
@@ -610,7 +633,8 @@ look like anything from an earthquake to a very nervous or maybe even drunk came
|
||||
\trv = Noise.turbulence_vector(ps, 3, 0, Noise.NoiseTypes.NEWPERLIN)\n\
|
||||
\tob.dloc = (sp*rv[0], sp*rv[1], sp*rv[2])\n\
|
||||
\tob.drot = (sr*rv[0], sr*rv[1], sr*rv[2])\n\
|
||||
\n";
|
||||
\n"
|
||||
);
|
||||
|
||||
/* Just in case, declarations for a header file */
|
||||
/*
|
||||
|
Reference in New Issue
Block a user