Module Object :: Class Object
[frames | no frames]

Class Object


The Object object

This object gives access to generic data from all objects in Blender.
Method Summary
  addProperty(property)
Add a property to object.
  addScriptLink(text, event)
Add a new script link to this Object.
  buildParts()
Recomputes the particle system.
  clearIpo()
Unlinks the ipo from this object.
  clearScriptLinks(links)
Delete script links from this Object.
  clearTrack(mode, fast)
Make this Object not track another anymore.
  clrParent(mode, fast)
Clears parent object.
  copyAllPropertiesTo(object)
Copies all properties from one object to another.
Py_Action getAction()
Returns an action if one is associated with this object (only useful for armature types).
PyList getAllProperties()
Return a list of properties from this object.
list of 8 (x,y,z) float coordinate vectors (WRAPPED DATA) getBoundBox()
Returns the worldspace bounding box of this object.
specific Object type or string getData(name_only, mesh)
Returns the Datablock object (Mesh, Lamp, Camera, etc.) linked to this Object.
A vector triple getDeltaLocation()
Returns the object's delta location in a list (x, y, z)
Integer getDrawMode()
Returns the object draw mode.
Integer getDrawType()
Returns the object draw type
  getDupliVerts()
Get state of DupliVerts animation property
Py_Euler (WRAPPED DATA) getEuler()
Returns the object's localspace rotation as Euler rotation vector (rotX, rotY, rotZ).
Py_Matrix getInverseMatrix()
Returns the object's inverse matrix.
Ipo getIpo()
Returns the Ipo associated to this object or None if there's no linked ipo.
  getLocation()
Returns the object's location (x, y, z).
list of Material Objects getMaterials(what)
Returns a list of materials assigned to the object.
Py_Matrix (WRAPPED DATA) getMatrix(space)
Returns the object matrix.
  getName()
Returns the name of the object
Object getParent()
Returns the object's parent object.
String getParentBoneName()
Returns the object's parent object's sub name, or None.
int getPIDeflection()
Get the Object's Particle Interaction Deflection Setting.
float getPIFalloff()
Get the Object's Particle Interaction falloff.
float getPIMaxDist()
Get the Object's Particle Interaction MaxDist.
float getPIPermf()
Get the Object's Particle Interaction Permeability.
float getPIRandomDamp()
Get the Object's Particle Interaction RandomDamp.
float getPIStregth()
Get the Object's Particle Interaction Strength.
float getPISurfaceDamp()
Get the Object's Particle Interaction SurfaceDamp.
int getPIType()
Get the Object's Particle Interaction Type.
int getPIUseMaxDist()
Get the Object's Particle Interaction if using MaxDist.
Property object getProperty(name)
Return a properties from this object based on name.
float getSBDefaultGoal()
Get the Object's SB DefaultGoal.
int getSBEnable()
Get if the Object's SB is Enabled.
float getSBErrorLimit()
Get the Object's SB ErrorLimit.
float getSBFriction()
Get the Object's SB Friction.
float getSBGoalFriction()
Get the Object's SB GoalFriction.
float getSBGoalSpring()
Get the Object's SB GoalSpring.
float getSBGravity()
Get the Object's SB Gravity.
float getSBInnerSpring()
Get the Object's SB InnerSpring.
float getSBInnerSpringFriction()
Get the Object's SB InnerSpringFriction.
float getSBMass()
Get the Object's SB Mass.
float getSBMaxGoal()
Get the Object's SB MaxGoal.
float getSBMinGoal()
Get the Object's SB MinGoal.
int getSBPostDef()
get SoftBodies PostDef option
int getSBStiffQuads()
get SoftBodies StiffQuads option
int getSBUseEdges()
get SoftBodies UseEdges option
int getSBUseGoal()
get SoftBodies UseGoal option
list getScriptLinks(event)
Get a list with this Object's script links of type 'event'.
  getSize()
Returns the object's size.
  getTimeOffset()
Returns the time offset of the object's animation.
Object getTracked()
Returns the object's tracked object.
  getType()
Returns the type of the object.
  insertIpoKey(keytype)
