39
39
@param low: The lower range.
42
def Vector (list = None):
44
Create a new Vector object from a list.
45
@type list: PyList of float or int
46
@param list: The list of values for the Vector object.
47
Must be 2, 3, or 4 values.
48
@rtype: Vector object.
49
@return: It depends wheter a parameter was passed:
50
- (list): Vector object initialized with the given values;
51
- (): An empty 3 dimensional vector.
54
42
def CopyVec(vector):
56
44
Create a copy of the Vector object.
128
116
@return: The parallel projection vector.
131
def Matrix(list1 = None, list2 = None, list3 = None, list4 = None):
133
Create a new matrix object from intialized values.
134
@type list1: PyList of int/float
135
@param list1: A 2d,3d or 4d list.
136
@type list2: PyList of int/float
137
@param list2: A 2d,3d or 4d list.
138
@type list3: PyList of int/float
139
@param list3: A 2d,3d or 4d list.
140
@type list4: PyList of int/float
141
@param list4: A 2d,3d or 4d list.
142
@rtype: New matrix object.
143
@return: It depends wheter a parameter was passed:
144
- (list1, etc.): Matrix object initialized with the given values;
145
- (): An empty 3 dimensional matrix.
148
119
def RotationMatrix(angle, matSize, axisFlag, axis):
150
121
Create a matrix representing a rotation.
248
219
@return: The column vector that results from the muliplication.
251
def Quaternion(list = None, angle = None):
253
Create a new matrix object from intialized values.
254
@type list: PyList of int/float
255
@param list: A 3d or 4d list to intialize quaternion.
256
4d if intializing, 3d if will be used as an axis of rotation.
257
@type angle: float (optional)
258
@param angle: An arbitrary rotation amount around 'list'.
259
List is used as an axis of rotation in this case.
260
@rtype: New quaternion object.
261
@return: It depends wheter a parameter was passed:
262
- (list/angle): Quaternion object initialized with the given values;
263
- (): An identity 4 dimensional quaternion.
266
222
def CopyQuat(quaternion):
268
224
Create a copy of the Quaternion object.
320
276
@return: The interpolated rotation.
323
def Euler(list = None):
325
Create a new euler object.
326
@type list: PyList of float/int
327
@param list: 3d list to initalize euler
329
@return: Euler representing heading, pitch, bank.
330
Values are in degrees.
333
279
def CopyEuler(euler):
335
281
Create a new euler object.
358
304
The Vector object
359
305
=================
360
306
This object gives access to Vectors in Blender.
361
@cvar x: The x value.
362
@cvar y: The y value.
363
@cvar z: The z value (if any).
364
@cvar w: The w value (if any).
365
@cvar length: The magnitude of the vector.
307
@ivar x: The x value.
308
@ivar y: The y value.
309
@ivar z: The z value (if any).
310
@ivar w: The w value (if any).
311
@ivar length: The magnitude of the vector.
314
def __init__(list = None):
316
Create a new Vector object from a list.
319
v = Blender.Mathutils.Vector([1,0,0])
320
@type list: PyList of float or int
321
@param list: The list of values for the Vector object.
322
Must be 2, 3, or 4 values. The list is mapped to the parameters as [x,y,z,w].
323
@rtype: Vector object.
324
@return: It depends wheter a parameter was passed:
325
- (list): Vector object initialized with the given values;
326
- (): An empty 3 dimensional vector.
370
331
Set all values to zero.
402
363
This object gives access to Eulers in Blender.
403
@cvar x: The heading value in degrees.
404
@cvar y: The pitch value in degrees.
405
@cvar z: The roll value in degrees.
364
@ivar x: The heading value in degrees.
365
@ivar y: The pitch value in degrees.
366
@ivar z: The roll value in degrees.
369
def __init__(list = None):
371
Create a new euler object.
374
euler = Euler([45,0,0])
375
@type list: PyList of float/int
376
@param list: 3d list to initialize euler
378
@return: Euler representing heading, pitch, bank.
379
@note: Values are in degrees.
410
384
Set all values to zero.
436
410
The Quaternion object
437
411
=====================
438
412
This object gives access to Quaternions in Blender.
439
@cvar w: The w value.
440
@cvar x: The x value.
441
@cvar y: The y value.
442
@cvar z: The z value.
443
@cvar magnitude: The magnitude of the quaternion.
444
@cvar axis: Vector representing the axis of rotation.
445
@cvar angle: A scalar representing the amount of rotation
413
@ivar w: The w value.
414
@ivar x: The x value.
415
@ivar y: The y value.
416
@ivar z: The z value.
417
@ivar magnitude: The magnitude of the quaternion.
418
@ivar axis: Vector representing the axis of rotation.
419
@ivar angle: A scalar representing the amount of rotation
423
def __init__(list, angle = None):
425
Create a new quaternion object from initialized values.
428
quat = Mathutils.Quaternion([1.0,0.0,0.0])
430
@type list: PyList of int/float
431
@param list: A 3d or 4d list to initialize quaternion.
432
4d if intializing [w,x,y,z], 3d if used as an axis of rotation.
433
@type angle: float (optional)
434
@param angle: An arbitrary rotation amount around 'list'.
435
List is used as an axis of rotation in this case.
436
@rtype: New quaternion object.
437
@return: It depends wheter a parameter was passed:
438
- (list/angle): Quaternion object initialized with the given values;
439
- (): An identity 4 dimensional quaternion.
451
444
Set the quaternion to the identity quaternion.
492
485
The Matrix Object
493
486
=================
494
487
This object gives access to Matrices in Blender.
495
@cvar rowsize: The row size of the matrix.
496
@cvar colsize: The column size of the matrix.
488
@ivar rowsize: The row size of the matrix.
489
@ivar colsize: The column size of the matrix.
492
def __init__(list1 = None, list2 = None, list3 = None, list4 = None):
494
Create a new matrix object from initialized values.
497
matrix = Mathutils.Matrix([1,1,1],[0,1,0],[1,0,0])
499
@type list1: PyList of int/float
500
@param list1: A 2d,3d or 4d list.
501
@type list2: PyList of int/float
502
@param list2: A 2d,3d or 4d list.
503
@type list3: PyList of int/float
504
@param list3: A 2d,3d or 4d list.
505
@type list4: PyList of int/float
506
@param list4: A 2d,3d or 4d list.
507
@rtype: New matrix object.
508
@return: It depends wheter a parameter was passed:
509
- (list1, etc.): Matrix object initialized with the given values;
510
- (): An empty 3 dimensional matrix.
501
515
Set all matrix values to 0.
514
528
def determinant():
516
Return a the determinant of a matrix.
530
Return the determinant of a matrix.
518
532
@return: Return a the determinant of a matrix.
524
538
Set the matrix to it's inverse.
527
541
def rotationPart():
529
Return the 3d rotation matrix.
543
Return the 3d submatrix corresponding to the linear term of the
544
embedded affine transformation in 3d. This matrix represents rotation
545
and scale. Note that the (4,4) element of a matrix can be used for uniform
530
547
@rtype: Matrix object.
531
@return: Return the 3d rotation matrix.
548
@return: Return the 3d matrix for rotation and scale.
550
Return a euler representing the rotation matrix.
567
Return an Euler representation of the rotation matrix.
551
568
@rtype: Euler object
552
@return: Return a euler representing the rotation matrix.
569
@return: Euler representation of the rotation matrix.
558
Return a quaternion representation the rotation matrix
575
Return a quaternion representation of the rotation matrix
559
576
@rtype: Quaternion object
560
@return: Quaternion representation the rotation matrix
577
@return: Quaternion representation of the rotation matrix