X-Git-Url: https://git.blender.org/gitweb/gitweb.cgi/blender.git/blobdiff_plain/b61a81ff9b740764b3ff928053a48e01f3f7a2ef..6d9c02be4cfd61b985af789e167f7fa78dbc0868:/source/blender/python/api2_2x/doc/Mathutils.py diff --git a/source/blender/python/api2_2x/doc/Mathutils.py b/source/blender/python/api2_2x/doc/Mathutils.py index 238c4def84c..70427b6c074 100644 --- a/source/blender/python/api2_2x/doc/Mathutils.py +++ b/source/blender/python/api2_2x/doc/Mathutils.py @@ -39,18 +39,6 @@ def Rand (high = 1, low = 0): @param low: The lower range. """ -def Vector (list = None): - """ - Create a new Vector object from a list. - @type list: PyList of float or int - @param list: The list of values for the Vector object. - Must be 2, 3, or 4 values. - @rtype: Vector object. - @return: It depends wheter a parameter was passed: - - (list): Vector object initialized with the given values; - - (): An empty 3 dimensional vector. - """ - def CopyVec(vector): """ Create a copy of the Vector object. @@ -128,23 +116,6 @@ def ProjectVecs(vec1, vec2): @return: The parallel projection vector. """ -def Matrix(list1 = None, list2 = None, list3 = None, list4 = None): - """ - Create a new matrix object from intialized values. - @type list1: PyList of int/float - @param list1: A 2d,3d or 4d list. - @type list2: PyList of int/float - @param list2: A 2d,3d or 4d list. - @type list3: PyList of int/float - @param list3: A 2d,3d or 4d list. - @type list4: PyList of int/float - @param list4: A 2d,3d or 4d list. - @rtype: New matrix object. - @return: It depends wheter a parameter was passed: - - (list1, etc.): Matrix object initialized with the given values; - - (): An empty 3 dimensional matrix. - """ - def RotationMatrix(angle, matSize, axisFlag, axis): """ Create a matrix representing a rotation. @@ -248,21 +219,6 @@ def MatMultVec(mat, vec): @return: The column vector that results from the muliplication. """ -def Quaternion(list = None, angle = None): - """ - Create a new matrix object from intialized values. - @type list: PyList of int/float - @param list: A 3d or 4d list to intialize quaternion. - 4d if intializing, 3d if will be used as an axis of rotation. - @type angle: float (optional) - @param angle: An arbitrary rotation amount around 'list'. - List is used as an axis of rotation in this case. - @rtype: New quaternion object. - @return: It depends wheter a parameter was passed: - - (list/angle): Quaternion object initialized with the given values; - - (): An identity 4 dimensional quaternion. - """ - def CopyQuat(quaternion): """ Create a copy of the Quaternion object. @@ -320,16 +276,6 @@ def Slerp(quat1, quat2, factor): @return: The interpolated rotation. """ -def Euler(list = None): - """ - Create a new euler object. - @type list: PyList of float/int - @param list: 3d list to initalize euler - @rtype: Euler object - @return: Euler representing heading, pitch, bank. - Values are in degrees. - """ - def CopyEuler(euler): """ Create a new euler object. @@ -365,6 +311,21 @@ class Vector: @cvar length: The magnitude of the vector. """ + def __init__(list = None): + """ + Create a new Vector object from a list. + + Example:: + v = Blender.Mathutils.Vector([1,0,0]) + @type list: PyList of float or int + @param list: The list of values for the Vector object. + Must be 2, 3, or 4 values. The list is mapped to the parameters as [x,y,z,w]. + @rtype: Vector object. + @return: It depends wheter a parameter was passed: + - (list): Vector object initialized with the given values; + - (): An empty 3 dimensional vector. + """ + def zero(): """ Set all values to zero. @@ -405,6 +366,19 @@ class Euler: @cvar z: The roll value in degrees. """ + def __init__(list = None): + """ + Create a new euler object. + + Example:: + euler = Euler([45,0,0]) + @type list: PyList of float/int + @param list: 3d list to initialize euler + @rtype: Euler object + @return: Euler representing heading, pitch, bank. + @note: Values are in degrees. + """ + def zero(): """ Set all values to zero. @@ -446,6 +420,25 @@ class Quaternion: in degrees. """ + def __init__(list, angle = None): + """ + Create a new quaternion object from initialized values. + + Example:: + quat = Mathutils.Quaternion([1.0,0.0,0.0]) + + @type list: PyList of int/float + @param list: A 3d or 4d list to initialize quaternion. + 4d if intializing [w,x,y,z], 3d if used as an axis of rotation. + @type angle: float (optional) + @param angle: An arbitrary rotation amount around 'list'. + List is used as an axis of rotation in this case. + @rtype: New quaternion object. + @return: It depends wheter a parameter was passed: + - (list/angle): Quaternion object initialized with the given values; + - (): An identity 4 dimensional quaternion. + """ + def identity(): """ Set the quaternion to the identity quaternion. @@ -496,6 +489,27 @@ class Matrix: @cvar colsize: The column size of the matrix. """ + def __init__(list1 = None, list2 = None, list3 = None, list4 = None): + """ + Create a new matrix object from initialized values. + + Example:: + matrix = Mathutils.Matrix([1,1,1],[0,1,0],[1,0,0]) + + @type list1: PyList of int/float + @param list1: A 2d,3d or 4d list. + @type list2: PyList of int/float + @param list2: A 2d,3d or 4d list. + @type list3: PyList of int/float + @param list3: A 2d,3d or 4d list. + @type list4: PyList of int/float + @param list4: A 2d,3d or 4d list. + @rtype: New matrix object. + @return: It depends wheter a parameter was passed: + - (list1, etc.): Matrix object initialized with the given values; + - (): An empty 3 dimensional matrix. + """ + def zero(): """ Set all matrix values to 0. @@ -513,22 +527,25 @@ class Matrix: def determinant(): """ - Return a the determinant of a matrix. + Return the determinant of a matrix. @rtype: int @return: Return a the determinant of a matrix. """ - def inverse(): + def invert(): """ Set the matrix to it's inverse. """ def rotationPart(): """ - Return the 3d rotation matrix. + Return the 3d submatrix corresponding to the linear term of the + embedded affine transformation in 3d. This matrix represents rotation + and scale. Note that the (4,4) element of a matrix can be used for uniform + scaling, too. @rtype: Matrix object. - @return: Return the 3d rotation matrix. + @return: Return the 3d matrix for rotation and scale. """ @@ -547,17 +564,17 @@ class Matrix: def toEuler(): """ - Return a euler representing the rotation matrix. + Return an Euler representation of the rotation matrix. @rtype: Euler object - @return: Return a euler representing the rotation matrix. + @return: Euler representation of the rotation matrix. """ def toQuat(): """ - Return a quaternion representation the rotation matrix + Return a quaternion representation of the rotation matrix @rtype: Quaternion object - @return: Quaternion representation the rotation matrix + @return: Quaternion representation of the rotation matrix """