Inserts keytype values in object ipo at curframe.
Boolean isSelected()
Returns the objects selection state in the current scene as a boolean value True or False.
  link(datablock)
Links Object with ObData datablock provided in the argument.
  makeDisplayList()
Updates this object's display list.
  makeParent(objects, noninverse, fast)
Makes the object the parent of the objects provided in the argument which must be a list of valid Objects.
  makeParentDeform(objects, noninverse, fast)
Makes the object the deformation parent of the objects provided in the argument which must be a list of valid Objects.
  makeParentVertex(objects, indices, noninverse, fast)
Makes the object the vertex parent of the objects provided in the argument which must be a list of valid Objects.
  makeTrack(tracked, fast)
Make this Object track another.
  removeAllProperties()
Removes all properties from an object.
  removeProperty(property)
Remove a property from an object.
  select(boolean)
Sets the object's selection state in the current scene.
  setDeltaLocation(delta_location)
Sets the object's delta location which must be a vector triple.
  setDrawMode(drawmode)
Sets the object's drawing mode.
  setDrawType(drawtype)
Sets the object's drawing type.
  setDupliVerts(data)
Set state of DupliVerts animation property
  setEuler(euler)
Sets the object's localspace rotation according to the specified Euler angles.
  setIpo(ipo)
Links an ipo to this object.
  setLocation(x, y, z)
Sets the object's location relative to the parent object (if any).
  setMaterials(materials)
Sets the materials.
  setMatrix(matrix)
Sets the object's matrix and updates it's transformation.
  setName(name)
Sets the name of the object.
PyNone setPIDeflection(status)
Set the the Object's Particle Interaction Deflection Setting.
PyNone setPIFalloff(falloff)
Set the the Object's Particle Interaction falloff.
PyNone setPIMaxDist(MaxDist)
Set the the Object's Particle Interaction MaxDist.
PyNone setPIPerm(perm)
Set the the Object's Particle Interaction Permeability.
PyNone setPIRandomDamp(damp)
Set the the Object's Particle Interaction RandomDamp.
PyNone setPIStrength(strength)
Set the the Object's Particle Interaction Strength.
PyNone setPISurfaceDamp(damp)
Set the the Object's Particle Interaction SurfaceDamp.
PyNone setPIType(type)
Set the the Object's Particle Interaction type.
PyNone setPIUseMaxDist(status)
Set the the Object's Particle Interaction MaxDist.
PyNone setSBDefaultGoal(goal)
Set the the Object's SB DefaultGoal.
PyNone setSBEnable(switch)
Enable / Disable SoftBodies.
PyNone setSBErrorLimit(err)
Set the the Object's SB ErrorLimit.
PyNone setSBFriction(frict)
Set the the Object's SB Friction.
PyNone setSBGoalFriction(gf)
Set the the Object's SB GoalFriction.
PyNone setSBGoalSpring(gs)
Set the the Object's SB GoalSpring.
PyNone setSBGravity(grav)
Set the the Object's SB Gravity.
PyNone setSBInnerSpring(sprr)
Set the the Object's SB InnerSpring.
PyNone setSBInnerSpringFriction(sprf)
Set the the Object's SB InnerSpringFriction.
PyNone setSBMass(mass)
Set the the Object's SB Mass.
PyNone setSBMaxGoal(mg)
Set the the Object's SB MaxGoal.
PyNone setSBMinGoal(mg)
Set the the Object's SB MinGoal.
PyNone setSBPostDef(switch)
Enable / Disable SoftBodies PostDef option 1: on 0: off
PyNone setSBStiffQuads(switch)
Enable / Disable SoftBodies StiffQuads option 1: on 0: off
PyNone setSBUseEdges(switch)
Enable / Disable SoftBodies UseEdges option 1: on 0: off
PyNone setSBUseGoal(switch)
Enable / Disable SoftBodies UseGoal option 1: on 0: off
  setSize(x, y, z)
Sets the object's size, relative to the parent object (if any)
  setTimeOffset(timeOffset)
Sets the time offset of the object's animation.
  shareFrom(object)
Link data of object specified in the argument with self.

