Module NLA
[frames | no frames]

Module NLA

The Blender.Armature.NLA submodule.

NLA

This module provides access to Action objects in Blender. Actions are a series of keyframes/Ipo curves that define the movement of a bone. Actions are linked to objects of type armature.

Example:
 import Blender
 from Blender import *
 from Blender.Armature import *
 from Blender.Armature.Bone import *

 armObj = Object.New('Armature', "Armature_obj")
 armData = Armature.New()

 bn1=Blender.Armature.Bone.New("bone1")
 bn1.setHead(0.0,0.0,0.0)
 bn1.setTail(2.0,1.0,0.0)

 bn2=Blender.Armature.Bone.New("bone2")
 bn2.setHead(3.0,2.0,1.0)
 bn2.setTail(4.0,4.0,1.0)
 bn2.setRoll(.5)
 bn2.setParent(bn1)

 armData.addBone(bn1)
 armData.addBone(bn2)

 armObj.link(armData)
 scn = Blender.Scene.getCurrent()
 scn.link(armObj)

 armObj.makeDisplayList()
 Blender.Window.RedrawAll()

 action = Blender.Armature.NLA.NewAction()
 action.setActive(armObj)
 
 bn2.setPose([ROT,LOC,SIZE])  
 
 context = scn.getRenderingContext()
 context.currentFrame(2)

 quat = Blender.Mathutils.Quaternion([1,2,3,4])
 bn2.setQuat(quat)
 bn2.setLoc([3,4,5])
 
 bn2.setPose([ROT,LOC,SIZE])

 print action.name
 action2 = Blender.Armature.NLA.CopyAction(action)
 action2.name = "Copy"

Classes
Action This object gives access to Action-specific data in Blender.
ActionStrip This object gives access to a particular action strip.
ActionStrips This object gives access to sequence of ActionStrip objects for a particular Object.

Function Summary
PyAction CopyAction(action)
Copy an action and it's keyframes
Dictionary of PyActions GetActions()
Get all actions and return them as a Key : Value Dictionary.
PyAction NewAction(name)
Create a new Action object.

Variable Summary
readonly dictionary Flags: Constant dict used by the ActionStrip.flag attribute.
readonly dictionary Modes: Constant dict used by the ActionStrip.mode attribute.
readonly dictionary StrideAxes: Constant dict used by the ActionStrip.strideAxis attribute.

Function Details

CopyAction(action)

Copy an action and it's keyframes
Parameters:
action - The action to be copied.
           (type=PyAction)
Returns:
A copied action
           (type=PyAction)

GetActions()

Get all actions and return them as a Key : Value Dictionary.
Returns:
All the actions in blender
           (type=Dictionary of PyActions)

NewAction(name='DefaultAction')

Create a new Action object.
Parameters:
name - The Action name.
           (type=string)
Returns:
PyAction

Variable Details

Flags

Constant dict used by the ActionStrip.flag attribute. It is a bitmask and settings are ORed together.
  • SELECT: action strip is selected in NLA window
  • STRIDE_PATH: play action nased on path position and stride.
  • HOLD: continue displaying the last frame past the end of the strip
  • ACTIVE: action strip is active in NLA window
  • LOCK_ACTION: action start/end are automatically mapped to strip duration
Type:
readonly dictionary

Modes

Constant dict used by the ActionStrip.mode attribute. Currently the only value is MODE_ADD.
Type:
readonly dictionary

StrideAxes

Constant dict used by the ActionStrip.strideAxis attribute. Values are STRIDEAXIS_X, STRIDEAXIS_Y, and STRIDEAXIS_Z.
Type:
readonly dictionary

Generated by Epydoc 2.1 on Thu Jul 13 16:50:06 2006 http://epydoc.sf.net