Module Armature
[frames | no frames]

Module Armature

The Blender.Armature submodule.

Armature

This module provides access to Armature objects in Blender. These are "skeletons", used to deform and animate other objects -- meshes, for example.

Example:
 import Blender
 from Blender import Armature as A
 from Blender.Mathutils import *
 #
 arms = A.Get()
 for arm in arms.values():
   arm.drawType = A.STICK #set the draw type
   arm.makeEditable() #enter editmode

   #generating new editbone
   eb = A.Editbone()
   eb.roll = 10
   eb.parent = arm.bones['Bone.003']
   eb.head = Vector(1,1,1)
   eb.tail = Vector(0,0,1)
   eb.options = [A.HINGE, A.CONNECTED]

   #add the bone
   arm.bones['myNewBone'] = eb
 
   #delete an old bone
   del arm.bones['Bone.002']

   arm.update()  #save changes

   for bone in arm.bones.values():
     #print bone.matrix['ARMATURESPACE']
     print bone.parent, bone.name
     print bone.children, bone.name
     print bone.options, bone.name

Classes
Armature This object gives access to Armature-specific data in Blender.
Bone This object gives access to Bone-specific data in Blender.
BonesDict This object gives gives dictionary like access to the bones in an armature.
Editbone This object is a wrapper for editbone data and is used only in the manipulation of the armature in editmode.

Function Summary
Blender Armature or a list of Blender Armatures Get(name)
Get the Armature object(s) from Blender.

Variable Summary
Constant BBONE: Bones draw as a segmented B-spline
Constant BONE_SELECTED: Bone is selected
Constant CONNECTED: Connect this bone to parent
Constant ENVELOPE: Bones draw as a stick with envelope influence
Constant HIDDEN_EDIT: Bone is hidden in editmode
Constant HINGE: Don't inherit rotation or scale from parent
Constant MULTIPLY: Multiply bone with vertex group
Constant NO_DEFORM: If bone will not deform geometry
Constant OCTAHEDRON: Bones drawn as octahedrons
Constant ROOT_SELECTED: Root of the Bone is selected
Constant STICK: Bones drawn as a line
Constant TIP_SELECTED: Tip of the Bone is selected

Function Details

Get(name=None)

Get the Armature object(s) from Blender.
Parameters:
name - The string name of an armature.
           (type=string, nothing, or list of strings)
Returns:
It depends on the name parameter:
  • (name): The Armature object with the given name;
  • (name, name, ...): A list of Armature objects
  • (): A list with all Armature objects in the current scene.

           (type=Blender Armature or a list of Blender Armatures)

Variable Details

BBONE

Bones draw as a segmented B-spline
Type:
Constant

BONE_SELECTED

Bone is selected
Type:
Constant

CONNECTED

Connect this bone to parent
Type:
Constant

ENVELOPE

Bones draw as a stick with envelope influence
Type:
Constant

HIDDEN_EDIT

Bone is hidden in editmode
Type:
Constant

HINGE

Don't inherit rotation or scale from parent
Type:
Constant

MULTIPLY

Multiply bone with vertex group
Type:
Constant

NO_DEFORM

If bone will not deform geometry
Type:
Constant

OCTAHEDRON

Bones drawn as octahedrons
Type:
Constant

ROOT_SELECTED

Root of the Bone is selected
Type:
Constant

STICK

Bones drawn as a line
Type:
Constant

TIP_SELECTED

Tip of the Bone is selected
Type:
Constant

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