Instance Variable Summary
  colbits: The Material usage mask.
  data: The data of the object.
  dloc: The delta (X,Y,Z) location coordinates of the object (vector).
  dLocX: The delta X location coordinate of the object.
  dLocY: The delta Y location coordinate of the object.
  dLocZ: The delta Z location coordinate of the object.
  drawMode: The object's drawing mode used.
  drawType: The object's drawing type used.
  drot: The delta (X,Y,Z) rotation angles (in radians) of the object (vector).
  dRotX: The delta X rotation angle (in radians) of the object.
  dRotY: The delta Y rotation angle (in radians) of the object.
  dRotZ: The delta Z rotation angle (in radians) of the object.
  dsize: The delta (X,Y,Z) size of the object.
  dSizeX: The delta X size of the object.
  dSizeY: The delta Y size of the object.
  dSizeZ: The delta Z size of the object.
  effects: The list of particle effects associated with the object.
  ipo: The ipo data associated with the object.
integer (bitmask) Layers: The object layers (also check the newer attribute layers).
list of integers layers: The layers this object is visible in (also check the older attribute Layers).
  loc: The (X,Y,Z) location coordinates of the object (vector).
  LocX: The X location coordinate of the object.
  LocY: The Y location coordinate of the object.
  LocZ: The Z location coordinate of the object.
  mat: alias for matrix: the matrix of the object in world space.
  matrix: The matrix of the object in world space, same as matrixWorld.
  matrixLocal: The matrix of the object relative to its parent.
  matrixWorld: The matrix of the object in world space.
  name: The name of the object.
  parent: The parent object of the object.
  parentbonename: The string name of the parent bone.
int protectFlags: The "transform locking" bitfield flags for the object.
  rot: The (X,Y,Z) rotation angles (in radians) of the object (vector).
  RotX: The X rotation angle (in radians) of the object.
  RotY: The Y rotation angle (in radians) of the object.
  RotZ: The Z rotation angle (in radians) of the object.
  sel: The selection state of the object in the current scene, 1 is selected, 0 is unselected.
  size: The (X,Y,Z) size of the object (vector).
  SizeX: The X size of the object.
  SizeY: The Y size of the object.
  SizeZ: The Z size of the object.
  track: The object tracking this object.
int users: The number of users of the object.

Method Details

addProperty(property)

Add a property to object.
Parameters:
property - property object to add to object.
           (type=Property object)

Warning: A property object can be added only once to an object' you must remove the property from an object to add it elsewhere.

addScriptLink(text, event)

Add a new script link to this Object.
Parameters:
text - the name of an existing Blender Text.
           (type=string)
event - "FrameChanged", "Redraw" or "Render".
           (type=string)

buildParts()

Recomputes the particle system. This method only applies to an Object of the type Effect.

clearIpo()

Unlinks the ipo from this object.
Returns:
True if there was an ipo linked or False otherwise.

clearScriptLinks(links=None)

Delete script links from this Object. If no list is specified, all script links are deleted.
Parameters:
links - None (default) or a list of Blender Text names.
           (type=list of strings)

clearTrack(mode=0, fast=0)

Make this Object not track another anymore.
Parameters:
mode - if nonzero the matrix transformation used for tracking is kept.
           (type=int (bool))
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 Scene.Scene.update).
           (type=int (bool))

clrParent(mode=0, fast=0)

Clears parent object.
Parameters:
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.
           (type=Integer)
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.
           (type=Integer)

copyAllPropertiesTo(object)

Copies all properties from one object to another.
Parameters:
object - Object that will receive the properties.
           (type=Object object)

getAction()

Returns an action if one is associated with this object (only useful for armature types).
Returns:
a python action.
           (type=Py_Action)

getAllProperties()

Return a list of properties from this object.
Returns:
List of Property objects.
           (type=PyList)

getBoundBox()

Returns the worldspace bounding box of this object. This works for meshes (out of edit mode) and curves.
Returns:
The coordinates of the 8 corners of the bounding box. Data is wrapped when bounding box is present.
           (type=list of 8 (x,y,z) float coordinate vectors (WRAPPED DATA))

