New scripts:

- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)

  Thanks to them for the new contributions!

  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)

BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".

The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
This commit is contained in:
2004-07-03 05:17:04 +00:00
parent 90d4f7a3c1
commit 9282827720
34 changed files with 2780 additions and 478 deletions

View File

@@ -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.
@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 = None, angle = None):
"""
Create a new quaternion object from initialized values.
Example::
quat = Mathutils.Quaternion()
@type list: PyList of int/float
@param list: A 3d or 4d list to initialize 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 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.