| Home | Trees | Index | Help |
|
|---|
| Module Object :: Class Object |
|
This object gives access to generic data from all objects in Blender.
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 object's parent (if any).
To get these values in worldspace (taking into account vertex parents, constraints, etc.) pass the argument 'worldspace' to these functions.| Method Summary | |
|---|---|
Add or create a game property for an object. | |
Add a new script link to this Object. | |
Recomputes the particle system. | |
Unlinks the ipo from this object. | |
Delete script links from this Object. | |
Make this Object not track another anymore. | |
Clears parent object. | |
Copies all game properties from one object to another. | |
Evaluates the Pose based on its currently bound action at a certain frame. | |
| Py_Action |
Returns an action if one is associated with this object (only useful for armature types). |
| PyList |
Return a list of all game properties from this object. |
| list of 8 (x,y,z) float coordinate vectors (WRAPPED DATA) |
Returns the worldspace bounding box of this object. |
| specific Object type or string |
Returns the Datablock object (Mesh, Lamp, Camera, etc.) linked to this Object. |
| A vector triple |
Returns the object's delta location in a list (x, y, z) |
| Integer |
Returns the object draw mode. |
| Integer |
Returns the object draw type |
| Py_Euler |
Return a python Euler. |
| Py_Matrix |
Returns the object's inverse matrix. |
| Ipo |
Returns the Ipo associated to this object or None if there's no linked ipo. |
Return (x, y, z) | |
| list of Material Objects |
Returns a list of materials assigned to the object. |
| Py_Matrix (WRAPPED DATA) |
Returns the object matrix. |
Returns the name of the object | |
| Object |
Returns the object's parent object. |
| String |
Returns the object's parent object's sub name, or None. |
| int |
Get the Object's Particle Interaction Deflection Setting. |
| float |
Get the Object's Particle Interaction falloff. |
| float |
Get the Object's Particle Interaction MaxDist. |
| float |
Get the Object's Particle Interaction Permeability. |
| float |
Get the Object's Particle Interaction RandomDamp. |
| float |
Get the Object's Particle Interaction Strength. |
| float |
Get the Object's Particle Interaction SurfaceDamp. |
| int |
Get the Object's Particle Interaction Type. |
| int |
Get the Object's Particle Interaction if using MaxDist. |
| Pose object |
Gets the current Pose of the object. |
| Property object |
Return a game property from this object matching the name argument. |
| float |
Get the Object's SoftBody DefaultGoal. |
| float |
Get the Object's SoftBody ErrorLimit. |
| float |
Get the Object's SoftBody Friction. |
| float |
Get the Object's SoftBody GoalFriction. |
| float |
Get the Object's SoftBody GoalSpring. |
| float |
Get the Object's SoftBody Gravity. |
| float |
Get the Object's SoftBody InnerSpring. |
| float |
Get the Object's SoftBody InnerSpringFriction. |
| float |
Get the Object's SoftBody Mass. |
| float |
Get the Object's SoftBody MaxGoal. |
| float |
Get the Object's SoftBody MinGoal. |
| int |
get SoftBodies PostDef option |
| int |
get SoftBodies StiffQuads option |
| int |
get SoftBodies UseEdges option |
| int |
get SoftBodies UseGoal option |
| list |
Get a list with this Object's script links of type 'event'. |
Return (SizeX, SizeY, SizeZ) | |
Returns the time offset of the object's animation. | |
| Object |
Returns the object's tracked object. |
| String |
Returns the type of the object in 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice', 'Mball', 'Mesh', 'Surf', 'Empty', 'Wave' (deprecated) or 'unknown' in exceptional cases. |
Inserts keytype values in object ipo at curframe. | |
Insert a Shape Key in the current object. | |
| boolean |
Returns the Object's SoftBody enabled state. |
| Boolean |
Returns the objects selection state in the current scene as a boolean value True or False. |
Uses the object as a base for all of the objects in the provided list to join into. | |
Links Object with ObData datablock provided in the argument. | |
Updates this object's display list. | |
Makes the object the parent of the objects provided in the argument which must be a list of valid Objects. | |
Makes one of the object's bones the parent of the objects provided in the argument which must be a list of valid objects. | |
Makes the object the deformation parent of the objects provided in the argument which must be a list of valid Objects. | |
Makes the object the vertex parent of the objects provided in the argument which must be a list of valid Objects. | |
Make this Object track another. | |
Removes all game properties from an object. | |
Remove a game property from an object. | |
Sets the object's selection state in the current scene. | |
Sets the object's delta location which must be a vector triple. | |
Sets the object's drawing mode. | |
Sets the object's drawing type. | |
Sets the object's localspace rotation according to the specified Euler angles. | |
Links an ipo to this object. | |
Sets the object's location relative to the parent object (if any). | |
Sets the materials. | |
Sets the object's matrix and updates its transformation. | |
Sets the name of the object. | |
| None |
Set the Object's Particle Interaction Deflection Setting. |
| None |
Set the Object's Particle Interaction falloff. |
| None |
Set the Object's Particle Interaction MaxDist. |
| None |
Set the Object's Particle Interaction Permeability. |
| None |
Set the Object's Particle Interaction RandomDamp. |
| None |
Set the Object's Particle Interaction Strength. |
| None |
Set the Object's Particle Interaction SurfaceDamp. |
| None |
Set the Object's Particle Interaction type. |
| None |
Set the Object's Particle Interaction MaxDist. |
| None |
Set the Object's SoftBody DefaultGoal. |
| None |
Set the Object's SoftBody ErrorLimit. |
| None |
Set the Object's SoftBody Friction. |
| None |
Set the Object's SoftBody GoalFriction. |
| None |
Set the Object's SoftBody GoalSpring. |
| None |
Set the Object's SoftBody Gravity. |
| None |
Set the Object's SoftBody InnerSpring. |
| None |
Set the Object's SoftBody InnerSpringFriction. |
| None |
Set the Object's SoftBody Mass. |
| None |
Set the Object's SoftBody MaxGoal. |
| None |
Set the Object's SoftBody MinGoal. |
| None |
Enable / Disable SoftBodies PostDef option 1: on 0: off |
| None |
Enable / Disable SoftBodies StiffQuads option 1: on 0: off |
| None |
Enable / Disable SoftBodies UseEdges option 1: on 0: off |
| None |
Enable / Disable SoftBodies UseGoal option 1: on 0: off |
Sets the object's size, relative to the parent object (if any), clamped | |
Sets the time offset of the object's animation. | |
Link data of a specified argument with this object. | |
| Instance Variable Summary | |
|---|---|
Action or None |
action: The action associated with this object (if defined). |
| BPy_ActionStrips | actionStrips: a sequence of action
strips for the object. |
| int | activeMaterial: The active material index for this object. |
| boolean | axis: Enable display of active object's center and axis. |
| list of 8 3D vectors | boundingBox: The bounding box of this object. |
colbits: The Material usage mask. | |
| Constraint Sequence | constraints: a sequence of constraints for the object. |
| varies | data: The Datablock object linked to this object. |
| tuple of 3 floats | dloc: The delta (X,Y,Z) location coordinates of the object (vector). |
| float | dLocX: The delta X location coordinate of the object. |
| float | dLocY: The delta Y location coordinate of the object. |
| float | dLocZ: The delta Z location coordinate of the object. |
| int | drawMode: The object's drawing mode bitfield. |
| float | drawSize: The size to display the Empty. |
| int | drawType: The object's drawing type. |
| tuple of 3 floats | drot: The delta (X,Y,Z) rotation angles (in radians) of the object. |
| float | dRotX: The delta X rotation angle (in radians) of the object. |
| float | dRotY: The delta Y rotation angle (in radians) of the object. |
| float | dRotZ: The delta Z rotation angle (in radians) of the object. |
| tuple of 3 floats | dsize: The delta (X,Y,Z) size of the object. |
| float | dSizeX: The delta X size of the object. |
| float | dSizeY: The delta Y size of the object. |
| float | dSizeZ: The delta Z size of the object. |
| int | DupEnd: The DupliFrame end frame. |
| Group or None | DupGroup: The DupliGroup Animation Property. |
| list of tuples containing (object, matrix) | DupObjects: The Dupli object instances. |
| int | DupOff: The DupliFrame removal of every Nth frame for this object. |
| int | DupOn: The DupliFrames in succession between DupOff frames. |
| int | DupSta: The DupliFrame starting frame. |
| list of Effect objects | effects: The list of particle effects associated with the object. |
| boolean | enableDupFaces: The DupliFaces status of the object. |
| boolean | enableDupFacesScale: The DupliFacesScale status of the object. |
| boolean | enableDupFrames: The DupliFrames status of the object. |
| boolean | enableDupGroup: The DupliGroup status of the object. |
| boolean | enableDupNoSpeed: The DupliNoSpeed status of the object. |
| boolean | enableDupRot: The DupliRot status of the object. |
| boolean | enableDupVerts: The DupliVerts status of the object. |
| boolean | enableNLAOverride: Whether the object uses NLA or active Action for animation. |
| bool | fakeUser: The fake user status. |
| list of Properties. | game_properties: The object's properties. |
| Ipo | ipo: Contains the Ipo if one is assigned to the object, None
otherwise. |
| boolean | isSoftBody: True if object is a soft body. |
| list of integers | layers: The layers this object is visible in (also check the older attribute
Layers). |
| integer (bitmask) | Layers: The object layers (also check the newer attribute layers). |
| tuple of 3 floats | loc: The (X,Y,Z) location coordinates of the object. |
| float | LocX: The X location coordinate of the object. |
| float | LocY: The Y location coordinate of the object. |
| float | LocZ: The Z location coordinate of the object. |
| Matrix | mat: The matrix of the object in world space (absolute, takes vertex
parents, tracking and Ipos into account). |
| Matrix | matrix: Same as mat. |
| Matrix | matrixLocal: The matrix of the object relative to its parent; if there is no
parent, returns the world matrix (matrixWorld). |
| Matrix | matrixOldWorld: Old-type worldspace matrix (prior to Blender 2.34). |
| Matrix | matrixWorld: Same as mat. |
Modifier Sequence |
modifiers: The modifiers associated with the object. |
| string | name: Object data name. |
| boolean | nameMode: Enable display of active object's name. |
| tuple of 2 floats | oopsLoc: Object's (X,Y) OOPs location. |
| boolean | oopsSel: Object OOPs selection flag. |
| Object or None | parent: The parent object of the object (if defined). |
| string or None | parentbonename: The string name of the parent bone (if defined). |
| int | parentType: The object's parent type. |
| int | passIndex: Index # for the IndexOB render pass. |
| float | piFalloff: The particle interaction falloff power. |
| float | piMaxDist: Max distance for the particle interaction field to work. |
| float | piPermeability: Probability that a particle will pass through the mesh. |
| float | piRandomDamp: Random variation of particle interaction damping. |
| float | piSoftbodyDamp: Damping factor for softbody deflection. |
| float | piSoftbodyIThick: Inner face thickness for softbody deflection. |
| float | piSoftbodyOThick: Outer face thickness for softbody deflection. |
| float | piStrength: Particle interaction force field strength. |
| float | piSurfaceDamp: Amount of damping during particle collision. |
| int | piType: Type of particle interaction. |
| boolean | piUseMaxDist: Use a maximum distance for the field to work. |
IDGroup |
properties: Returns an IDGroup reference to this object's ID
Properties. |
| int | protectFlags: The "transform locking" bitfield flags for the object. |
| int | rbFlags: Rigid body bitfield. |
| float | rbMass: Rigid body mass. |
| float | rbRadius: Rigid body bounding sphere size. |
| int | rbShapeBoundType: Rigid body shape bound type. |
| bool | restrictDisplay: Don't display this object in the 3D view: disabled by default, use the
outliner to toggle. |
| bool | restrictRender: Don't render this object: disabled by default, use the outliner to
toggle. |
| bool | restrictSelect: Don't select this object in the 3D view: disabled by default, use the
outliner to toggle. |
| euler (Py_WRAPPED) | rot: The (X,Y,Z) rotation angles (in radians) of the object. |
| float | RotX: The X rotation angle (in radians) of the object. |
| float | RotY: The Y rotation angle (in radians) of the object. |
| float | RotZ: The Z rotation angle (in radians) of the object. |
| float | SBDefaultGoal: Default softbody goal value, when no vertex group used. |
| float | SBErrorLimit: Softbody Runge-Kutta ODE solver error limit (low values give more
precision). |
| float | SBFriction: General media friction for softbody point movements. |
| float | SBGoalFriction: Softbody goal (vertex target position) friction. |
| float | SBGoalSpring: Softbody goal (vertex target position) spring stiffness. |
| float | SBGrav: Apply gravitation to softbody point movement. |
| float | SBInnerSpring: Softbody edge spring stiffness. |
| float | SBInnerSpringFrict: Softbody edge spring friction. |
| float | SBMass: Softbody point mass (heavier is slower). |
| float | SBMaxGoal: Softbody goal maximum (vertex group weights scaled to match this
range). |
| float | SBMinGoal: Softbody goal minimum (vertex group weights scaled to match this
range). |
| float | SBSpeed: Tweak timing for physics to control softbody frequency and speed. |
| boolean | SBStiffQuads: Softbody adds diagonal springs on 4-gons enabled. |
| boolean | SBUseEdges: Softbody use edges as springs enabled. |
| boolean | SBUseGoal: Softbody forces for vertices to stick to animated position
enabled. |
| boolean | sel: The selection state of the object in the current scene. |
| tuple of 3 floats | size: The (X,Y,Z) size of the object. |
| float | SizeX: The X size of the object. |
| float | SizeY: The Y size of the object. |
| float | SizeZ: The Z size of the object. |
| boolean | texSpace: Enable display of active object's texture space. |
| float | timeOffset: The time offset of the object's animation. |
| Object or None | track: The object's tracked object. |
| boolean | transp: Enable transparent materials for the active object (mesh only). |
| string | type: The object's type. |
| int | users: The number of users of the object. |
| boolean | wireMode: Enable the active object's wireframe over solid drawing. |
| boolean | xRay: Enable drawing the active object in front of others. |
| Method Details |
|---|
addProperty(name_or_property, data, type)Add or create a game property for an object. If called with only a property object, the property is assigned to the object. If called with a property name string and data object, a new property is created and added to the object.
|
addScriptLink(text, event)Add a new script link to this Object.
|
buildParts()Recomputes the particle system. This method only applies to an Object of the type Effect. |
clearIpo()Unlinks the ipo from this object.
|
clearScriptLinks(links=None)Delete script links from this Object. If no list is specified, all script links are deleted.
|
clearTrack(mode=0, fast=0)Make this Object not track another anymore.
|
clrParent(mode=0, fast=0)Clears parent object.
|
copyAllPropertiesTo(object)Copies all game properties from one object to another.
|
evaluatePose(framenumber)Evaluates the Pose based on its currently bound action at a certain frame.
|
getAction()Returns an action if one is associated with this object (only useful for armature types).
|
getAllProperties()Return a list of all game properties from this object.
|
getBoundBox()Returns the worldspace bounding box of this object. This works for meshes (out of edit mode) and curves.
|
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). The mesh keyword is ignored for non-mesh objects.
|
getDeltaLocation()Returns the object's delta location in a list (x, y, z)
|
getDrawMode()Returns the object draw mode.
|
getDrawType()Returns the object draw type
|
getEuler(space)
|
getInverseMatrix()Returns the object's inverse matrix.
|
getIpo()Returns the Ipo associated to this object or None if there's no linked ipo.
|
getLocation(space)
|
getMaterials(what=0)Returns a list of materials assigned to the object.
|
getMatrix(space='worldspace')Returns the object matrix.
|
getName()Returns the name of the object
|
getParent()Returns the object's parent 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.
|
getPIDeflection()Get the Object's Particle Interaction Deflection Setting.
|
getPIFalloff()Get the Object's Particle Interaction falloff.
|
getPIMaxDist()Get the Object's Particle Interaction MaxDist.
|
getPIPermf()Get the Object's Particle Interaction Permeability.
|
getPIRandomDamp()Get the Object's Particle Interaction RandomDamp.
|
getPIStregth()Get the Object's Particle Interaction Strength.
|
getPISurfaceDamp()Get the Object's Particle Interaction SurfaceDamp.
|
getPIType()Get the Object's Particle Interaction Type.
|
getPIUseMaxDist()Get the Object's Particle Interaction if using MaxDist.
|
getPose()Gets the current Pose of the object.
|
getProperty(name)Return a game property from this object matching the name argument.
|
getSBDefaultGoal()Get the Object's SoftBody DefaultGoal.
|
getSBErrorLimit()Get the Object's SoftBody ErrorLimit.
|
getSBFriction()Get the Object's SoftBody Friction.
|
getSBGoalFriction()Get the Object's SoftBody GoalFriction.
|
getSBGoalSpring()Get the Object's SoftBody GoalSpring.
|
getSBGravity()Get the Object's SoftBody Gravity.
|
getSBInnerSpring()Get the Object's SoftBody InnerSpring.
|
getSBInnerSpringFriction()Get the Object's SoftBody InnerSpringFriction.
|
getSBMass()Get the Object's SoftBody Mass.
|
getSBMaxGoal()Get the Object's SoftBody MaxGoal.
|
getSBMinGoal()Get the Object's SoftBody MinGoal.
|
getSBPostDef()get SoftBodies PostDef option
|
getSBStiffQuads()get SoftBodies StiffQuads option
|
getSBUseEdges()get SoftBodies UseEdges option
|
getSBUseGoal()get SoftBodies UseGoal option
|
getScriptLinks(event)Get a list with this Object's script links of type 'event'.
|
getSize(space)
|
getTimeOffset()Returns the time offset of the object's animation.
|
getTracked()Returns the object's tracked object.
|
getType()Returns the type of the object in 'Armature', 'Camera', 'Curve', 'Lamp', 'Lattice', 'Mball', 'Mesh', 'Surf', 'Empty', 'Wave' (deprecated) or 'unknown' in exceptional cases. 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.
|
insertShapeKey()Insert a Shape Key in the current object. It applies to Objects of the type Mesh, Lattice, or Curve. |
isSB()Returns the Object's SoftBody enabled state.
|
isSelected()Returns the objects selection state in the current scene as a boolean value True or False.
|
join(objects)Uses the object as a base for all of the objects in the provided list to join into.
|
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.
|
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:import Blender scn = Blender.Scene.GetCurrent() object = scn.objects.active object.modifiers.append(Blender.Modifier.Type.SUBSURF) object.makeDisplayList() Blender.Window.RedrawAll()If you try this example without the line to update the display list, the object will disappear from the screen until you press "SubSurf".
|
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.
|
makeParentBone(objects, bonename, noninverse=0, fast=0)Makes one of the object's bones the parent of the objects provided in the argument which must be a list of valid objects. The parent object must be an Armature.
|
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.
|
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.
|
makeTrack(tracked, fast=0)Make this Object track another.
|
removeAllProperties()Removes all game properties from an object. |
removeProperty(property)Remove a game property from an object.
|
select(boolean)Sets the object's selection state in the current scene. setting the selection will make this object the active object of this scene.
|
setDeltaLocation(delta_location)Sets the object's delta location which must be 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.
|
setDrawType(drawtype)Sets the object's drawing type.
|
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. The argument must be a list 16 items or less. Each list element is either a Material or None. Also seecolbits.
|
setMatrix(matrix)Sets the object's matrix and updates its transformation. If the object has a parent, the matrix transform is relative to the parent.
|
setName(name)Sets the name of the object. A string longer than 20 characters will be shortened.
|
setPIDeflection(status)Set the Object's Particle Interaction Deflection Setting. 0 = Off, 1 = on
|
setPIFalloff(falloff)Set the Object's Particle Interaction falloff. Values between 0 to 10.0
|
setPIMaxDist(MaxDist)Set the Object's Particle Interaction MaxDist. Values between 0 to 1000.0
|
setPIPerm(perm)Set the Object's Particle Interaction Permeability. Values between 0 to 10.0
|
setPIRandomDamp(damp)Set the Object's Particle Interaction RandomDamp. Values between 0 to 10.0
|
setPIStrength(strength)Set the Object's Particle Interaction Strength. Values between -1000.0 to 1000.0
|
setPISurfaceDamp(damp)Set the Object's Particle Interaction SurfaceDamp. Values between 0 to 10.0
|
setPIType(type)Set the Object's Particle Interaction type. Use Module Constants
|
|
|