getData(name_only=False, mesh=False)

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).
Parameters:
name_only - This is a keyword parameter. If True (or nonzero), only the name of the data object is returned.
           (type=bool)
mesh - This is a keyword parameter. If True (or nonzero), a Mesh data object is returned.
           (type=bool)
Returns:
Depends on the type of Datablock linked to the Object. If name_only is True, it returns a string.
           (type=specific Object type or string)

getDeltaLocation()

Returns the object's delta location in a list (x, y, z)
Returns:
(x, y, z)
           (type=A vector triple)

getDrawMode()

Returns the object draw mode.
Returns:
a sum of the following:
  • 2 - axis
  • 4 - texspace
  • 8 - drawname
  • 16 - drawimage
  • 32 - drawwire

           (type=Integer)

getDrawType()

Returns the object draw type
Returns:
One of the following:
  • 1 - Bounding box
  • 2 - Wire
  • 3 - Solid
  • 4 - Shaded
  • 5 - Textured

           (type=Integer)

getDupliVerts()

Get state of DupliVerts animation property
Returns:
a boolean value.

getEuler()

Returns the object's localspace rotation as Euler rotation vector (rotX, rotY, rotZ). Angles are in radians.
Returns:
A python Euler. Data is wrapped when euler is present.
           (type=Py_Euler (WRAPPED DATA))

getInverseMatrix()

Returns the object's inverse matrix.
Returns:
A python matrix 4x4
           (type=Py_Matrix)

getIpo()

Returns the Ipo associated to this object or None if there's no linked ipo.
Returns:
the wrapped ipo or None.
           (type=Ipo)

getLocation()

Returns the object's location (x, y, z).
Returns:

(x, y, z)

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()

getMaterials(what=0)

Returns a list of materials assigned to the object.
Parameters:
what - if nonzero, empty slots will be returned as None's instead of being ignored (default way). See NMesh.NMesh.getMaterials.
           (type=int)
Returns:
list of Material Objects assigned to the object.
           (type=list of Material Objects)

getMatrix(space='worldspace')

Returns the object matrix.
Parameters:
space - The desired matrix:
  • worldspace (default): absolute, taking vertex parents, tracking and Ipo's into account;
  • 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.
Returns the object matrix.
           (type=string)
Returns:
a python 4x4 matrix object. Data is wrapped for 'worldspace'
           (type=Py_Matrix (WRAPPED DATA))

getName()

Returns the name of the object
Returns:

The name of the object

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()

getParent()

Returns the object's parent object.
Returns:
The parent object of the object. If not available, None will be returned.
           (type=Object)

getParentBoneName()

Returns the object's parent object's sub name, or None. For objects parented to bones, this is the name of the bone.
Returns:
The parent object sub-name of the object. If not available, None will be returned.
           (type=String)

getPIDeflection()

Get the Object's Particle Interaction Deflection Setting.
Returns:
int

getPIFalloff()

Get the Object's Particle Interaction falloff.
Returns:
float

getPIMaxDist()

Get the Object's Particle Interaction MaxDist.
Returns:
float

getPIPermf()

Get the Object's Particle Interaction Permeability.
Returns:
float

getPIRandomDamp()

Get the Object's Particle Interaction RandomDamp.
Returns:
float

getPIStregth()

Get the Object's Particle Interaction Strength.
Returns:
float

getPISurfaceDamp()

Get the Object's Particle Interaction SurfaceDamp.
Returns:
float

getPIType()

Get the Object's Particle Interaction Type.
Returns:
int

getPIUseMaxDist()

Get the Object's Particle Interaction if using MaxDist.
Returns:
int

getProperty(name)

Return a properties from this object based on name.
Parameters:
name - the name of the property to get.
           (type=string)
Returns:
The first property that matches name.
           (type=Property object)

getSBDefaultGoal()

Get the Object's SB DefaultGoal.
Returns:
float

getSBEnable()

Get if the Object's SB is Enabled.
Returns:
int

getSBErrorLimit()

Get the Object's SB ErrorLimit.
Returns:
float

getSBFriction()

Get the Object's SB Friction.
Returns:
float

getSBGoalFriction()

