2003-06-28 15:10:23 +00:00
|
|
|
# Blender.Object module and the Object PyType object
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
The Blender.Object submodule
|
|
|
|
|
|
2005-04-21 19:44:52 +00:00
|
|
|
B{New}:
|
2005-11-17 18:35:11 +00:00
|
|
|
- Objects now increment the Blender user count when they are created and
|
|
|
|
|
decremented it when they are destroyed. This means Python scripts can
|
|
|
|
|
keep the object "alive" if it is deleted in the Blender GUI.
|
2005-10-04 15:17:27 +00:00
|
|
|
- L{Object.getData} now accepts two optional bool keyword argument to
|
|
|
|
|
define (1) if the user wants the data object or just its name
|
|
|
|
|
and (2) if a mesh object should use NMesh or Mesh.
|
2005-04-21 19:44:52 +00:00
|
|
|
- L{Object.clearScriptLinks} accepts a parameter now.
|
|
|
|
|
- Object attributes: renamed Layer to L{Layers<Object.Object.Layers>} and
|
|
|
|
|
added the easier L{layers<Object.Object.layers>}. The old form "Layer"
|
|
|
|
|
will continue to work.
|
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.
2004-07-03 05:17:04 +00:00
|
|
|
|
2006-04-27 12:32:44 +00:00
|
|
|
|
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.
2004-07-03 05:17:04 +00:00
|
|
|
Object
|
|
|
|
|
======
|
|
|
|
|
|
|
|
|
|
This module provides access to the B{Objects} in Blender.
|
2003-06-28 15:10:23 +00:00
|
|
|
|
|
|
|
|
Example::
|
|
|
|
|
|
|
|
|
|
import Blender
|
2004-01-03 03:50:58 +00:00
|
|
|
scene = Blender.Scene.getCurrent () # get the current scene
|
2003-06-28 15:10:23 +00:00
|
|
|
ob = Blender.Object.New ('Camera') # make camera object
|
|
|
|
|
cam = Blender.Camera.New ('ortho') # make ortho camera data object
|
|
|
|
|
ob.link (cam) # link camera data with the object
|
|
|
|
|
scene.link (ob) # link the object into the scene
|
|
|
|
|
ob.setLocation (0.0, -5.0, 1.0) # position the object in the scene
|
2003-08-06 22:08:56 +00:00
|
|
|
|
|
|
|
|
Blender.Redraw() # redraw the scene to show the updates.
|
2003-06-28 15:10:23 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def New (type, name='type'):
|
|
|
|
|
"""
|
|
|
|
|
Creates a new Object.
|
|
|
|
|
@type type: string
|
2005-12-29 10:33:00 +00:00
|
|
|
@param type: The Object type: 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice',
|
|
|
|
|
'Mball', 'Mesh', 'Surf' or 'Empty'.
|
2003-06-28 15:10:23 +00:00
|
|
|
@type name: string
|
2003-07-12 18:21:07 +00:00
|
|
|
@param name: The name of the object. By default, the name will be the same
|
|
|
|
|
as the object type.
|
2005-12-29 10:33:00 +00:00
|
|
|
If the name is alredy in use, this new object will have a number at the end of the name.
|
2003-06-28 15:10:23 +00:00
|
|
|
@return: The created Object.
|
2003-08-06 22:08:56 +00:00
|
|
|
|
|
|
|
|
I{B{Example:}}
|
|
|
|
|
|
|
|
|
|
The example below creates a new Lamp object and puts it at the default
|
|
|
|
|
location (0, 0, 0) in the current scene::
|
2004-06-08 04:41:02 +00:00
|
|
|
import Blender
|
|
|
|
|
|
2005-12-29 10:33:00 +00:00
|
|
|
object = Blender.Object.New('Lamp')
|
|
|
|
|
lamp = Blender.Lamp.New('Spot')
|
|
|
|
|
object.link(lamp)
|
|
|
|
|
scene = Blender.Scene.GetCurrent()
|
|
|
|
|
scene.link(object)
|
2004-06-08 04:41:02 +00:00
|
|
|
|
|
|
|
|
Blender.Redraw()
|
2003-06-28 15:10:23 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def Get (name = None):
|
|
|
|
|
"""
|
|
|
|
|
Get the Object from Blender.
|
|
|
|
|
@type name: string
|
|
|
|
|
@param name: The name of the requested Object.
|
|
|
|
|
@return: It depends on the 'name' parameter:
|
|
|
|
|
- (name): The Object with the given name;
|
|
|
|
|
- (): A list with all Objects in the current scene.
|
2003-08-06 22:08:56 +00:00
|
|
|
|
|
|
|
|
I{B{Example 1:}}
|
|
|
|
|
|
2005-12-29 10:33:00 +00:00
|
|
|
The example below works on the default scene. The script returns the plane object and prints the location of the plane::
|
2003-08-06 22:08:56 +00:00
|
|
|
import Blender
|
|
|
|
|
|
|
|
|
|
object = Blender.Object.Get ('plane')
|
|
|
|
|
print object.getLocation()
|
|
|
|
|
|
|
|
|
|
I{B{Example 2:}}
|
|
|
|
|
|
|
|
|
|
The example below works on the default scene. The script returns all objects
|
|
|
|
|
in the scene and prints the list of object names::
|
|
|
|
|
import Blender
|
|
|
|
|
|
|
|
|
|
objects = Blender.Object.Get ()
|
|
|
|
|
print objects
|
2005-12-29 10:33:00 +00:00
|
|
|
@note: Get will return objects from all scenes.
|
|
|
|
|
Most user tools should only operate on objects from the current scene - Blender.Scene.GetCurrent().getChildren()
|
2003-06-28 15:10:23 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def GetSelected ():
|
|
|
|
|
"""
|
2006-01-04 15:11:35 +00:00
|
|
|
Get the user selection. If no objects are selected, an empty list will be returned.
|
|
|
|
|
|
2003-06-28 15:10:23 +00:00
|
|
|
@return: A list of all selected Objects in the current scene.
|
2003-08-06 22:08:56 +00:00
|
|
|
|
|
|
|
|
I{B{Example:}}
|
|
|
|
|
|
|
|
|
|
The example below works on the default scene. Select one or more objects and
|
|
|
|
|
the script will print the selected objects::
|
|
|
|
|
import Blender
|
|
|
|
|
|
2005-12-29 10:33:00 +00:00
|
|
|
objects = Blender.Object.GetSelected()
|
2003-08-06 22:08:56 +00:00
|
|
|
print objects
|
2006-01-04 15:11:35 +00:00
|
|
|
@note: The active object will always be the first object in the list (if selected).
|
|
|
|
|
@note: The user selection is made up of selected objects from Blenders current scene.
|
|
|
|
|
@note: The user selection is limited to objects on visible layers,
|
|
|
|
|
if the users last active 3d view is in localview then the selection will be limited to the objects in that localview.
|
2003-06-28 15:10:23 +00:00
|
|
|
"""
|
|
|
|
|
|
2005-12-30 11:54:53 +00:00
|
|
|
|
2006-01-02 10:40:13 +00:00
|
|
|
def Duplicate (mesh=0, surface=0, curve=0, text=0, metaball=0, armature=0, lamp=0, material=0, texture=0, ipo=0):
|
2005-12-30 11:54:53 +00:00
|
|
|
"""
|
2006-01-02 10:40:13 +00:00
|
|
|
Duplicate selected objects on visible layers from Blenders current scene,
|
|
|
|
|
de-selecting the currently visible, selected objects and making a copy where all new objects are selected.
|
2006-01-31 22:18:07 +00:00
|
|
|
By default no data linked to the object is duplicated; use the keyword arguments to change this.
|
|
|
|
|
L{Object.GetSelected()<GetSelected>} will return the list of objects resulting from duplication.
|
2005-12-30 11:54:53 +00:00
|
|
|
|
2006-01-02 10:40:13 +00:00
|
|
|
@type mesh: bool
|
2006-01-31 22:18:07 +00:00
|
|
|
@param mesh: When non-zero, mesh object data will be duplicated with the objects.
|
2006-01-02 10:40:13 +00:00
|
|
|
@type surface: bool
|
2006-01-31 22:18:07 +00:00
|
|
|
@param surface: When non-zero, surface object data will be duplicated with the objects.
|
2006-01-02 10:40:13 +00:00
|
|
|
@type curve: bool
|
2006-01-31 22:18:07 +00:00
|
|
|
@param curve: When non-zero, curve object data will be duplicated with the objects.
|
2006-01-02 10:40:13 +00:00
|
|
|
@type text: bool
|
2006-01-31 22:18:07 +00:00
|
|
|
@param text: When non-zero, text object data will be duplicated with the objects.
|
2006-01-02 10:40:13 +00:00
|
|
|
@type metaball: bool
|
2006-01-31 22:18:07 +00:00
|
|
|
@param metaball: When non-zero, metaball object data will be duplicated with the objects.
|
2006-01-02 10:40:13 +00:00
|
|
|
@type armature: bool
|
2006-01-31 22:18:07 +00:00
|
|
|
@param armature: When non-zero, armature object data will be duplicated with the objects.
|
2006-01-02 10:40:13 +00:00
|
|
|
@type lamp: bool
|
2006-01-31 22:18:07 +00:00
|
|
|
@param lamp: When non-zero, lamp object data will be duplicated with the objects.
|
2006-01-02 10:40:13 +00:00
|
|
|
@type material: bool
|
2006-01-31 22:18:07 +00:00
|
|
|
@param material: When non-zero, materials used by the object or its object data will be duplicated with the objects.
|
2006-01-02 10:40:13 +00:00
|
|
|
@type texture: bool
|
2006-01-31 22:18:07 +00:00
|
|
|
@param texture: When non-zero, texture data used by the object's materials will be duplicated with the objects.
|
2006-01-02 10:40:13 +00:00
|
|
|
@type ipo: bool
|
2006-01-31 22:18:07 +00:00
|
|
|
@param ipo: When non-zero, Ipo data linked to the object will be duplicated with the objects.
|
2005-12-30 11:54:53 +00:00
|
|
|
|
|
|
|
|
I{B{Example:}}
|
|
|
|
|
|
|
|
|
|
The example below creates duplicates the active object 10 times
|
|
|
|
|
and moves each object 1.0 on the X axis::
|
|
|
|
|
import Blender
|
|
|
|
|
|
|
|
|
|
scn = Scene.GetCurrent()
|
|
|
|
|
activeObject = scn.getActiveObject()
|
|
|
|
|
|
|
|
|
|
# Unselect all
|
|
|
|
|
for ob in Blender.Object.GetSelected():
|
|
|
|
|
ob.sel = 0
|
|
|
|
|
activeObject.sel = 1
|
|
|
|
|
|
|
|
|
|
for x in xrange(10):
|
2006-01-02 10:40:13 +00:00
|
|
|
Blender.Object.Duplicate() # Duplicate linked
|
2005-12-30 11:54:53 +00:00
|
|
|
activeObject = scn.getActiveObject()
|
|
|
|
|
activeObject.LocX += 1
|
|
|
|
|
Blender.Redraw()
|
|
|
|
|
"""
|
2005-12-30 14:17:15 +00:00
|
|
|
|
2003-06-28 15:10:23 +00:00
|
|
|
class Object:
|
|
|
|
|
"""
|
|
|
|
|
The Object object
|
|
|
|
|
=================
|
2006-04-27 12:32:44 +00:00
|
|
|
This object gives access to generic data from all objects in Blender.
|
|
|
|
|
|
|
|
|
|
B{Note}:
|
|
|
|
|
When dealing with properties and functions such as LocX/RotY/getLocation(), getSize() and getEuler()
|
|
|
|
|
Keep in mind that these transformation properties are relative to the objects parent (if any).
|
|
|
|
|
|
|
|
|
|
To get these values in worldspace (taking into acount vertex parents, constraints etc)
|
2006-05-07 08:12:18 +00:00
|
|
|
pass the argument 'worldspace' to these functions.
|
2006-04-27 12:32:44 +00:00
|
|
|
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar LocX: The X location coordinate of the object.
|
|
|
|
|
@ivar LocY: The Y location coordinate of the object.
|
|
|
|
|
@ivar LocZ: The Z location coordinate of the object.
|
|
|
|
|
@ivar loc: The (X,Y,Z) location coordinates of the object (vector).
|
|
|
|
|
@ivar dLocX: The delta X location coordinate of the object.
|
2003-08-06 22:08:56 +00:00
|
|
|
This variable applies to IPO Objects only.
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar dLocY: The delta Y location coordinate of the object.
|
2003-08-06 22:08:56 +00:00
|
|
|
This variable applies to IPO Objects only.
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar dLocZ: The delta Z location coordinate of the object.
|
2003-08-06 22:08:56 +00:00
|
|
|
This variable applies to IPO Objects only.
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar dloc: The delta (X,Y,Z) location coordinates of the object (vector).
|
2003-08-06 22:08:56 +00:00
|
|
|
This variable applies to IPO Objects only.
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar RotX: The X rotation angle (in radians) of the object.
|
|
|
|
|
@ivar RotY: The Y rotation angle (in radians) of the object.
|
|
|
|
|
@ivar RotZ: The Z rotation angle (in radians) of the object.
|
|
|
|
|
@ivar rot: The (X,Y,Z) rotation angles (in radians) of the object (vector).
|
|
|
|
|
@ivar dRotX: The delta X rotation angle (in radians) of the object.
|
2003-08-06 22:08:56 +00:00
|
|
|
This variable applies to IPO Objects only.
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar dRotY: The delta Y rotation angle (in radians) of the object.
|
2003-08-06 22:08:56 +00:00
|
|
|
This variable applies to IPO Objects only.
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar dRotZ: The delta Z rotation angle (in radians) of the object.
|
2003-08-06 22:08:56 +00:00
|
|
|
This variable applies to IPO Objects only.
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar drot: The delta (X,Y,Z) rotation angles (in radians) of the object
|
2003-07-12 18:21:07 +00:00
|
|
|
(vector).
|
2003-08-06 22:08:56 +00:00
|
|
|
This variable applies to IPO Objects only.
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar SizeX: The X size of the object.
|
|
|
|
|
@ivar SizeY: The Y size of the object.
|
|
|
|
|
@ivar SizeZ: The Z size of the object.
|
|
|
|
|
@ivar size: The (X,Y,Z) size of the object (vector).
|
|
|
|
|
@ivar dSizeX: The delta X size of the object.
|
|
|
|
|
@ivar dSizeY: The delta Y size of the object.
|
|
|
|
|
@ivar dSizeZ: The delta Z size of the object.
|
|
|
|
|
@ivar dsize: The delta (X,Y,Z) size of the object.
|
2005-04-21 19:44:52 +00:00
|
|
|
@type Layers: integer (bitmask)
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar Layers: The object layers (also check the newer attribute
|
2005-10-11 15:11:39 +00:00
|
|
|
L{layers<layers>}). This value is a bitmask with at
|
2005-04-21 19:44:52 +00:00
|
|
|
least one position set for the 20 possible layers starting from the low
|
|
|
|
|
order bit. The easiest way to deal with these values in in hexadecimal
|
|
|
|
|
notation.
|
2004-06-08 04:41:02 +00:00
|
|
|
Example::
|
|
|
|
|
ob.Layer = 0x04 # sets layer 3 ( bit pattern 0100 )
|
|
|
|
|
After setting the Layer value, call Blender.Redraw( -1 ) to update
|
|
|
|
|
the interface.
|
2005-04-21 19:44:52 +00:00
|
|
|
@type layers: list of integers
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar layers: The layers this object is visible in (also check the older
|
2005-10-11 15:11:39 +00:00
|
|
|
attribute L{Layers<Layers>}). This returns a list of
|
2005-04-21 19:44:52 +00:00
|
|
|
integers in the range [1, 20], each number representing the respective
|
|
|
|
|
layer. Setting is done by passing a list of ints or an empty list for
|
|
|
|
|
no layers.
|
|
|
|
|
Example::
|
|
|
|
|
ob.layers = [] # object won't be visible
|
|
|
|
|
ob.layers = [1, 4] # object visible only in layers 1 and 4
|
|
|
|
|
ls = o.layers
|
|
|
|
|
ls.append([10])
|
|
|
|
|
o.layers = ls
|
|
|
|
|
print ob.layers # will print: [1, 4, 10]
|
|
|
|
|
B{Note}: changes will only be visible after the screen (at least
|
|
|
|
|
the 3d View and Buttons windows) is redrawn.
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar parent: The parent object of the object. (Read-only)
|
|
|
|
|
@ivar track: The object tracking this object. (Read-only)
|
|
|
|
|
@ivar data: The data of the object. (Read-only)
|
|
|
|
|
@ivar ipo: The ipo data associated with the object. (Read-only)
|
2005-11-08 17:23:20 +00:00
|
|
|
@ivar mat: alias for L{matrix<Object.Object.matrix>}: the matrix of the object in world space. (Read-only)
|
|
|
|
|
@ivar matrix: The matrix of the object in world space, same as L{matrixWorld<Object.Object.matrixWorld>}. (Read-only)
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar matrixLocal: The matrix of the object relative to its parent. (Read-only)
|
|
|
|
|
@ivar matrixWorld: The matrix of the object in world space. (Read-only)
|
|
|
|
|
@ivar colbits: The Material usage mask. A set bit #n means: the Material
|
2003-07-12 18:21:07 +00:00
|
|
|
#n in the Object's material list is used. Otherwise, the Material #n
|
|
|
|
|
of the Objects Data material list is displayed.
|
2005-10-21 17:20:54 +00:00
|
|
|
Example::
|
|
|
|
|
object.colbits = 0x21 # use mesh materials 0 (0x01) and 5 (0x20)
|
|
|
|
|
# use object materials for all others
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar drawType: The object's drawing type used. 1 - Bounding box,
|
2003-07-12 18:21:07 +00:00
|
|
|
2 - wire, 3 - Solid, 4- Shaded, 5 - Textured.
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar drawMode: The object's drawing mode used. The value can be a sum
|
2003-07-12 18:21:07 +00:00
|
|
|
of: 2 - axis, 4 - texspace, 8 - drawname, 16 - drawimage,
|
2006-04-25 13:01:19 +00:00
|
|
|
32 - drawwire, 64 - xray.
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar name: The name of the object.
|
2005-12-29 10:33:00 +00:00
|
|
|
@ivar sel: The selection state of the object in the current scene, 1 is selected, 0 is unselected. (Selecting makes the object active)
|
2005-11-06 22:29:49 +00:00
|
|
|
@ivar effects: The list of particle effects associated with the object. (Read-only)
|
2005-11-15 21:33:29 +00:00
|
|
|
@ivar parentbonename: The string name of the parent bone.
|
2006-03-24 08:36:39 +00:00
|
|
|
@ivar users: The number of users of the object. (Read-only)
|
2005-11-17 18:35:11 +00:00
|
|
|
@type users: int
|
2005-11-18 19:44:44 +00:00
|
|
|
@ivar protectFlags: The "transform locking" bitfield flags for the object.
|
|
|
|
|
Setting bits lock the following attributes:
|
2005-12-29 10:33:00 +00:00
|
|
|
- bit 0: X location
|
|
|
|
|
- bit 1: Y location
|
|
|
|
|
- bit 2: Z location
|
|
|
|
|
- bit 3: X rotation
|
|
|
|
|
- bit 4: Y rotation
|
|
|
|
|
- bit 5: Z rotation
|
|
|
|
|
- bit 6: X size
|
|
|
|
|
- bit 7: Y size
|
|
|
|
|
- bit 8: Z size
|
2005-11-18 19:44:44 +00:00
|
|
|
@type protectFlags: int
|
2006-03-24 08:36:39 +00:00
|
|
|
@ivar DupGroup: The DupliGroup Animation Property.
|
|
|
|
|
Assign a group to DupGroup to make this object an instance of that group.
|
|
|
|
|
This does not enable or disable the dupliGroup option, for that use
|
2006-03-18 17:24:59 +00:00
|
|
|
getDupliGroup and setDupliGroup.
|
|
|
|
|
The dupliGroup is None when this object does not have a dupliGroup.
|
2006-03-24 08:36:39 +00:00
|
|
|
(Use with L{enableDupGroup<enableDupGroup>})
|
|
|
|
|
@type DupGroup: Group or None
|
|
|
|
|
@ivar DupObjects: The Dupli object instances. Returns of list of tuples for object duplicated
|
|
|
|
|
by dupliframe, dupliverts dupligroups and other animation properties.
|
|
|
|
|
The first item is the original object that is duplicated
|
|
|
|
|
the second is the 4x4 worldspace dupli-matrix.
|
|
|
|
|
Example::
|
|
|
|
|
import Blender
|
|
|
|
|
from Blender import Object, Scene, Mathutils
|
|
|
|
|
|
|
|
|
|
ob= Object.Get('Cube')
|
2006-04-18 15:37:32 +00:00
|
|
|
dupe_obs= ob.DupObjects
|
2006-03-24 08:36:39 +00:00
|
|
|
scn= Scene.GetCurrent()
|
|
|
|
|
for dupe_ob, dupe_matrix in dupe_obs:
|
|
|
|
|
print dupe_ob.name
|
|
|
|
|
empty_ob= Object.New('Empty')
|
|
|
|
|
scn.link(empty_ob)
|
|
|
|
|
empty_ob.setMatrix(dupe_matrix)
|
|
|
|
|
Blender.Redraw()
|
|
|
|
|
(Read-only)
|
|
|
|
|
@type DupObjects: list of tuples (object, matrix)
|
|
|
|
|
@ivar enableDupVerts: The DupliVerts status of the object.
|
|
|
|
|
True/False - does not indicate that this object has any dupliVerts,
|
|
|
|
|
(as returned by DupObjects) just that dupliVerts are enabled.
|
|
|
|
|
@type enableDupVerts: bool (True/False)
|
|
|
|
|
@ivar enableDupFrames: The DupliFrames status of the object.
|
|
|
|
|
True/False - does not indicate that this object has any dupliFrames,
|
|
|
|
|
(as returned by DupObjects) just that dupliFrames are enabled.
|
|
|
|
|
@type enableDupFrames: bool (True/False)
|
|
|
|
|
@ivar enableDupGroup: The DupliFroup status of the object.
|
|
|
|
|
True/False - Set DupGroup to a group for this to take effect,
|
|
|
|
|
Use DupObjects to get the object data from this instance. (Use with L{DupObjects<DupObjects>})
|
|
|
|
|
@type enableDupGroup: bool (True/False)
|
|
|
|
|
@ivar enableDupRot: The DupliRot status of the object.
|
|
|
|
|
True/False - Use with enableDupVerts to rotate each instance
|
|
|
|
|
by the vertex normal. (Use with L{enableDupVerts<enableDupVerts>})
|
|
|
|
|
@type enableDupRot: bool (True/False)
|
|
|
|
|
@ivar enableDupNoSpeed: The DupliNoSpeed status of the object.
|
|
|
|
|
True/False - Use with enableDupFrames to ignore
|
|
|
|
|
dupliFrame speed. (Use with L{enableDupFrames<enableDupFrames>})
|
|
|
|
|
@type enableDupNoSpeed: bool (True/False)
|
|
|
|
|
@ivar DupSta: The DupliFrame starting frame. (Use with L{enableDupFrames<enableDupFrames>})
|
|
|
|
|
@type DupSta: int
|
|
|
|
|
@ivar DupEnd: The DupliFrame end frame. (Use with L{enableDupFrames<enableDupFrames>})
|
|
|
|
|
@type DupEnd: int
|
|
|
|
|
@ivar DupOn: The DupliFrames in sucsession between DupOff frames.
|
|
|
|
|
(Use with L{enableDupFrames<enableDupFrames>} and L{DupOff<DupOff>} > 0)
|
|
|
|
|
@type DupOn: int
|
|
|
|
|
@ivar DupOff: The DupliFrame removal of every Nth frame for this object. (Use with L{enableDupFrames<enableDupFrames>})
|
|
|
|
|
@type DupOff: int
|
2006-03-31 09:50:39 +00:00
|
|
|
@ivar drawSize: The drawsize for empty objects. 1.0. is default.
|
|
|
|
|
@type drawSize: float
|
2006-04-25 13:01:19 +00:00
|
|
|
@ivar modifiers: The modifiers for this object.
|
|
|
|
|
@type modifiers: ModSeq L{Modifier.ModSeq}
|
2006-05-07 14:57:58 +00:00
|
|
|
@type constraints: BPy_ConstraintSeq
|
|
|
|
|
@ivar constraints: a L{sequence<Constraint.ConstraintSeq>} of
|
|
|
|
|
L{constraints<Constraint.Constraint>} for the object.
|
2003-06-28 15:10:23 +00:00
|
|
|
"""
|
|
|
|
|
|
2003-07-25 19:53:42 +00:00
|
|
|
def buildParts():
|
|
|
|
|
"""
|
2003-08-06 17:04:36 +00:00
|
|
|
Recomputes the particle system. This method only applies to an Object of
|
|
|
|
|
the type Effect.
|
2003-07-25 19:53:42 +00:00
|
|
|
"""
|
2003-10-29 01:37:32 +00:00
|
|
|
|
2006-01-17 16:32:09 +00:00
|
|
|
def insertShapeKey():
|
|
|
|
|
"""
|
|
|
|
|
Insert a Shape Key in the current object. It applies to Objects of
|
|
|
|
|
the type Mesh, Lattice, or Curve.
|
|
|
|
|
"""
|
|
|
|
|
|
2006-01-11 20:44:24 +00:00
|
|
|
def getPose():
|
|
|
|
|
"""
|
|
|
|
|
Gets the current Pose of the object.
|
|
|
|
|
@rtype: Pose object
|
|
|
|
|
@return: the current pose object
|
|
|
|
|
"""
|
|
|
|
|
|
2003-10-29 01:37:32 +00:00
|
|
|
def clearIpo():
|
2003-10-28 23:25:59 +00:00
|
|
|
"""
|
2003-10-29 01:37:32 +00:00
|
|
|
Unlinks the ipo from this object.
|
|
|
|
|
@return: True if there was an ipo linked or False otherwise.
|
2003-10-28 23:25:59 +00:00
|
|
|
"""
|
2003-08-06 17:04:36 +00:00
|
|
|
|
2003-06-28 15:10:23 +00:00
|
|
|
def clrParent(mode = 0, fast = 0):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
|
|
|
|
Clears parent object.
|
2003-08-06 17:04:36 +00:00
|
|
|
@type mode: Integer
|
|
|
|
|
@type fast: Integer
|
2003-07-12 18:21:07 +00:00
|
|
|
@param mode: A mode flag. If mode flag is 2, then the object transform will
|
|
|
|
|
be kept. Any other value, or no value at all will update the object
|
|
|
|
|
transform.
|
|
|
|
|
@param fast: If the value is 0, the scene hierarchy will not be updated. Any
|
|
|
|
|
other value, or no value at all will update the scene hierarchy.
|
|
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2005-10-04 15:17:27 +00:00
|
|
|
def getData(name_only=False, mesh=False):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2005-10-04 15:17:27 +00:00
|
|
|
Returns the Datablock object (Mesh, Lamp, Camera, etc.) linked to this
|
|
|
|
|
Object. If the keyword parameter 'name_only' is True, only the Datablock
|
|
|
|
|
name is returned as a string. It the object is of type Mesh, then the
|
|
|
|
|
'mesh' keyword can also be used; the data return is a Mesh object if
|
|
|
|
|
True, otherwise it is an NMesh object (the default).
|
2005-02-09 05:19:24 +00:00
|
|
|
@type name_only: bool
|
2005-10-04 15:17:27 +00:00
|
|
|
@param name_only: This is a keyword parameter. If True (or nonzero),
|
|
|
|
|
only the name of the data object is returned.
|
|
|
|
|
@type mesh: bool
|
|
|
|
|
@param mesh: This is a keyword parameter. If True (or nonzero),
|
|
|
|
|
a Mesh data object is returned.
|
2005-04-02 17:01:56 +00:00
|
|
|
@rtype: specific Object type or string
|
|
|
|
|
@return: Depends on the type of Datablock linked to the Object. If name_only is True, it returns a string.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2005-11-15 21:14:24 +00:00
|
|
|
def getParentBoneName():
|
|
|
|
|
"""
|
|
|
|
|
Returns None, or the 'sub-name' of the parent (eg. Bone name)
|
|
|
|
|
@return: string
|
|
|
|
|
"""
|
|
|
|
|
|
2003-06-28 15:10:23 +00:00
|
|
|
def getDeltaLocation():
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Returns the object's delta location in a list (x, y, z)
|
2003-08-06 17:04:36 +00:00
|
|
|
@rtype: A vector triple
|
2003-07-30 20:52:35 +00:00
|
|
|
@return: (x, y, z)
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
|
|
|
|
def getDrawMode():
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Returns the object draw mode.
|
2003-08-06 17:04:36 +00:00
|
|
|
@rtype: Integer
|
|
|
|
|
@return: a sum of the following:
|
|
|
|
|
- 2 - axis
|
|
|
|
|
- 4 - texspace
|
|
|
|
|
- 8 - drawname
|
|
|
|
|
- 16 - drawimage
|
|
|
|
|
- 32 - drawwire
|
2006-04-25 13:01:19 +00:00
|
|
|
- 64 - xray
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
|
|
|
|
def getDrawType():
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Returns the object draw type
|
2003-08-06 17:04:36 +00:00
|
|
|
@rtype: Integer
|
|
|
|
|
@return: One of the following:
|
|
|
|
|
- 1 - Bounding box
|
|
|
|
|
- 2 - Wire
|
|
|
|
|
- 3 - Solid
|
|
|
|
|
- 4 - Shaded
|
|
|
|
|
- 5 - Textured
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2006-05-07 08:12:18 +00:00
|
|
|
def getEuler(space):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2006-05-07 08:12:18 +00:00
|
|
|
@type space: string
|
|
|
|
|
@param space: The desired space for the size:
|
|
|
|
|
- localspace: (default) relative to the object's parent;
|
|
|
|
|
- worldspace: absolute, taking vertex parents, tracking and
|
|
|
|
|
Ipo's into account;
|
2005-10-11 15:11:39 +00:00
|
|
|
Returns the object's localspace rotation as Euler rotation vector (rotX, rotY, rotZ). Angles are in radians.
|
2006-05-07 08:12:18 +00:00
|
|
|
@rtype: Py_Euler
|
2005-11-15 21:14:24 +00:00
|
|
|
@return: A python Euler. Data is wrapped when euler is present.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
|
|
|
|
def getInverseMatrix():
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Returns the object's inverse matrix.
|
2004-05-02 14:29:31 +00:00
|
|
|
@rtype: Py_Matrix
|
|
|
|
|
@return: A python matrix 4x4
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2003-10-29 01:37:32 +00:00
|
|
|
def getIpo():
|
|
|
|
|
"""
|
|
|
|
|
Returns the Ipo associated to this object or None if there's no linked ipo.
|
|
|
|
|
@rtype: Ipo
|
|
|
|
|
@return: the wrapped ipo or None.
|
|
|
|
|
"""
|
2004-06-02 06:19:56 +00:00
|
|
|
def isSelected():
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Returns the objects selection state in the current scene as a boolean value True or False.
|
2004-06-02 06:19:56 +00:00
|
|
|
@rtype: Boolean
|
|
|
|
|
@return: Selection state as True or False
|
|
|
|
|
"""
|
|
|
|
|
|
2006-05-07 08:12:18 +00:00
|
|
|
def getLocation(space):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2006-05-07 08:12:18 +00:00
|
|
|
@type space: string
|
|
|
|
|
@param space: The desired space for the location:
|
|
|
|
|
- localspace: (default) relative to the object's parent;
|
|
|
|
|
- worldspace: absolute, taking vertex parents, tracking and
|
|
|
|
|
Ipo's into account;
|
2003-07-30 20:52:35 +00:00
|
|
|
Returns the object's location (x, y, z).
|
|
|
|
|
@return: (x, y, z)
|
2003-08-06 22:08:56 +00:00
|
|
|
|
|
|
|
|
I{B{Example:}}
|
|
|
|
|
|
|
|
|
|
The example below works on the default scene. It retrieves all objects in
|
|
|
|
|
the scene and prints the name and location of each object::
|
|
|
|
|
import Blender
|
|
|
|
|
|
|
|
|
|
objects = Blender.Object.Get()
|
|
|
|
|
|
|
|
|
|
for obj in objects:
|
|
|
|
|
print obj.getName()
|
|
|
|
|
print obj.getLocation()
|
2006-05-07 08:12:18 +00:00
|
|
|
@note: the worldspace location is the same as ob.matrixWorld[3][0:3]
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2004-05-02 14:29:31 +00:00
|
|
|
def getAction():
|
|
|
|
|
"""
|
|
|
|
|
Returns an action if one is associated with this object (only useful for armature types).
|
|
|
|
|
@rtype: Py_Action
|
|
|
|
|
@return: a python action.
|
|
|
|
|
"""
|
|
|
|
|
|
2004-07-20 08:16:46 +00:00
|
|
|
def getMaterials(what = 0):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Returns a list of materials assigned to the object.
|
2004-07-20 08:16:46 +00:00
|
|
|
@type what: int
|
|
|
|
|
@param what: if nonzero, empty slots will be returned as None's instead
|
|
|
|
|
of being ignored (default way). See L{NMesh.NMesh.getMaterials}.
|
2003-07-30 20:52:35 +00:00
|
|
|
@rtype: list of Material Objects
|
|
|
|
|
@return: list of Material Objects assigned to the object.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
now), same in Blender.Sound: renamed makeActive to setCurrent. Stephen Swaney
pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
after reading a discussion on blender.org's Python forum where eeshlo mentioned the
pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
confirmed, talked to Theeth about this and as he suggested am changing the default
back to 'worldspace'.
2004-10-20 05:51:24 +00:00
|
|
|
def getMatrix(space = 'worldspace'):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Returns the object matrix.
|
- Blender: added option 'scriptsdir' to Blender.Get();
- small updates to the docs;
- Object: small fix to getMatrix: check during_script() to avoid undesired loops; added old behavior (pre 2.34) as option: .getMatrix('oldlocal');
- tentative fix for bug #1275: scene REDRAW scriptlinks were not being executed (the call to do so was missing):
http://projects.blender.org/tracker/index.php?func=detail&aid=1275&group_id=9&atid=125
added the call in drawview.c, in drawview3dspace(). This causes the scriptlink to be called for each visible view3d, but that's what happens with object redraw scriptlinks, too. Anyway, this is still a test. The place was chosen based on the idea that a scene redraw scriptlink is like an object redraw one, but for all objs in the scene at once.
- Window.Theme: new submodule, to get/set theme options in Blender;
- Added the script save_theme.py (Help menu for now), to save the current theme in Blender as an executable script (currently shown in the Scripts->Misc menu).
There's more work to do for themes, like defining a proper place for them in the interface, adding documentation (for now the added script and the ones it generates can give a pretty good idea of how to use the new module), probably extending themes to support SpaceScript and so on.
2004-09-21 05:28:17 +00:00
|
|
|
@type space: string
|
|
|
|
|
@param space: The desired matrix:
|
BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
now), same in Blender.Sound: renamed makeActive to setCurrent. Stephen Swaney
pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
after reading a discussion on blender.org's Python forum where eeshlo mentioned the
pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
confirmed, talked to Theeth about this and as he suggested am changing the default
back to 'worldspace'.
2004-10-20 05:51:24 +00:00
|
|
|
- worldspace (default): absolute, taking vertex parents, tracking and
|
2005-10-11 15:11:39 +00:00
|
|
|
Ipo's into account;
|
BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
now), same in Blender.Sound: renamed makeActive to setCurrent. Stephen Swaney
pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
after reading a discussion on blender.org's Python forum where eeshlo mentioned the
pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
confirmed, talked to Theeth about this and as he suggested am changing the default
back to 'worldspace'.
2004-10-20 05:51:24 +00:00
|
|
|
- localspace: relative to the object's parent;
|
|
|
|
|
- old_worldspace: old behavior, prior to Blender 2.34, where eventual
|
|
|
|
|
changes made by the script itself were not taken into account until
|
|
|
|
|
a redraw happened, either called by the script or upon its exit.
|
2004-07-04 19:57:41 +00:00
|
|
|
Returns the object matrix.
|
2005-11-15 21:14:24 +00:00
|
|
|
@rtype: Py_Matrix (WRAPPED DATA)
|
|
|
|
|
@return: a python 4x4 matrix object. Data is wrapped for 'worldspace'
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
|
|
|
|
def getName():
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Returns the name of the object
|
2003-08-06 17:04:36 +00:00
|
|
|
@return: The name of the object
|
2003-08-06 22:08:56 +00:00
|
|
|
|
|
|
|
|
I{B{Example:}}
|
|
|
|
|
|
|
|
|
|
The example below works on the default scene. It retrieves all objects in
|
|
|
|
|
the scene and prints the name of each object::
|
|
|
|
|
import Blender
|
|
|
|
|
|
|
|
|
|
objects = Blender.Object.Get()
|
|
|
|
|
|
|
|
|
|
for obj in objects:
|
|
|
|
|
print obj.getName()
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
|
|
|
|
def getParent():
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Returns the object's parent object.
|
|
|
|
|
@rtype: Object
|
|
|
|
|
@return: The parent object of the object. If not available, None will be
|
|
|
|
|
returned.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2006-05-07 08:12:18 +00:00
|
|
|
def getSize(space):
|
2004-01-23 19:24:45 +00:00
|
|
|
"""
|
2006-05-07 08:12:18 +00:00
|
|
|
@type space: string
|
|
|
|
|
@param space: The desired space for the size:
|
|
|
|
|
- localspace: (default) relative to the object's parent;
|
|
|
|
|
- worldspace: absolute, taking vertex parents, tracking and
|
|
|
|
|
Ipo's into account;
|
2004-01-23 19:24:45 +00:00
|
|
|
Returns the object's size.
|
|
|
|
|
@return: (SizeX, SizeY, SizeZ)
|
2006-05-07 08:12:18 +00:00
|
|
|
@note: the worldspace size will not return negative (flipped) scale values.
|
2004-01-23 19:24:45 +00:00
|
|
|
"""
|
|
|
|
|
|
2005-07-18 18:11:23 +00:00
|
|
|
def getParentBoneName():
|
|
|
|
|
"""
|
|
|
|
|
Returns the object's parent object's sub name, or None.
|
2005-07-20 00:03:52 +00:00
|
|
|
For objects parented to bones, this is the name of the bone.
|
2005-07-18 18:11:23 +00:00
|
|
|
@rtype: String
|
|
|
|
|
@return: The parent object sub-name of the object.
|
2005-12-29 10:33:00 +00:00
|
|
|
If not available, None will be returned.
|
2005-07-18 18:11:23 +00:00
|
|
|
"""
|
|
|
|
|
|
2004-04-02 19:53:53 +00:00
|
|
|
def getTimeOffset():
|
|
|
|
|
"""
|
|
|
|
|
Returns the time offset of the object's animation.
|
|
|
|
|
@return: TimeOffset
|
|
|
|
|
"""
|
|
|
|
|
|
2003-06-28 15:10:23 +00:00
|
|
|
def getTracked():
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Returns the object's tracked object.
|
|
|
|
|
@rtype: Object
|
|
|
|
|
@return: The tracked object of the object. If not available, None will be
|
|
|
|
|
returned.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
|
|
|
|
def getType():
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2005-12-29 10:33:00 +00:00
|
|
|
Returns the type of the object in 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice',
|
|
|
|
|
'Mball', 'Mesh', 'Surf', 'Empty', 'Wave' (deprecated) or 'unknown' in exceptional cases.
|
2003-07-30 20:52:35 +00:00
|
|
|
@return: The type of object.
|
2003-08-06 22:08:56 +00:00
|
|
|
|
|
|
|
|
I{B{Example:}}
|
|
|
|
|
|
|
|
|
|
The example below works on the default scene. It retrieves all objects in
|
|
|
|
|
the scene and updates the location and rotation of the camera. When run,
|
2005-10-11 15:11:39 +00:00
|
|
|
the camera will rotate 180 degrees and moved to the opposite side of the X
|
2003-08-06 22:08:56 +00:00
|
|
|
axis. Note that the number 'pi' in the example is an approximation of the
|
2005-10-11 15:11:39 +00:00
|
|
|
true number 'pi'. A better, less error-prone value of pi is math.pi from the python math module.::
|
2003-08-06 22:08:56 +00:00
|
|
|
import Blender
|
|
|
|
|
|
|
|
|
|
objects = Blender.Object.Get()
|
|
|
|
|
|
|
|
|
|
for obj in objects:
|
|
|
|
|
if obj.getType() == 'Camera':
|
|
|
|
|
obj.LocY = -obj.LocY
|
|
|
|
|
obj.RotZ = 3.141592 - obj.RotZ
|
|
|
|
|
|
|
|
|
|
Blender.Redraw()
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2005-03-20 03:50:56 +00:00
|
|
|
def insertIpoKey(keytype):
|
|
|
|
|
"""
|
|
|
|
|
Inserts keytype values in object ipo at curframe. Uses module constants.
|
|
|
|
|
@type keytype: Integer
|
|
|
|
|
@param keytype:
|
|
|
|
|
-LOC
|
|
|
|
|
-ROT
|
|
|
|
|
-SIZE
|
|
|
|
|
-LOCROT
|
|
|
|
|
-LOCROTSIZE
|
2005-04-14 17:56:37 +00:00
|
|
|
-PI_STRENGTH
|
|
|
|
|
-PI_FALLOFF
|
|
|
|
|
-PI_PERM
|
|
|
|
|
-PI_SURFACEDAMP
|
|
|
|
|
-PI_RANDOMDAMP
|
2005-03-20 03:50:56 +00:00
|
|
|
@return: py_none
|
|
|
|
|
"""
|
2005-03-12 12:31:33 +00:00
|
|
|
|
2005-10-11 15:11:39 +00:00
|
|
|
def link(datablock):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Links Object with ObData datablock provided in the argument. The data must match the
|
2003-07-30 20:52:35 +00:00
|
|
|
Object's type, so you cannot link a Lamp to a Mesh type object.
|
2005-10-11 15:11:39 +00:00
|
|
|
@type datablock: Blender ObData datablock
|
|
|
|
|
@param datablock: A Blender datablock matching the objects type.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
|
|
|
|
def makeParent(objects, noninverse = 0, fast = 0):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Makes the object the parent of the objects provided in the argument which
|
|
|
|
|
must be a list of valid Objects.
|
2005-07-15 05:30:58 +00:00
|
|
|
@type objects: Sequence of Blender Object
|
2005-10-11 15:11:39 +00:00
|
|
|
@param objects: The children of the parent
|
2005-07-15 05:30:58 +00:00
|
|
|
@type noninverse: Integer
|
|
|
|
|
@param noninverse:
|
|
|
|
|
0 - make parent with inverse
|
|
|
|
|
1 - make parent without inverse
|
|
|
|
|
@type fast: Integer
|
|
|
|
|
@param fast:
|
|
|
|
|
0 - update scene hierarchy automatically
|
|
|
|
|
1 - don't update scene hierarchy (faster). In this case, you must
|
|
|
|
|
explicitely update the Scene hierarchy.
|
|
|
|
|
@warn: objects must first be linked to a scene before they can become
|
|
|
|
|
parents of other objects. Calling this makeParent method for an
|
|
|
|
|
unlinked object will result in an error.
|
|
|
|
|
"""
|
2005-12-29 10:33:00 +00:00
|
|
|
|
2006-01-03 02:35:45 +00:00
|
|
|
def join(objects):
|
|
|
|
|
"""
|
|
|
|
|
Uses the object as a base for all of the objects in the provided list to join into.
|
|
|
|
|
|
|
|
|
|
@type objects: Sequence of Blender Object
|
|
|
|
|
@param objects: A list of objects matching the objects type.
|
2006-01-06 01:53:26 +00:00
|
|
|
@note: Objects in the list will not be removed from the scene,
|
|
|
|
|
to avoid overlapping data you may want to remove them manualy after joining.
|
|
|
|
|
@note: Join modifies the base objects data in place so that
|
|
|
|
|
other objects are joined into it. no new object or data is created.
|
|
|
|
|
@note: Join will only work for object types Mesh, Armature, Curve and Surface,
|
|
|
|
|
an error will be raised if the object is not of this type.
|
2006-01-03 02:35:45 +00:00
|
|
|
@note: objects in the list will be ignored if they to not match the base object.
|
2006-01-06 01:53:26 +00:00
|
|
|
@note: An error in the join function input will raise a TypeError,
|
|
|
|
|
otherwise an error in the data input will raise a RuntimeError,
|
|
|
|
|
for situations where you don't have tight control on the data that is being joined,
|
|
|
|
|
you should handel the RuntimeError error, litting the user know the data cant be joined.
|
2006-01-03 02:35:45 +00:00
|
|
|
"""
|
|
|
|
|
|
2005-07-15 05:30:58 +00:00
|
|
|
def makeParentDeform(objects, noninverse = 0, fast = 0):
|
|
|
|
|
"""
|
|
|
|
|
Makes the object the deformation parent of the objects provided in the argument
|
|
|
|
|
which must be a list of valid Objects.
|
|
|
|
|
The parent object must be a Curve or Armature.
|
|
|
|
|
@type objects: Sequence of Blender Object
|
2005-10-11 15:11:39 +00:00
|
|
|
@param objects: The children of the parent
|
2005-07-15 05:30:58 +00:00
|
|
|
@type noninverse: Integer
|
|
|
|
|
@param noninverse:
|
|
|
|
|
0 - make parent with inverse
|
|
|
|
|
1 - make parent without inverse
|
|
|
|
|
@type fast: Integer
|
|
|
|
|
@param fast:
|
|
|
|
|
0 - update scene hierarchy automatically
|
|
|
|
|
1 - don't update scene hierarchy (faster). In this case, you must
|
|
|
|
|
explicitely update the Scene hierarchy.
|
|
|
|
|
@warn: objects must first be linked to a scene before they can become
|
|
|
|
|
parents of other objects. Calling this makeParent method for an
|
|
|
|
|
unlinked object will result in an error.
|
|
|
|
|
@warn: child objects must be of mesh type to deform correctly. Other object
|
|
|
|
|
types will fall back to normal parenting silently.
|
|
|
|
|
"""
|
2005-12-29 10:33:00 +00:00
|
|
|
|
2005-07-15 05:30:58 +00:00
|
|
|
def makeParentVertex(objects, indices, noninverse = 0, fast = 0):
|
|
|
|
|
"""
|
|
|
|
|
Makes the object the vertex parent of the objects provided in the argument
|
|
|
|
|
which must be a list of valid Objects.
|
|
|
|
|
The parent object must be a Mesh, Curve or Surface.
|
|
|
|
|
@type objects: Sequence of Blender Object
|
2005-10-11 15:11:39 +00:00
|
|
|
@param objects: The children of the parent
|
2005-07-15 05:30:58 +00:00
|
|
|
@type indices: Tuple of Integers
|
2005-10-11 15:11:39 +00:00
|
|
|
@param indices: The indices of the vertices you want to parent to (1 or 3 values)
|
2003-08-06 17:04:36 +00:00
|
|
|
@type noninverse: Integer
|
|
|
|
|
@param noninverse:
|
|
|
|
|
0 - make parent with inverse
|
|
|
|
|
1 - make parent without inverse
|
|
|
|
|
@type fast: Integer
|
|
|
|
|
@param fast:
|
|
|
|
|
0 - update scene hierarchy automatically
|
|
|
|
|
1 - don't update scene hierarchy (faster). In this case, you must
|
|
|
|
|
explicitely update the Scene hierarchy.
|
2005-05-22 07:22:34 +00:00
|
|
|
@warn: objects must first be linked to a scene before they can become
|
|
|
|
|
parents of other objects. Calling this makeParent method for an
|
|
|
|
|
unlinked object will result in an error.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2003-07-30 20:52:35 +00:00
|
|
|
def setDeltaLocation(delta_location):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Sets the object's delta location which must be a vector triple.
|
|
|
|
|
@type delta_location: A vector triple
|
|
|
|
|
@param delta_location: A vector triple (x, y, z) specifying the new
|
|
|
|
|
location.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2003-07-30 20:52:35 +00:00
|
|
|
def setDrawMode(drawmode):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Sets the object's drawing mode. The drawing mode can be a mix of modes. To
|
|
|
|
|
enable these, add up the values.
|
2003-08-06 17:04:36 +00:00
|
|
|
@type drawmode: Integer
|
2003-07-30 20:52:35 +00:00
|
|
|
@param drawmode: A sum of the following:
|
2003-08-06 17:04:36 +00:00
|
|
|
- 2 - axis
|
|
|
|
|
- 4 - texspace
|
|
|
|
|
- 8 - drawname
|
|
|
|
|
- 16 - drawimage
|
|
|
|
|
- 32 - drawwire
|
2006-04-25 13:01:19 +00:00
|
|
|
- 64 - xray
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2003-07-30 20:52:35 +00:00
|
|
|
def setDrawType(drawtype):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-07-30 20:52:35 +00:00
|
|
|
Sets the object's drawing type.
|
2003-08-06 17:04:36 +00:00
|
|
|
@type drawtype: Integer
|
|
|
|
|
@param drawtype: One of the following:
|
|
|
|
|
- 1 - Bounding box
|
|
|
|
|
- 2 - Wire
|
|
|
|
|
- 3 - Solid
|
|
|
|
|
- 4 - Shaded
|
|
|
|
|
- 5 - Textured
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2004-05-02 14:29:31 +00:00
|
|
|
def setEuler(euler):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Sets the object's localspace rotation according to the specified Euler angles.
|
2004-05-02 14:29:31 +00:00
|
|
|
@type euler: Py_Euler or a list of floats
|
2005-10-11 15:11:39 +00:00
|
|
|
@param euler: a python Euler or x,y,z rotations as floats
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2003-10-29 01:37:32 +00:00
|
|
|
def setIpo(ipo):
|
|
|
|
|
"""
|
|
|
|
|
Links an ipo to this object.
|
|
|
|
|
@type ipo: Blender Ipo
|
|
|
|
|
@param ipo: an object type ipo.
|
|
|
|
|
"""
|
|
|
|
|
|
2003-08-06 22:08:56 +00:00
|
|
|
def setLocation(x, y, z):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Sets the object's location relative to the parent object (if any).
|
2003-08-06 22:08:56 +00:00
|
|
|
@type x: float
|
|
|
|
|
@param x: The X coordinate of the new location.
|
|
|
|
|
@type y: float
|
|
|
|
|
@param y: The Y coordinate of the new location.
|
|
|
|
|
@type z: float
|
|
|
|
|
@param z: The Z coordinate of the new location.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
|
|
|
|
def setMaterials(materials):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2005-10-21 17:20:54 +00:00
|
|
|
Sets the materials. The argument must be a list 16 items or less. Each
|
|
|
|
|
list element is either a Material or None. Also see L{colbits}.
|
2003-07-30 20:52:35 +00:00
|
|
|
@type materials: Materials list
|
|
|
|
|
@param materials: A list of Blender material objects.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2003-06-28 15:10:23 +00:00
|
|
|
|
2004-05-02 14:29:31 +00:00
|
|
|
def setMatrix(matrix):
|
|
|
|
|
"""
|
2006-02-16 20:09:32 +00:00
|
|
|
Sets the object's matrix and updates its transformation.
|
|
|
|
|
@type matrix: Py_Matrix 3x3 or 4x4
|
|
|
|
|
@param matrix: a 3x3 or 4x4 Python matrix. If a 3x3 matrix is given,
|
|
|
|
|
it is extended to a 4x4 matrix.
|
2004-05-02 14:29:31 +00:00
|
|
|
"""
|
|
|
|
|
|
2003-07-30 20:52:35 +00:00
|
|
|
def setName(name):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Sets the name of the object. A string longer then 20 characters will be shortened.
|
2003-07-30 20:52:35 +00:00
|
|
|
@type name: String
|
|
|
|
|
@param name: The new name for the object.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2004-01-23 19:24:45 +00:00
|
|
|
|
|
|
|
|
def setSize(x, y, z):
|
|
|
|
|
"""
|
2005-12-29 10:33:00 +00:00
|
|
|
Sets the object's size, relative to the parent object (if any), clamped
|
2004-01-23 19:24:45 +00:00
|
|
|
@type x: float
|
|
|
|
|
@param x: The X size multiplier.
|
|
|
|
|
@type y: float
|
|
|
|
|
@param y: The Y size multiplier.
|
|
|
|
|
@type z: float
|
|
|
|
|
@param z: The Z size multiplier.
|
|
|
|
|
"""
|
|
|
|
|
|
2004-04-02 19:53:53 +00:00
|
|
|
def setTimeOffset(timeOffset):
|
|
|
|
|
"""
|
|
|
|
|
Sets the time offset of the object's animation.
|
|
|
|
|
@type timeOffset: float
|
|
|
|
|
@param timeOffset: The new time offset for the object's animation.
|
|
|
|
|
"""
|
2004-06-08 04:41:02 +00:00
|
|
|
|
2003-07-30 20:52:35 +00:00
|
|
|
def shareFrom(object):
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2004-07-20 08:16:46 +00:00
|
|
|
Link data of object specified in the argument with self. This works only
|
2003-07-30 20:52:35 +00:00
|
|
|
if self and the object specified are of the same type.
|
|
|
|
|
@type object: Blender Object
|
|
|
|
|
@param object: A Blender Object of the same type.
|
2003-07-12 18:21:07 +00:00
|
|
|
"""
|
2004-06-02 06:19:56 +00:00
|
|
|
|
|
|
|
|
def select(boolean):
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Sets the object's selection state in the current scene.
|
2005-12-29 10:33:00 +00:00
|
|
|
setting the selection will make this object the active object of this scene.
|
2004-06-02 06:19:56 +00:00
|
|
|
@type boolean: Integer
|
|
|
|
|
@param boolean:
|
|
|
|
|
- 0 - unselected
|
|
|
|
|
- 1 - selected
|
|
|
|
|
"""
|
|
|
|
|
|
2003-09-20 03:40:16 +00:00
|
|
|
def getBoundBox():
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Returns the worldspace bounding box of this object. This works for meshes (out of
|
2003-09-20 03:40:16 +00:00
|
|
|
edit mode) and curves.
|
2005-11-15 21:14:24 +00:00
|
|
|
@rtype: list of 8 (x,y,z) float coordinate vectors (WRAPPED DATA)
|
|
|
|
|
@return: The coordinates of the 8 corners of the bounding box. Data is wrapped when
|
|
|
|
|
bounding box is present.
|
2003-09-20 03:40:16 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def makeDisplayList():
|
|
|
|
|
"""
|
|
|
|
|
Updates this object's display list. Blender uses display lists to store
|
|
|
|
|
already transformed data (like a mesh with its vertices already modified
|
|
|
|
|
by coordinate transformations and armature deformation). If the object
|
|
|
|
|
isn't modified, there's no need to recalculate this data. This method is
|
|
|
|
|
here for the *few cases* where a script may need it, like when toggling
|
|
|
|
|
the "SubSurf" mode for a mesh:
|
BPython:
- new submodule Scene.Radio, for radiosity: still incomplete, but in shape for demos, updated SConscript to include it;
- new functions in Window module;
- doc updates: adding a todo file and a new start page for our docs: API_intro.py + other updates;
- small fix in Ipo.c provided by Damien McGuinnes (thanks!): Nathan has a patch with IPO additions and fixes for this and more, but until it is committed, there's this fix for Ipo.getCurve('LocX'), LocY, Z and QuatW,X,Y,Z too, according to Damien.
Other files:
- radpreprocess.c: added check for "during_script()" so eventual msgs don't popup during scripts;
- drawmesh.c: made a pointer (display list) be checked before accessed, fixes crash in scripts that forget to update display lists for subsurf meshes when a 3d view is in textured view mode.
Script: updated bevel_center by Loic Berthe.
2004-07-25 16:55:45 +00:00
|
|
|
|
2003-09-20 03:40:16 +00:00
|
|
|
Example::
|
BPython:
- new submodule Scene.Radio, for radiosity: still incomplete, but in shape for demos, updated SConscript to include it;
- new functions in Window module;
- doc updates: adding a todo file and a new start page for our docs: API_intro.py + other updates;
- small fix in Ipo.c provided by Damien McGuinnes (thanks!): Nathan has a patch with IPO additions and fixes for this and more, but until it is committed, there's this fix for Ipo.getCurve('LocX'), LocY, Z and QuatW,X,Y,Z too, according to Damien.
Other files:
- radpreprocess.c: added check for "during_script()" so eventual msgs don't popup during scripts;
- drawmesh.c: made a pointer (display list) be checked before accessed, fixes crash in scripts that forget to update display lists for subsurf meshes when a 3d view is in textured view mode.
Script: updated bevel_center by Loic Berthe.
2004-07-25 16:55:45 +00:00
|
|
|
object = Blender.Object.Get("Sphere")
|
|
|
|
|
nmesh = object.getData()
|
|
|
|
|
nmesh.setMode("SubSurf")
|
|
|
|
|
nmesh.update() # don't forget to update!
|
|
|
|
|
object.makeDisplayList()
|
|
|
|
|
Blender.Window.Redraw()
|
2003-09-20 03:40:16 +00:00
|
|
|
|
|
|
|
|
If you try this example without the line to update the display list, the
|
|
|
|
|
object will disappear from the screen until you press "SubSurf".
|
|
|
|
|
@warn: If after running your script objects disappear from the screen or
|
|
|
|
|
are not displayed correctly, try this method function. But if the script
|
|
|
|
|
works properly without it, there's no reason to use it.
|
|
|
|
|
"""
|
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.
2004-07-03 05:17:04 +00:00
|
|
|
|
|
|
|
|
def getScriptLinks (event):
|
|
|
|
|
"""
|
|
|
|
|
Get a list with this Object's script links of type 'event'.
|
|
|
|
|
@type event: string
|
2005-05-22 07:22:34 +00:00
|
|
|
@param event: "FrameChanged", "Redraw" or "Render".
|
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.
2004-07-03 05:17:04 +00:00
|
|
|
@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.
|
|
|
|
|
"""
|
|
|
|
|
|
2005-04-21 19:44:52 +00:00
|
|
|
def clearScriptLinks (links = None):
|
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.
2004-07-03 05:17:04 +00:00
|
|
|
"""
|
2005-04-21 19:44:52 +00:00
|
|
|
Delete script links from this Object. If no list is specified, all
|
|
|
|
|
script links are deleted.
|
|
|
|
|
@type links: list of strings
|
|
|
|
|
@param links: None (default) or a list of Blender L{Text} names.
|
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.
2004-07-03 05:17:04 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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
|
2005-05-22 07:22:34 +00:00
|
|
|
@param event: "FrameChanged", "Redraw" or "Render".
|
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.
2004-07-03 05:17:04 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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}).
|
|
|
|
|
"""
|
2004-07-04 19:57:41 +00:00
|
|
|
|
|
|
|
|
def getAllProperties ():
|
|
|
|
|
"""
|
|
|
|
|
Return a list of properties from this object.
|
|
|
|
|
@rtype: PyList
|
|
|
|
|
@return: List of Property objects.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getProperty (name):
|
|
|
|
|
"""
|
|
|
|
|
Return a properties from this object based on name.
|
|
|
|
|
@type name: string
|
|
|
|
|
@param name: the name of the property to get.
|
|
|
|
|
@rtype: Property object
|
|
|
|
|
@return: The first property that matches name.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def addProperty (name, data, type):
|
|
|
|
|
"""
|
|
|
|
|
Add a property to object.
|
|
|
|
|
@type name: string
|
|
|
|
|
@param name: the property name.
|
|
|
|
|
@type data: string, int or float
|
|
|
|
|
@param data: depends on what is passed in:
|
|
|
|
|
- string: string type property
|
|
|
|
|
- int: integer type property
|
|
|
|
|
- float: float type property
|
|
|
|
|
@type type: string (optional)
|
|
|
|
|
@param type: can be the following:
|
|
|
|
|
- 'BOOL'
|
|
|
|
|
- 'INT'
|
|
|
|
|
- 'FLOAT'
|
|
|
|
|
- 'TIME'
|
|
|
|
|
- 'STRING'
|
|
|
|
|
@warn: If a type is not declared string data will
|
|
|
|
|
become string type, int data will become int type
|
|
|
|
|
and float data will become float type. Override type
|
|
|
|
|
to declare bool type, and time type.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def addProperty (property):
|
|
|
|
|
"""
|
|
|
|
|
Add a property to object.
|
|
|
|
|
@type property: Property object
|
|
|
|
|
@param property: property object to add to object.
|
|
|
|
|
@warn: A property object can be added only once to an object'
|
|
|
|
|
you must remove the property from an object to add it elsewhere.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def removeProperty (name):
|
|
|
|
|
"""
|
|
|
|
|
Remove a property from an object by name.
|
|
|
|
|
@type property: Property object
|
|
|
|
|
@param property: property to remove by name.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def removeProperty (property):
|
|
|
|
|
"""
|
|
|
|
|
Remove a property from an object.
|
|
|
|
|
@type property: Property object
|
|
|
|
|
@param property: property object to remove.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def removeAllProperties():
|
|
|
|
|
"""
|
|
|
|
|
Removes all properties from an object.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def copyAllPropertiesTo (object):
|
|
|
|
|
"""
|
|
|
|
|
Copies all properties from one object to another.
|
|
|
|
|
@type object: Object object
|
2005-10-11 15:11:39 +00:00
|
|
|
@param object: Object that will receive the properties.
|
2004-07-04 19:57:41 +00:00
|
|
|
"""
|
|
|
|
|
|
2005-04-14 17:56:37 +00:00
|
|
|
def getPIStregth():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's Particle Interaction Strength.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setPIStrength(strength):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's Particle Interaction Strength.
|
|
|
|
|
Values between -1000.0 to 1000.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type strength: float
|
|
|
|
|
@param strength: the Object's Particle Interaction New Strength.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getPIFalloff():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's Particle Interaction falloff.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setPIFalloff(falloff):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's Particle Interaction falloff.
|
|
|
|
|
Values between 0 to 10.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type falloff: float
|
|
|
|
|
@param falloff: the Object's Particle Interaction New falloff.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getPIMaxDist():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's Particle Interaction MaxDist.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setPIMaxDist(MaxDist):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's Particle Interaction MaxDist.
|
|
|
|
|
Values between 0 to 1000.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type MaxDist: float
|
|
|
|
|
@param MaxDist: the Object's Particle Interaction New MaxDist.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getPIType():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's Particle Interaction Type.
|
|
|
|
|
@rtype: int
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setPIType(type):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's Particle Interaction type.
|
|
|
|
|
Use Module Constants
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
- NONE
|
|
|
|
|
- WIND
|
|
|
|
|
- FORCE
|
|
|
|
|
- VORTEX
|
|
|
|
|
- MAGNET
|
2005-04-14 17:56:37 +00:00
|
|
|
@rtype: PyNone
|
|
|
|
|
@type type: int
|
|
|
|
|
@param type: the Object's Particle Interaction Type.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getPIUseMaxDist():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's Particle Interaction if using MaxDist.
|
|
|
|
|
@rtype: int
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setPIUseMaxDist(status):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's Particle Interaction MaxDist.
|
|
|
|
|
0 = Off, 1 = on
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type status: int
|
|
|
|
|
@param status: the new status
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getPIDeflection():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's Particle Interaction Deflection Setting.
|
|
|
|
|
@rtype: int
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setPIDeflection(status):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's Particle Interaction Deflection Setting.
|
|
|
|
|
0 = Off, 1 = on
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type status: int
|
|
|
|
|
@param status: the new status
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getPIPermf():
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Get the Object's Particle Interaction Permeability.
|
2005-04-14 17:56:37 +00:00
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setPIPerm(perm):
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Set the the Object's Particle Interaction Permeability.
|
2005-04-14 17:56:37 +00:00
|
|
|
Values between 0 to 10.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type perm: float
|
2005-10-11 15:11:39 +00:00
|
|
|
@param perm: the Object's Particle Interaction New Permeability.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getPIRandomDamp():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's Particle Interaction RandomDamp.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setPIRandomDamp(damp):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's Particle Interaction RandomDamp.
|
|
|
|
|
Values between 0 to 10.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type damp: float
|
|
|
|
|
@param damp: the Object's Particle Interaction New RandomDamp.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getPISurfaceDamp():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's Particle Interaction SurfaceDamp.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setPISurfaceDamp(damp):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's Particle Interaction SurfaceDamp.
|
|
|
|
|
Values between 0 to 10.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type damp: float
|
|
|
|
|
@param damp: the Object's Particle Interaction New SurfaceDamp.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBMass():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's SB Mass.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBMass(mass):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's SB Mass.
|
|
|
|
|
Values between 0 to 50.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type mass: float
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param mass: the Object's SB New mass.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBGravity():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's SB Gravity.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBGravity(grav):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's SB Gravity.
|
|
|
|
|
Values between 0 to 10.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type grav: float
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param grav: the Object's SB New Gravity.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBFriction():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's SB Friction.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBFriction(frict):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's SB Friction.
|
|
|
|
|
Values between 0 to 10.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type frict: float
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param frict: the Object's SB New Friction.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBErrorLimit():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's SB ErrorLimit.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBErrorLimit(err):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's SB ErrorLimit.
|
|
|
|
|
Values between 0 to 1.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type err: float
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param err: the Object's SB New ErrorLimit.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBGoalSpring():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's SB GoalSpring.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBGoalSpring(gs):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's SB GoalSpring.
|
|
|
|
|
Values between 0 to 0.999
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type gs: float
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param gs: the Object's SB New GoalSpring.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBGoalFriction():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's SB GoalFriction.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBGoalFriction(gf):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's SB GoalFriction.
|
|
|
|
|
Values between 0 to 10.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type gf: float
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param gf: the Object's SB New GoalFriction.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBMinGoal():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's SB MinGoal.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBMinGoal(mg):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's SB MinGoal.
|
|
|
|
|
Values between 0 to 1.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type mg: float
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param mg: the Object's SB New MinGoal.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBMaxGoal():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's SB MaxGoal.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBMaxGoal(mg):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's SB MaxGoal.
|
|
|
|
|
Values between 0 to 1.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type mg: float
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param mg: the Object's SB New MaxGoal.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBInnerSpring():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's SB InnerSpring.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBInnerSpring(sprr):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's SB InnerSpring.
|
|
|
|
|
Values between 0 to 0.999
|
|
|
|
|
@rtype: PyNone
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@type sprr: float
|
|
|
|
|
@param sprr: the Object's SB New InnerSpring.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBInnerSpringFriction():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's SB InnerSpringFriction.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBInnerSpringFriction(sprf):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's SB InnerSpringFriction.
|
|
|
|
|
Values between 0 to 10.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type sprf: float
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param sprf: the Object's SB New InnerSpringFriction.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBDefaultGoal():
|
|
|
|
|
"""
|
|
|
|
|
Get the Object's SB DefaultGoal.
|
|
|
|
|
@rtype: float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBDefaultGoal(goal):
|
|
|
|
|
"""
|
|
|
|
|
Set the the Object's SB DefaultGoal.
|
|
|
|
|
Values between 0 to 1.0
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type goal: float
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param goal: the Object's SB New DefaultGoal.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBEnable():
|
|
|
|
|
"""
|
|
|
|
|
Get if the Object's SB is Enabled.
|
|
|
|
|
@rtype: int
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBEnable(switch):
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Enable / Disable SoftBodies.
|
2005-04-14 17:56:37 +00:00
|
|
|
1: on
|
|
|
|
|
0: off
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type switch: int
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param switch: the Object's SB New Enable Value.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBPostDef():
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
get SoftBodies PostDef option
|
2005-04-14 17:56:37 +00:00
|
|
|
@rtype: int
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBPostDef(switch):
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Enable / Disable SoftBodies PostDef option
|
2005-04-14 17:56:37 +00:00
|
|
|
1: on
|
|
|
|
|
0: off
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type switch: int
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param switch: the Object's SB New PostDef Value.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBUseGoal():
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
get SoftBodies UseGoal option
|
2005-04-14 17:56:37 +00:00
|
|
|
@rtype: int
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBUseGoal(switch):
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Enable / Disable SoftBodies UseGoal option
|
2005-04-14 17:56:37 +00:00
|
|
|
1: on
|
|
|
|
|
0: off
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type switch: int
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param switch: the Object's SB New UseGoal Value.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
def getSBUseEdges():
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
get SoftBodies UseEdges option
|
2005-04-14 17:56:37 +00:00
|
|
|
@rtype: int
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBUseEdges(switch):
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Enable / Disable SoftBodies UseEdges option
|
2005-04-14 17:56:37 +00:00
|
|
|
1: on
|
|
|
|
|
0: off
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type switch: int
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param switch: the Object's SB New UseEdges Value.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getSBStiffQuads():
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
get SoftBodies StiffQuads option
|
2005-04-14 17:56:37 +00:00
|
|
|
@rtype: int
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setSBStiffQuads(switch):
|
|
|
|
|
"""
|
2005-10-11 15:11:39 +00:00
|
|
|
Enable / Disable SoftBodies StiffQuads option
|
2005-04-14 17:56:37 +00:00
|
|
|
1: on
|
|
|
|
|
0: off
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@type switch: int
|
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
|
|
|
@param switch: the Object's SB New StiffQuads Value.
|
2005-04-14 17:56:37 +00:00
|
|
|
"""
|
2005-11-15 21:33:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class Property:
|
|
|
|
|
"""
|
|
|
|
|
The Property object
|
|
|
|
|
===================
|
|
|
|
|
This property gives access to object property data in Blender.
|
|
|
|
|
@ivar name: The property name.
|
|
|
|
|
@ivar data: Data for this property. Depends on property type.
|
|
|
|
|
@ivar type: The property type.
|
|
|
|
|
@warn: Comparisons between properties will only be true when
|
|
|
|
|
both the name and data pairs are the same.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getName ():
|
|
|
|
|
"""
|
|
|
|
|
Get the name of this property.
|
|
|
|
|
@rtype: string
|
|
|
|
|
@return: The property name.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setName (name):
|
|
|
|
|
"""
|
|
|
|
|
Set the name of this property.
|
|
|
|
|
@type name: string
|
|
|
|
|
@param name: The new name of the property
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getData ():
|
|
|
|
|
"""
|
|
|
|
|
Get the data for this property.
|
|
|
|
|
@rtype: string, int, or float
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setData (data):
|
|
|
|
|
"""
|
|
|
|
|
Set the data for this property.
|
|
|
|
|
@type data: string, int, or float
|
|
|
|
|
@param data: The data to set for this property.
|
|
|
|
|
@warn: See object.setProperty(). Changing data
|
|
|
|
|
which is of a different type then the property is
|
|
|
|
|
set to (i.e. setting an int value to a float type'
|
|
|
|
|
property) will change the type of the property
|
|
|
|
|
automatically.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getType ():
|
|
|
|
|
"""
|
|
|
|
|
Get the type for this property.
|
|
|
|
|
@rtype: string
|
2005-11-17 18:35:11 +00:00
|
|
|
"""
|