Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillian Padovani Germano <wpgermano@gmail.com>2004-07-03 09:17:04 +0400
committerWillian Padovani Germano <wpgermano@gmail.com>2004-07-03 09:17:04 +0400
commit928282772051eadd29b26a43b4c217ebf06d0ba9 (patch)
tree36e2a9906ed924e962554df716d30f0ad1bce798 /source/blender/python/api2_2x/doc
parent90d4f7a3c1f6f789df61f348f974813a260014f5 (diff)
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.
Diffstat (limited to 'source/blender/python/api2_2x/doc')
-rw-r--r--source/blender/python/api2_2x/doc/BGL.py41
-rw-r--r--source/blender/python/api2_2x/doc/Blender.py65
-rw-r--r--source/blender/python/api2_2x/doc/Camera.py28
-rw-r--r--source/blender/python/api2_2x/doc/Draw.py2
-rw-r--r--source/blender/python/api2_2x/doc/Image.py2
-rw-r--r--source/blender/python/api2_2x/doc/Lamp.py28
-rw-r--r--source/blender/python/api2_2x/doc/Mathutils.py122
-rw-r--r--source/blender/python/api2_2x/doc/Object.py57
-rw-r--r--source/blender/python/api2_2x/doc/Scene.py23
-rw-r--r--source/blender/python/api2_2x/doc/Sys.py10
-rw-r--r--source/blender/python/api2_2x/doc/Window.py13
-rw-r--r--source/blender/python/api2_2x/doc/World.py47
12 files changed, 329 insertions, 109 deletions
diff --git a/source/blender/python/api2_2x/doc/BGL.py b/source/blender/python/api2_2x/doc/BGL.py
index dff399318ef..b9155b4cb7e 100644
--- a/source/blender/python/api2_2x/doc/BGL.py
+++ b/source/blender/python/api2_2x/doc/BGL.py
@@ -23,16 +23,27 @@ Example::
from Blender import Draw
R = G = B = 0
A = 1
- instructions = "Hold mouse buttons to change the background color."
+ title = "Testing BGL + Draw"
+ instructions = "Use mouse buttons or wheel to change the background color."
quitting = " Press ESC or q to quit."
+ len1 = Draw.GetStringWidth(title)
+ len2 = Draw.GetStringWidth(instructions + quitting)
#
def show_win():
glClearColor(R,G,B,A) # define color used to clear buffers
glClear(GL_COLOR_BUFFER_BIT) # use it to clear the color buffer
- glColor3f(1,1,1) # change default color
+ glColor3f(0.35,0.18,0.92) # define default color
+ glBegin(GL_POLYGON) # begin a vertex data list
+ glVertex2i(165, 158)
+ glVertex2i(252, 55)
+ glVertex2i(104, 128)
+ glEnd()
+ glColor3f(0.4,0.4,0.4) # change default color
+ glRecti(40, 96, 60+len1, 113)
+ glColor3f(1,1,1)
glRasterPos2i(50,100) # move cursor to x = 50, y = 100
- Draw.Text("Testing BGL + Draw") # draw this text there
- glRasterPos2i(350,20) # move cursor again
+ Draw.Text(title) # draw this text there
+ glRasterPos2i(350,40) # move cursor again
Draw.Text(instructions + quitting) # draw another msg
glBegin(GL_LINE_LOOP) # begin a vertex-data list
glVertex2i(46,92)
@@ -40,29 +51,29 @@ Example::
glVertex2i(120,115)
glVertex2i(46,115)
glEnd() # close this list
- glColor3f(0.35,0.18,0.92) # change default color again
- glBegin(GL_POLYGON) # another list, for a polygon
- glVertex2i(315, 292)
- glVertex2i(412, 200)
- glVertex2i(264, 256)
- glEnd()
- Draw.Redraw(1) # make changes visible.
#
- def ev(evt, val): # this is a callback for Draw.Register()
+ def ev(evt, val): # event callback for Draw.Register()
global R,G,B,A # ... it handles input events
if evt == Draw.ESCKEY or evt == Draw.QKEY:
Draw.Exit() # this quits the script
+ elif not val: return
elif evt == Draw.LEFTMOUSE: R = 1 - R
elif evt == Draw.MIDDLEMOUSE: G = 1 - G
elif evt == Draw.RIGHTMOUSE: B = 1 - B
+ elif evt == Draw.WHEELUPMOUSE:
+ R += 0.1
+ if R > 1: R = 1
+ elif evt == Draw.WHEELDOWNMOUSE:
+ R -= 0.1
+ if R < 0: R = 0
else:
- Draw.Register(show_win, ev, None)
+ return # don't redraw if nothing changed
+ Draw.Redraw(1) # make changes visible.
#
- Draw.Register(show_win, ev, None) # start the main loop
+ Draw.Register(show_win, ev, None) # start the main loop
@see: U{www.opengl.org}
@see: U{nehe.gamedev.net}
-
"""
def glAccum(op, value):
diff --git a/source/blender/python/api2_2x/doc/Blender.py b/source/blender/python/api2_2x/doc/Blender.py
index b595bfb9e49..eb048b65e31 100644
--- a/source/blender/python/api2_2x/doc/Blender.py
+++ b/source/blender/python/api2_2x/doc/Blender.py
@@ -4,14 +4,14 @@
# Doc system used: epydoc - http://epydoc.sf.net
# command line:
-# epydoc -o BPY_API_230 --url "http://www.blender.org" -t Blender.py \
+# epydoc -o BPY_API_23x --url "http://www.blender.org" -t Blender.py \
# -n "Blender" --no-private --no-frames Blender.py \
# Types.py Scene.py Object.py NMesh.py Material.py Camera.py Lamp.py \
# Armature.py Metaball.py Effect.py Curve.py Ipo.py World.py BGL.py Window.py \
# Draw.py Image.py Text.py Lattice.py Texture.py Registry.py Sys.py Mathutils.py
"""
-The main Blender module.
+The main Blender module (*).
The Blender Python API Reference
================================
@@ -23,30 +23,32 @@ The Blender Python API Reference
- L{Bone}
- L{NLA}
- L{BGL}
- - L{Camera}
+ - L{Camera} (*)
- L{Curve}
- - L{Draw}
+ - L{Draw} (*)
- L{Effect}
- - L{Image}
+ - L{Image} (*)
- L{Ipo}
- - L{Lamp}
+ - L{Lamp} (*)
- L{Lattice}
- L{Library}
- - L{Material}
+ - L{Material} (*)
- L{Mathutils}
- - L{Metaball}
+ - L{Metaball} (*)
- L{NMesh}
- L{Noise}
- - L{Object}
+ - L{Object} (*)
- L{Registry}
- - L{Scene}
+ - L{Scene} (*)
- L{Render}
- L{Text}
- L{Texture}
- L{Types}
- L{Window}
- - L{World}
- - L{sys<Sys>}
+ - L{World} (*)
+ - L{sys<Sys>} (*)
+
+ (*) - marks updated.
Introduction:
-------------
@@ -104,29 +106,54 @@ def Redraw ():
def Load (filename = None):
"""
- Load a Blender .blend file.
+ Load a Blender .blend file or any of the other supported file formats.
+
+ Supported formats:
+ - Blender's .blend;
+ - DXF;
+ - Open Inventor 1.0 ASCII;
+ - Radiogour;
+ - STL;
+ - Videoscape;
+ - VRML 1.0 asc.
+
@type filename: string
- @param filename: the pathname to the desired .blend file. If 'filename'
+ @param filename: the pathname to the desired file. If 'filename'
isn't given or if it contains the substring '.B.blend', the default
.B.blend file is loaded.
@warn: loading a new .blend file removes the current data in Blender. For
safety, this function saves the current data as an autosave file in
- the temporary dir used by Blender before loading the new file.
+ the temporary dir used by Blender before loading a new Blender file.
+ @warn: after a call to Load(blendfile), current data in Blender is lost,
+ including the Python dictionaries. Any posterior references in the
+ script to previously defined data will generate a NameError. So it's
+ better to put Blender.Load as the last executed command in the script,
+ when this function is used to open .blend files.
"""
def Save (filename, overwrite = 0):
"""
- Save a Blender .blend file with the current program data.
+ Save a Blender .blend file with the current program data or export to
+ one of the builtin file formats.
+
+ Supported formats:
+ - Blender (.blend);
+ - DXF (.dxf);
+ - STL (.stl);
+ - Videoscape (.obj);
+ - VRML 1.0 (.wrl).
+
@type filename: string
- @param filename: the pathname for the desired .blend file. If it doesn't
- contain ".blend", this extension is automatically appended.
+ @param filename: the filename for the file to be written. It must have one
+ of the supported extensions or an error will be returned.
@type overwrite: int (bool)
@param overwrite: if non-zero, file 'filename' will be overwritten if it
already exists. By default existing files are not overwritten (an error
is returned).
- @note: the substring ".B.blend" is not accepted inside 'filename'.
+ @note: The substring ".B.blend" is not accepted inside 'filename'.
+ @note: DXF, STL and Videoscape export only B{selected} meshes.
"""
def Quit ():
diff --git a/source/blender/python/api2_2x/doc/Camera.py b/source/blender/python/api2_2x/doc/Camera.py
index 77e2cf3830f..803d8ad025d 100644
--- a/source/blender/python/api2_2x/doc/Camera.py
+++ b/source/blender/python/api2_2x/doc/Camera.py
@@ -3,6 +3,8 @@
"""
The Blender.Camera submodule.
+B{New}: scriptLink methods: L{Camera.getScriptLinks}, ...
+
Camera Data
===========
@@ -178,3 +180,29 @@ class Camera:
@type drawsize: float
@param drawsize: The new draw size value.
"""
+
+ def getScriptLinks (event):
+ """
+ Get a list with this Camera's script links of type 'event'.
+ @type event: string
+ @param event: "FrameChanged" or "Redraw".
+ @rtype: list
+ @return: a list with Blender L{Text} names (the script links of the given
+ 'event' type) or None if there are no script links at all.
+ """
+
+ def clearScriptLinks ():
+ """
+ Delete all this Camera's script links.
+ @rtype: bool
+ @return: 0 if some internal problem occurred or 1 if successful.
+ """
+
+ def addScriptLink (text, event):
+ """
+ Add a new script link to this Camera.
+ @type text: string
+ @param text: the name of an existing Blender L{Text}.
+ @type event: string
+ @param event: "FrameChanged" or "Redraw".
+ """
diff --git a/source/blender/python/api2_2x/doc/Draw.py b/source/blender/python/api2_2x/doc/Draw.py
index aa95dbb2337..2efb40b4339 100644
--- a/source/blender/python/api2_2x/doc/Draw.py
+++ b/source/blender/python/api2_2x/doc/Draw.py
@@ -6,7 +6,7 @@ The Blender.Draw submodule.
Draw
====
-B{New}: L{PupIntInput}, L{PupFloatInput}, L{PupStrInput}.
+B{New}: L{PupIntInput}, L{PupFloatInput}, L{PupStrInput}, mouse wheel events.
This module provides access to a B{windowing interface} in Blender. Its widgets
include many kinds of buttons: push, toggle, menu, number, string, slider,
diff --git a/source/blender/python/api2_2x/doc/Image.py b/source/blender/python/api2_2x/doc/Image.py
index 4c8a525d513..bf4c25607b8 100644
--- a/source/blender/python/api2_2x/doc/Image.py
+++ b/source/blender/python/api2_2x/doc/Image.py
@@ -6,6 +6,8 @@ The Blender.Image submodule.
Image
=====
+B{New}: L{Image.reload}.
+
This module provides access to B{Image} objects in Blender.
Example::
diff --git a/source/blender/python/api2_2x/doc/Lamp.py b/source/blender/python/api2_2x/doc/Lamp.py
index 95f1d61a1eb..a120605117d 100644
--- a/source/blender/python/api2_2x/doc/Lamp.py
+++ b/source/blender/python/api2_2x/doc/Lamp.py
@@ -3,6 +3,8 @@
"""
The Blender.Lamp submodule.
+B{New}: scriptLink methods: L{Lamp.getScriptLinks}, ...
+
Lamp Data
=========
@@ -320,3 +322,29 @@ class Lamp:
@param quad2: The new quad 2 value.
@warning: this only applies to Lamps with the 'Quad' flag on.
"""
+
+ def getScriptLinks (event):
+ """
+ Get a list with this Lamp's script links of type 'event'.
+ @type event: string
+ @param event: "FrameChanged" or "Redraw".
+ @rtype: list
+ @return: a list with Blender L{Text} names (the script links of the given
+ 'event' type) or None if there are no script links at all.
+ """
+
+ def clearScriptLinks ():
+ """
+ Delete all this Lamp's script links.
+ @rtype: bool
+ @return: 0 if some internal problem occurred or 1 if successful.
+ """
+
+ def addScriptLink (text, event):
+ """
+ Add a new script link to this Lamp.
+ @type text: string
+ @param text: the name of an existing Blender L{Text}.
+ @type event: string
+ @param event: "FrameChanged" or "Redraw".
+ """
diff --git a/source/blender/python/api2_2x/doc/Mathutils.py b/source/blender/python/api2_2x/doc/Mathutils.py
index 238c4def84c..74f320639c5 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.
+ @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.
diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py
index a2a1ac824a0..8f1165d2f96 100644
--- a/source/blender/python/api2_2x/doc/Object.py
+++ b/source/blender/python/api2_2x/doc/Object.py
@@ -3,7 +3,12 @@
"""
The Blender.Object submodule
-This module provides access to the B{Object Data} in Blender.
+B{New}: L{Object.makeTrack}, scriptLink methods: L{Object.getScriptLinks}, ...
+
+Object
+======
+
+This module provides access to the B{Objects} in Blender.
Example::
@@ -522,3 +527,53 @@ class Object:
are not displayed correctly, try this method function. But if the script
works properly without it, there's no reason to use it.
"""
+
+ def getScriptLinks (event):
+ """
+ Get a list with this Object's script links of type 'event'.
+ @type event: string
+ @param event: "FrameChanged" or "Redraw".
+ @rtype: list
+ @return: a list with Blender L{Text} names (the script links of the given
+ 'event' type) or None if there are no script links at all.
+ """
+
+ def clearScriptLinks ():
+ """
+ Delete all this Object's script links.
+ @rtype: bool
+ @return: 0 if some internal problem occurred or 1 if successful.
+ """
+
+ def addScriptLink (text, event):
+ """
+ Add a new script link to this Object.
+ @type text: string
+ @param text: the name of an existing Blender L{Text}.
+ @type event: string
+ @param event: "FrameChanged" or "Redraw".
+ """
+
+ def makeTrack (tracked, fast = 0):
+ """
+ Make this Object track another.
+ @type tracked: Blender Object
+ @param tracked: the object to be tracked.
+ @type fast: int (bool)
+ @param fast: if zero, the scene hierarchy is updated automatically. If
+ you set 'fast' to a nonzero value, don't forget to update the scene
+ yourself (see L{Scene.Scene.update}).
+ @note: you also need to clear the rotation (L{setEuler}) of this object
+ if it was not (0,0,0) already.
+ """
+
+ def clearTrack (mode = 0, fast = 0):
+ """
+ Make this Object not track another anymore.
+ @type mode: int (bool)
+ @param mode: if nonzero the matrix transformation used for tracking is kept.
+ @type fast: int (bool)
+ @param fast: if zero, the scene hierarchy is updated automatically. If
+ you set 'fast' to a nonzero value, don't forget to update the scene
+ yourself (see L{Scene.Scene.update}).
+ """
diff --git a/source/blender/python/api2_2x/doc/Scene.py b/source/blender/python/api2_2x/doc/Scene.py
index 232ce33d567..1d84b95a229 100644
--- a/source/blender/python/api2_2x/doc/Scene.py
+++ b/source/blender/python/api2_2x/doc/Scene.py
@@ -3,7 +3,7 @@
"""
The Blender.Scene submodule.
-B{New}: scriptLink methods: L{Scene.getScriptLinks}, ...
+B{New}: L{Scene.play}, scriptLink methods: L{Scene.getScriptLinks}, ...
Scene
=====
@@ -219,3 +219,24 @@ class Scene:
@type event: string
@param event: "FrameChanged", "OnLoad" or "Redraw".
"""
+
+ def play (mode = 0, win = '<VIEW3D>'):
+ """
+ Play a realtime animation. This is the "Play Back Animation" function in
+ Blender, different from playing a sequence of rendered images (for that
+ check L{Render.RenderData.play}).
+ @type mode: int
+ @param mode: controls playing:
+ - 0: keep playing in the biggest 'win' window;
+ - 1: keep playing in all 'win', VIEW3D and SEQ windows;
+ - 2: play once in the biggest VIEW3D;
+ - 3: play once in all 'win', VIEW3D and SEQ windows.
+ @type win: int
+ @param win: window type, see L{Window.Types}. Only some of them are
+ meaningful here: VIEW3D, SEQ, IPO, ACTION, NLA, SOUND. But the others
+ are also accepted, since this function can be used simply as an
+ interruptible timer. If 'win' is not visible or invalid, VIEW3D is
+ tried, then any bigger visible window.
+ @rtype: bool
+ @return: 0 on normal exit or 1 when play back is canceled by user input.
+ """
diff --git a/source/blender/python/api2_2x/doc/Sys.py b/source/blender/python/api2_2x/doc/Sys.py
index 47367d86c18..7908e6df0b8 100644
--- a/source/blender/python/api2_2x/doc/Sys.py
+++ b/source/blender/python/api2_2x/doc/Sys.py
@@ -114,14 +114,18 @@ def makename (path = "Blender.Get('filename')", ext = "", strip = 0):
def exists(path):
"""
Tell if the given pathname (file or dir) exists.
- @rtype: bool
- @return: 1 if 'path' exists, 0 otherwise.
+ @rtype: int
+ @return:
+ - 0: path does not exist;
+ - 1: path is an existing filename;
+ - 2: path is an existing dirname;
+ - -1: path exists but is neither a regular file nor a dir.
"""
def time ():
"""
Get the current time in seconds since a fixed value. Successive calls to
- this function are garanteed to return values greater than the previous call.
+ this function are guaranteed to return values greater than the previous call.
@rtype: float
@return: the elapsed time in seconds.
"""
diff --git a/source/blender/python/api2_2x/doc/Window.py b/source/blender/python/api2_2x/doc/Window.py
index 8c87f83b48c..a4bbab9e410 100644
--- a/source/blender/python/api2_2x/doc/Window.py
+++ b/source/blender/python/api2_2x/doc/Window.py
@@ -55,19 +55,20 @@ DrawProgressBar::
@type Types: readonly dictionary
@var Types: The available Window Types.
- - VIEW3D
- - IPO
- - OOPS
+ - ACTION
- BUTS
- FILE
- IMAGE
+ - IMASEL
- INFO
+ - IPO
+ - NLA
+ - OOPS
+ - SCRIPT
- SEQ
- - IMASEL
- SOUND
- - ACTION
- TEXT
- - NLA
+ - VIEW3D
"""
def Redraw ():
diff --git a/source/blender/python/api2_2x/doc/World.py b/source/blender/python/api2_2x/doc/World.py
index 625f0432212..3b133deec5d 100644
--- a/source/blender/python/api2_2x/doc/World.py
+++ b/source/blender/python/api2_2x/doc/World.py
@@ -3,7 +3,10 @@
"""
The Blender.World submodule
+B{New}: scriptLink methods: L{World.getScriptLinks}, ...
+
INTRODUCTION
+============
The module world allows you to access all the data of a Blender World.
@@ -80,7 +83,7 @@ class World:
def getName():
"""
- Retreives the name of an world object
+ Retrieves the name of an world object
@rtype: string
@return: the name of the world object.
"""
@@ -116,7 +119,7 @@ class World:
def getSkytype():
"""
- Retreives the skytype of a world object.
+ Retrieves the skytype of a world object.
The skytype is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
@rtype: int
@return: the skytype of the world object.
@@ -135,7 +138,7 @@ class World:
def getMode():
"""
- Retreives the mode of a world object.
+ Retrieves the mode of a world object.
The mode is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
@rtype: int
@return: the mode of the world object.
@@ -154,7 +157,7 @@ class World:
def getMistype():
"""
- Retreives the mist type of a world object.
+ Retrieves the mist type of a world object.
The mist type is an integer 0 : quadratic; 1 : linear; 2 : square.
@rtype: int
@return: the mistype of the world object.
@@ -173,7 +176,7 @@ class World:
def getHor():
"""
- Retreives the horizon color of a world object.
+ Retrieves the horizon color of a world object.
This color is a list of 3 floats.
@rtype: list of three floats
@return: the horizon color of the world object.
@@ -191,7 +194,7 @@ class World:
def getZen():
"""
- Retreives the zenith color of a world object.
+ Retrieves the zenith color of a world object.
This color is a list of 3 floats.
@rtype: list of three floats
@return: the zenith color of the world object.
@@ -209,7 +212,7 @@ class World:
def getAmb():
"""
- Retreives the ambient color of a world object.
+ Retrieves the ambient color of a world object.
This color is a list of 3 floats.
@rtype: list of three floats
@return: the ambient color of the world object.
@@ -227,7 +230,7 @@ class World:
def getStar():
"""
- Retreives the star parameters of a world object.
+ Retrieves the star parameters of a world object.
It is a list of nine floats :
red component of the color
green component of the color
@@ -253,7 +256,7 @@ class World:
def getMist():
"""
- Retreives the mist parameters of a world object.
+ Retrieves the mist parameters of a world object.
It is a list of four floats :
intensity of the mist
start of the mist
@@ -273,3 +276,29 @@ class World:
@rtype: PyNone
@return: PyNone
"""
+
+ def getScriptLinks (event):
+ """
+ Get a list with this World's script links of type 'event'.
+ @type event: string
+ @param event: "FrameChanged" or "Redraw".
+ @rtype: list
+ @return: a list with Blender L{Text} names (the script links of the given
+ 'event' type) or None if there are no script links at all.
+ """
+
+ def clearScriptLinks ():
+ """
+ Delete all this World's script links!
+ @rtype: bool
+ @return: 0 if some internal problem occurred or 1 if successful.
+ """
+
+ def addScriptLink (text, event):
+ """
+ Add a new script link to this World.
+ @type text: string
+ @param text: the name of an existing Blender L{Text}.
+ @type event: string
+ @param event: "FrameChanged" or "Redraw".
+ """