Get the Object's SB GoalFriction.
Returns:
float

getSBGoalSpring()

Get the Object's SB GoalSpring.
Returns:
float

getSBGravity()

Get the Object's SB Gravity.
Returns:
float

getSBInnerSpring()

Get the Object's SB InnerSpring.
Returns:
float

getSBInnerSpringFriction()

Get the Object's SB InnerSpringFriction.
Returns:
float

getSBMass()

Get the Object's SB Mass.
Returns:
float

getSBMaxGoal()

Get the Object's SB MaxGoal.
Returns:
float

getSBMinGoal()

Get the Object's SB MinGoal.
Returns:
float

getSBPostDef()

get SoftBodies PostDef option
Returns:
int

getSBStiffQuads()

get SoftBodies StiffQuads option
Returns:
int

getSBUseEdges()

get SoftBodies UseEdges option
Returns:
int

getSBUseGoal()

get SoftBodies UseGoal option
Returns:
int

getScriptLinks(event)

Get a list with this Object's script links of type 'event'.
Parameters:
event - "FrameChanged", "Redraw" or "Render".
           (type=string)
Returns:
a list with Blender Text names (the script links of the given 'event' type) or None if there are no script links at all.
           (type=list)

getSize()

Returns the object's size.
Returns:
(SizeX, SizeY, SizeZ)

getTimeOffset()

Returns the time offset of the object's animation.
Returns:
TimeOffset

getTracked()

Returns the object's tracked object.
Returns:
The tracked object of the object. If not available, None will be returned.
           (type=Object)

getType()

Returns the type of the object.
Returns:

The type of object.

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, the camera will rotate 180 degrees and moved to the opposite side of the X axis. Note that the number 'pi' in the example is an approximation of the true number 'pi'. A better, less error-prone value of pi is math.pi from the python math module.:
   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()

insertIpoKey(keytype)

Inserts keytype values in object ipo at curframe. Uses module constants.
Parameters:
keytype - -LOC -ROT -SIZE -LOCROT -LOCROTSIZE -PI_STRENGTH -PI_FALLOFF -PI_PERM -PI_SURFACEDAMP -PI_RANDOMDAMP
           (type=Integer)
Returns:
py_none

isSelected()

Returns the objects selection state in the current scene as a boolean value True or False.
Returns:
Selection state as True or False
           (type=Boolean)

link(datablock)

Links Object with ObData datablock provided in the argument. The data must match the Object's type, so you cannot link a Lamp to a Mesh type object.
Parameters:
datablock - A Blender datablock matching the objects type.
           (type=Blender ObData datablock)

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:

Example:
object = Blender.Object.Get("Sphere")
nmesh = object.getData()
nmesh.setMode("SubSurf")
nmesh.update() # don't forget to update!
object.makeDisplayList()
Blender.Window.Redraw()
If you try this example without the line to update the display list, the object will disappear from the screen until you press "SubSurf".

Warning: 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.

makeParent(objects, noninverse=0, fast=0)

Makes the object the parent of the objects provided in the argument which must be a list of valid Objects.
Parameters:
objects - The children of the parent
           (type=Sequence of Blender Object)
noninverse - 0 - make parent with inverse 1 - make parent without inverse
           (type=Integer)
fast - 0 - update scene hierarchy automatically 1 - don't update scene hierarchy (faster). In this case, you must explicitely update the Scene hierarchy.
           (type=Integer)

Warning: 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.

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.
Parameters:
objects - The children of the parent
           (type=Sequence of Blender Object)
noninverse - 0 - make parent with inverse 1 - make parent without inverse
           (type=Integer)
fast - 0 - update scene hierarchy automatically 1 - don't update scene hierarchy (faster). In this case, you must explicitely update the Scene hierarchy.
           (type=Integer)

Warnings:

  • 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.
  • child objects must be of mesh type to deform correctly. Other object types will fall back to normal parenting silently.

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.
Parameters:
objects - The children of the parent
           (type=Sequence of Blender Object)
indices - The indices of the vertices you want to parent to (1 or 3 values)
           (type=Tuple of Integers)
noninverse - 0 - make parent with inverse 1 - make parent without inverse
           (type=Integer)
