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

Class Bone


The Bone object

This object gives access to Bone-specific data in Blender.
Method Summary
  clearChildren()
Attemps to remove all the children of this bone.
  clearParent()
Attempts to clear the parenting of this bone.
Enumeration const (string) getBoneclass()
Get this Bone's boneclass.
list of Blender Bones getChildren()
Get this Bone's children Bones, if available.
list of three floats getHead()
Get the "head" ending position.
list of three floats getLoc()
Get the location of this Bone.
string getName()
Get the name of this Bone.
Blender Bone getParent()
Get this Bone's parent Bone, if available.
Quaternion object. getQuat()
Get this Bone's quaternion.
4x4 PyMatrix getRestMatrix(locale)
Return a matrix that represents the rotation and position of this bone.
float getRoll()
Get the roll value.
list of three floats getSize()
Get the size attribute.
list of three floats getTail()
Get the "tail" ending position.
float getWeight()
Get the bone's weight.
true (1) or false (0) hasIK()
Determines whether or not this bone as flaged as IK.
true or false hasParent()
True if this Bone has a parent Bone.
  hide()
Hides this bone.
  setBoneclass(boneclass)
Set the bones's boneclass.
  setHead(x, y, z)
Set the "head" ending position.
  setLoc(x, y, z)
Set the new location for this Bone.
  setName(name)
Rename this Bone.
  setParent(bone)
Set the bones's parent in the armature.
  setPose(flags, Action)
Set the pose for this bone.
  setQuat(quat)
Set the new quaternion for this Bone.
  setRoll(roll)
Set the roll value.
  setSize(x, y, z)
Set the new size for this Bone.
  setTail(x, y, z)
Set the "tail" ending position.
  setWeight(weight)
Set the bones's weight.
  unhide()
Unhide this bone.

Class Variable Summary
  boneclass: The boneclass of this bone.
  children: The children bones.
  head: This Bone's "head" ending position when in rest state.
  ik: Whether the bone is set to IK.
  loc: This Bone's location.
  name: The name of this Bone.
  parent: The parent Bone.
  quat: This Bone's quaternion.
  roll: This Bone's roll value.
  size: This Bone's size.
  tail: This Bone's "tail" ending position when in rest state.
  weight: The bone's weight.

Method Details

clearChildren()

Attemps to remove all the children of this bone. Because each of the children no longer are parented they will be set a root bones in the armature.

clearParent()

Attempts to clear the parenting of this bone. Because the bone is no longer parented it will be set in the armature as a root bone.

getBoneclass()

Get this Bone's boneclass.
Returns:
Enumeration const (string)

getChildren()

Get this Bone's children Bones, if available.
Returns:
list of Blender Bones

getHead()

Get the "head" ending position.
Returns:
list of three floats

getLoc()

Get the location of this Bone.
Returns:
list of three floats

getName()

Get the name of this Bone.
Returns:
string

getParent()

Get this Bone's parent Bone, if available.
Returns:
Blender Bone

getQuat()

Get this Bone's quaternion.
Returns:
Quaternion object.

getRestMatrix(locale='worldspace')

Return a matrix that represents the rotation and position of this bone. There are two types of matrices that can be returned:
  1. bonespace (in the coord. system of parent) or
  2. worldspace (in the coord system of blender).
The rotation will be in either worldspace or bonespace. Translation vectors (row 4) will be the bone's head position (if worldspace) or the difference from this bone's head to the parent head (if bonespace).
Parameters:
locale - possible values are:
  • worldspace (default)
  • bonespace

           (type=string. Values are:)
Returns:
4x4 PyMatrix

getRoll()

Get the roll value.
Returns:
float

Warning: Roll values are local to parent's objectspace when bones are parented.

getSize()

Get the size attribute.
Returns:
list of three floats

getTail()

Get the "tail" ending position.
Returns:
list of three floats

getWeight()

Get the bone's weight.
Returns:
float

hasIK()

Determines whether or not this bone as flaged as IK.
Returns:
true (1) or false (0)

hasParent()

True if this Bone has a parent Bone.
Returns:
true or false

hide()

Hides this bone.

setBoneclass(boneclass)

Set the bones's boneclass.
Parameters:
boneclass - The boneclass of this bone.
           (type=Enumeration constant. See above.)

setHead(x, y, z)

Set the "head" ending position.
Parameters:
x - The new x value.
           (type=float)
y - The new y value.
           (type=float)
z - The new z value.
           (type=float)

setLoc(x, y, z)

Set the new location for this Bone.
Parameters:
x - The new x value.
           (type=float)
y - The new y value.
           (type=float)
z - The new z value.
           (type=float)

setName(name)

Rename this Bone.
Parameters:
name - The new name.
           (type=string)

setParent(bone)

Set the bones's parent in the armature.
Parameters:
bone - The Python bone that is the parent to this bone.
           (type=PyBone)

setPose(flags, Action)

Set the pose for this bone. The pose will be set at the Scene's current frame. If an action is passed as the optional second parameter the pose will be added as a keyframe to that action. Otherwise a default action will be created an the pose set to it.
Parameters:
flags - expects ROT, LOC, SIZE in a list. Whichever of these is passed the keyframe generated will set information about the rotation, and/or location, and/or size of the bone.
           (type=PyList of enums)
Action - a python action that has either been created or returned from an object
           (type=PyAction)

setQuat(quat)

Set the new quaternion for this Bone.
Parameters:
quat - Can be a Quaternion or PyList of 4 floats.
           (type=Quaternion object or PyList of floats)

setRoll(roll)

Set the roll value.
Parameters:
roll - The new value.
           (type=float)

Warning: Roll values are local to parent's objectspace when bones are parented.

setSize(x, y, z)

Set the new size for this Bone.
Parameters:
x - The new x value.
           (type=float)
y - The new y value.
           (type=float)
z - The new z value.
           (type=float)

setTail(x, y, z)

Set the "tail" ending position.
Parameters:
x - The new x value.
           (type=float)
y - The new y value.
           (type=float)
z - The new z value.
           (type=float)

setWeight(weight)

Set the bones's weight.
Parameters:
weight - set the the bone's weight.
           (type=float)

unhide()

Unhide this bone.

Class Variable Details

boneclass

The boneclass of this bone.

children

The children bones.

head

This Bone's "head" ending position when in rest state.

ik

Whether the bone is set to IK.

loc

This Bone's location.

name

The name of this Bone.

parent

The parent Bone.

quat

This Bone's quaternion.

roll

This Bone's roll value.

size

This Bone's size.

tail

This Bone's "tail" ending position when in rest state.

weight

The bone's weight.

Generated by Epydoc 2.1 on Mon Jun 13 15:31:23 2005 http://epydoc.sf.net