Module Pose :: Class PoseBone
[hide private]
[frames] | no frames]

Class PoseBone

source code

The PoseBone object

This object gives access to PoseBone-specific data in Blender.

Instance Methods [hide private]
None
insertKey(parentObject, frameNumber, type='[Pose.LOC, Pose.ROT, Pose.SIZE]', fast=False)
Insert a pose key for this PoseBone at a frame.
source code
Instance Variables [hide private]
BPy_ConstraintSeq constraints
a sequence of constraints for the object
Object or None displayObject
The object to display in place of the bone.
bool hasIK
True if this pose bone is a part of an IK (readonly), when False, other IK related values have no affect.
Vector object head
The final head location for this PoseBone.
Int layerMask
Layer bitmask Example:
bool limitX
Limit rotation over X axis when part of an IK.
bool limitY
Limit rotation over Y axis when part of an IK.
bool limitZ
Limit rotation over Z axis when part of an IK.
3-item sequence limitmax
The x,y,z maximum limits on rotation when part of an IK
3-item sequence limitmin
The x,y,z minimum limits on rotation when part of an IK
Vector object loc
The change in location for this PoseBone.
Matrix object localMatrix
The matrix combination of rot/size/loc.
bool lockXRot
Disable X DoF when part of an IK.
bool lockYRot
Disable Y DoF when part of an IK.
bool lockZRot
Disable Z DoF when part of an IK.
String name
The name of this PoseBone.
posebone or None parent
The parent of this posebone (not settable)
Matrix object poseMatrix
The total transformation of this PoseBone including constraints.
Quaternion object quat
The change in rotation for this PoseBone.
Boolean sel
The selection state of this bone
Vector object size
The change in size for this PoseBone (no change is 1,1,1)
float stiffX
The x stiffness when part of an IK [0.0 - 0.990]
float stiffY
The x stiffness when part of an IK [0.0 - 0.990]
float stiffZ
The x stiffness when part of an IK [0.0 - 0.990]
float stretch
The amount to stretch to the ik target when part of an IK [0.0 - 1.0]
Vector object tail
The final tail location for this PoseBone.
Method Details [hide private]

insertKey(parentObject, frameNumber, type='[Pose.LOC, Pose.ROT, Pose.SIZE]', fast=False)

source code 

Insert a pose key for this PoseBone at a frame.

Parameters:
  • parentObject (Object object) - The object the pose came from.
  • frameNumber (integer) - The frame number to insert the pose key on.
  • type (Constant object) - Optional argumentm. Can be any combination of 3 Module constants:
    • Pose.LOC
    • Pose.ROT (This adds keyframes to the quat ipo, since quaternions are used for pose bone rotation)
    • Pose.SIZE

    If this argument is omitted all keys will be added.

  • fast (Bool) - If enabled, the IPOs will not be recalculated, speeds up adding many keyframes at once.
Returns: None

Instance Variable Details [hide private]

displayObject

The object to display in place of the bone. (custom bones)
Type:
Object or None

head

The final head location for this PoseBone. (not settable)
Type:
Vector object

layerMask

Layer bitmask Example:
       # set bone to layers 14 and 16
       bone.layerMask = (1<<13) + (1<<15)
Type:
Int

loc

The change in location for this PoseBone. this is the equivilent of bone.getLoc() in the old 2.3x python api.
Type:
Vector object

poseMatrix

The total transformation of this PoseBone including constraints.

This matrix is in armature space, for the current worldspace location of this pose bone, multiply it with its objects worldspace matrix.

eg. pose_bone.poseMatrix * object.matrixWorld

Setting the poseMatrix only sets the loc/size/rot, before constraints are applied (similar to actions). After setting pose matrix, run pose.update() to re-evaluate the pose and see the changes in the 3d view.

Type:
Matrix object

tail

The final tail location for this PoseBone. (not settable)
Type:
Vector object