fast - 0 - update scene hierarchy automatically 1 - don't update scene hierarchy (faster). In this case, you must explicitely update the Scene hierarchy.
           (type=Integer)

Warning: 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.

makeTrack(tracked, fast=0)

Make this Object track another.
Parameters:
tracked - the object to be tracked.
           (type=Blender Object)
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 Scene.Scene.update).
           (type=int (bool))

Note: you also need to clear the rotation (setEuler) of this object if it was not (0,0,0) already.

removeAllProperties()

Removes all properties from an object.

removeProperty(property)

Remove a property from an object.
Parameters:
property - property object to remove.
           (type=Property object)

select(boolean)

Sets the object's selection state in the current scene.
Parameters:
boolean -
  • 0 - unselected
  • 1 - selected

           (type=Integer)

setDeltaLocation(delta_location)

Sets the object's delta location which must be a vector triple.
Parameters:
delta_location - A vector triple (x, y, z) specifying the new location.
           (type=A vector triple)

setDrawMode(drawmode)

Sets the object's drawing mode. The drawing mode can be a mix of modes. To enable these, add up the values.
Parameters:
drawmode - A sum of the following:
  • 2 - axis
  • 4 - texspace
  • 8 - drawname
  • 16 - drawimage
  • 32 - drawwire

           (type=Integer)

setDrawType(drawtype)

Sets the object's drawing type.
Parameters:
drawtype - One of the following:
  • 1 - Bounding box
  • 2 - Wire
  • 3 - Solid
  • 4 - Shaded
  • 5 - Textured

           (type=Integer)

setDupliVerts(data)

Set state of DupliVerts animation property
Parameters:
data - boolean value True, False, 0 or not 0.

setEuler(euler)

Sets the object's localspace rotation according to the specified Euler angles.
Parameters:
euler - a python Euler or x,y,z rotations as floats
           (type=Py_Euler or a list of floats)

setIpo(ipo)

Links an ipo to this object.
Parameters:
ipo - an object type ipo.
           (type=Blender Ipo)

setLocation(x, y, z)

Sets the object's location relative to the parent object (if any).
Parameters:
x - The X coordinate of the new location.
           (type=float)
y - The Y coordinate of the new location.
           (type=float)
z - The Z coordinate of the new location.
           (type=float)

setMaterials(materials)

Sets the materials. The argument must be a list 16 items or less. Each list element is either a Material or None. Also see colbits.
Parameters:
materials - A list of Blender material objects.
           (type=Materials list)

setMatrix(matrix)

Sets the object's matrix and updates it's transformation.
Parameters:
matrix - a python matrix 4x4.
           (type=Py_Matrix 4x4)

setName(name)

Sets the name of the object. A string longer then 20 characters will be shortened.
Parameters:
name - The new name for the object.
           (type=String)

setPIDeflection(status)

Set the the Object's Particle Interaction Deflection Setting. 0 = Off, 1 = on
Parameters:
status - the new status
           (type=int)
Returns:
PyNone

setPIFalloff(falloff)

Set the the Object's Particle Interaction falloff. Values between 0 to 10.0
Parameters:
falloff - the Object's Particle Interaction New falloff.
           (type=float)
Returns:
PyNone

setPIMaxDist(MaxDist)

Set the the Object's Particle Interaction MaxDist. Values between 0 to 1000.0
Parameters:
MaxDist - the Object's Particle Interaction New MaxDist.
           (type=float)
Returns:
PyNone

setPIPerm(perm)

Set the the Object's Particle Interaction Permeability. Values between 0 to 10.0
Parameters:
perm - the Object's Particle Interaction New Permeability.
           (type=float)
Returns:
PyNone

setPIRandomDamp(damp)

Set the the Object's Particle Interaction RandomDamp. Values between 0 to 10.0
Parameters:
damp - the Object's Particle Interaction New RandomDamp.
           (type=float)
Returns:
PyNone

setPIStrength(strength)

Set the the Object's Particle Interaction Strength. Values between -1000.0 to 1000.0
Parameters:
strength - the Object's Particle Interaction New Strength.
           (type=float)
