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:
@@ -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}).
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user