Returns:
PyNone

setPISurfaceDamp(damp)

Set the the Object's Particle Interaction SurfaceDamp. Values between 0 to 10.0
Parameters:
damp - the Object's Particle Interaction New SurfaceDamp.
           (type=float)
Returns:
PyNone

setPIType(type)

Set the the Object's Particle Interaction type. Use Module Constants
  • NONE
  • WIND
  • FORCE
  • VORTEX
  • MAGNET
Parameters:
type - the Object's Particle Interaction Type.
           (type=int)
Returns:
PyNone

setPIUseMaxDist(status)

Set the the Object's Particle Interaction MaxDist. 0 = Off, 1 = on
Parameters:
status - the new status
           (type=int)
Returns:
PyNone

setSBDefaultGoal(goal)

Set the the Object's SB DefaultGoal. Values between 0 to 1.0
Parameters:
goal - the Object's SB New DefaultGoal.
           (type=float)
Returns:
PyNone

setSBEnable(switch)

Enable / Disable SoftBodies. 1: on 0: off
Parameters:
switch - the Object's SB New Enable Value.
           (type=int)
Returns:
PyNone

setSBErrorLimit(err)

Set the the Object's SB ErrorLimit. Values between 0 to 1.0
Parameters:
err - the Object's SB New ErrorLimit.
           (type=float)
Returns:
PyNone

setSBFriction(frict)

Set the the Object's SB Friction. Values between 0 to 10.0
Parameters:
frict - the Object's SB New Friction.
           (type=float)
Returns:
PyNone

setSBGoalFriction(gf)

Set the the Object's SB GoalFriction. Values between 0 to 10.0
Parameters:
gf - the Object's SB New GoalFriction.
           (type=float)
Returns:
PyNone

setSBGoalSpring(gs)

Set the the Object's SB GoalSpring. Values between 0 to 0.999
Parameters:
gs - the Object's SB New GoalSpring.
           (type=float)
Returns:
PyNone

setSBGravity(grav)

Set the the Object's SB Gravity. Values between 0 to 10.0
Parameters:
grav - the Object's SB New Gravity.
           (type=float)
Returns:
PyNone

setSBInnerSpring(sprr)

Set the the Object's SB InnerSpring. Values between 0 to 0.999
Parameters:
sprr - the Object's SB New InnerSpring.
           (type=float)
Returns:
PyNone

setSBInnerSpringFriction(sprf)

Set the the Object's SB InnerSpringFriction. Values between 0 to 10.0
Parameters:
sprf - the Object's SB New InnerSpringFriction.
           (type=float)
Returns:
PyNone

setSBMass(mass)

Set the the Object's SB Mass. Values between 0 to 50.0
Parameters:
mass - the Object's SB New mass.
           (type=float)
Returns:
PyNone

setSBMaxGoal(mg)

Set the the Object's SB MaxGoal. Values between 0 to 1.0
Parameters:
mg - the Object's SB New MaxGoal.
           (type=float)
Returns:
PyNone

setSBMinGoal(mg)

Set the the Object's SB MinGoal. Values between 0 to 1.0
Parameters:
mg - the Object's SB New MinGoal.
           (type=float)
Returns:
PyNone

setSBPostDef(switch)

Enable / Disable SoftBodies PostDef option 1: on 0: off
Parameters:
switch - the Object's SB New PostDef Value.
           (type=int)
Returns:
PyNone

setSBStiffQuads(switch)

Enable / Disable SoftBodies StiffQuads option 1: on 0: off
Parameters:
switch - the Object's SB New StiffQuads Value.
           (type=int)
Returns:
PyNone

setSBUseEdges(switch)

Enable / Disable SoftBodies UseEdges option 1: on 0: off
Parameters:
switch - the Object's SB New UseEdges Value.
           (type=int)
Returns:
PyNone

setSBUseGoal(switch)

Enable / Disable SoftBodies UseGoal option 1: on 0: off
Parameters:
switch - the Object's SB New UseGoal Value.
           (type=int)
Returns:
PyNone

setSize(x, y, z)

Sets the object's size, relative to the parent object (if any)
Parameters:
x - The X size multiplier.
           (type=float)
y - The Y size multiplier.
           (type=float)
z - The Z size multiplier.
           (type=float)

setTimeOffset(timeOffset)

Sets the time offset of the object's animation.
Parameters:
timeOffset - The new time offset for the object's animation.
           (type=float)

shareFrom(object)

Link data of object specified in the argument with self. This works only if self and the object specified are of the same type.
Parameters:
object - A Blender Object of the same type.
           (type=Blender Object)

Instance Variable Details

colbits

The Material usage mask. A set bit #n means: the Material #n in the Object's material list is used. Otherwise, the Material #n of the Objects Data material list is displayed. Example:
   object.colbits = 0x21 # use mesh materials 0 (0x01) and 5 (0x20)
                         # use object materials for all others

data

The data of the object. (Read-only)

dloc

The delta (X,Y,Z) location coordinates of the object (vector). This variable applies to IPO Objects only.

dLocX

The delta X location coordinate of the object. This variable applies to IPO Objects only.

dLocY

The delta Y location coordinate of the object. This variable applies to IPO Objects only.

dLocZ

The delta Z location coordinate of the object. This variable applies to IPO Objects only.

drawMode

The object's drawing mode used. The value can be a sum of: 2 - axis, 4 - texspace, 8 - drawname, 16 - drawimage, 32 - drawwire.

drawType

The object's drawing type used. 1 - Bounding box, 2 - wire, 3 - Solid, 4- Shaded, 5 - Textured.

drot

The delta (X,Y,Z) rotation angles (in radians) of the object (vector). This variable applies to IPO Objects only.

dRotX

The delta X rotation angle (in radians) of the object. This variable applies to IPO Objects only.

dRotY

The delta Y rotation angle (in radians) of the object. This variable applies to IPO Objects only.

dRotZ

The delta Z rotation angle (in radians) of the object. This variable applies to IPO Objects only.

dsize

The delta (X,Y,Z) size of the object.

dSizeX

The delta X size of the object.

dSizeY

The delta Y size of the object.

dSizeZ

The delta Z size of the object.

effects

The list of particle effects associated with the object. (Read-only)

ipo

The ipo data associated with the object. (Read-only)

Layers

The object layers (also check the newer attribute layers). This value is a bitmask with at 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. Example:
 ob.Layer = 0x04 # sets layer 3 ( bit pattern 0100 )
After setting the Layer value, call Blender.Redraw( -1 ) to update the interface.
Type:
integer (bitmask)

layers

The layers this object is visible in (also check the older attribute Layers). This returns a list of 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]
Note: changes will only be visible after the screen (at least the 3d View and Buttons windows) is redrawn.
Type:
list of integers

loc

The (X,Y,Z) location coordinates of the object (vector).

LocX

The X location coordinate of the object.

LocY

The Y location coordinate of the object.

LocZ

The Z location coordinate of the object.

mat

alias for matrix: the matrix of the object in world space. (Read-only)

matrix

The matrix of the object in world space, same as matrixWorld. (Read-only)

matrixLocal

The matrix of the object relative to its parent. (Read-only)

matrixWorld

The matrix of the object in world space. (Read-only)

name

The name of the object.

parent

The parent object of the object. (Read-only)

parentbonename

The string name of the parent bone.

protectFlags

The "transform locking" bitfield flags for the object. Setting bits lock the following attributes:
  • 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
Type:
int

rot

The (X,Y,Z) rotation angles (in radians) of the object (vector).

RotX

The X rotation angle (in radians) of the object.

RotY

The Y rotation angle (in radians) of the object.

RotZ

The Z rotation angle (in radians) of the object.

sel

The selection state of the object in the current scene, 1 is selected, 0 is unselected.

size

The (X,Y,Z) size of the object (vector).

SizeX

The X size of the object.

SizeY

The Y size of the object.

SizeZ

The Z size of the object.

track

The object tracking this object. (Read-only)

users

The number of users of the object. Read-only.
Type:
int

Generated by Epydoc 2.1 on Thu Dec 22 22:38:12 2005 http://epydoc.sf.net