Module NLA
[hide private]
[frames] | no frames]

Source Code for Module NLA

  1  # Blender.Armature.NLA module and the Action PyType object 
  2   
  3  """ 
  4  The Blender.Armature.NLA submodule. 
  5   
  6  NLA 
  7  === 
  8   
  9  This module provides access to B{Action} objects in Blender.  Actions are a 
 10  series of keyframes/Ipo curves that define the movement of a bone.  
 11  Actions are linked to objects of type armature. 
 12   
 13  @type Flags: readonly dictionary 
 14  @var Flags: Constant dict used by the L{ActionStrip.flag} attribute. 
 15  It is a bitmask and settings are ORed together. 
 16          - SELECT: action strip is selected in NLA window 
 17          - STRIDE_PATH: play action based on path position and stride. 
 18          - HOLD: continue displaying the last frame past the end of the strip 
 19          - ACTIVE: action strip is active in NLA window 
 20          - LOCK_ACTION: action start/end are automatically mapped to strip duration 
 21          - MUTE: action strip does not contribute to the NLA solution 
 22          - USEX: Turn off automatic single-axis cycling and use X as an offset axis.  Note that you can use multiple axes at once. 
 23          - USEY: Turn off automatic single-axis cycling and use Y as an offset axis.  Note that you can use multiple axes at once. 
 24          - USEZ: Turn off automatic single-axis cycling and use Z as an offset axis.  Note that you can use multiple axes at once. 
 25          - AUTO_BLEND: Automatic calculation of blend in/out values 
 26           
 27  @type StrideAxes: readonly dictionary 
 28  @var StrideAxes: Constant dict used by the L{ActionStrip.strideAxis} attribute. 
 29  Values are STRIDEAXIS_X, STRIDEAXIS_Y, and STRIDEAXIS_Z. 
 30   
 31  @type Modes: readonly dictionary 
 32  @var Modes: Constant dict used by the L{ActionStrip.mode} attribute. 
 33  Currently the only value is MODE_ADD. 
 34  """ 
 35   
36 -def NewAction (name = 'DefaultAction'):
37 """ 38 Create a new Action object. 39 @type name: string 40 @param name: The Action name. 41 @rtype: PyAction 42 """
43
44 -def CopyAction (action):
45 """ 46 Copy an action and it's keyframes 47 @type action: PyAction 48 @param action: The action to be copied. 49 @rtype: PyAction 50 @return: A copied action 51 """
52
53 -def GetActions ():
54 """ 55 Get all actions and return them as a Key : Value Dictionary. 56 @rtype: Dictionary of PyActions 57 @return: All the actions in blender 58 """
59
60 -class Action:
61 """ 62 The Action object 63 ================= 64 This object gives access to Action-specific data in Blender. 65 """ 66
67 - def getName():
68 """ 69 Get the name of this Action. 70 @rtype: string 71 """
72
73 - def setName(name):
74 """ 75 Set the name of this Action. 76 @type name: string 77 @param name: The new name 78 """
79
80 - def setActive(object):
81 """ 82 Set this action as the current action for an object. 83 @type object: PyObject 84 @param object: The object whose action is to be set 85 """
86
87 - def getChannelIpo(channel):
88 """ 89 Get the Ipo for the named channel in this action 90 @type channel: string 91 @param channel: The name of a channel in this action 92 @rtype: PyIpo or None 93 @return: the Ipo for the channel 94 """
95
96 - def getFrameNumbers():
97 """ 98 Gets the frame numbers at which a key was inserted into this action 99 @rtype: PyList 100 @return: a list of ints 101 """
102
103 - def removeChannel(channel):
104 """ 105 Remove a named channel from this action 106 @type channel: string 107 @param channel: The name of a channel in this action to be removed 108 """
109
110 - def getAllChannelIpos():
111 """ 112 Get the all the Ipos for this action 113 @rtype: Dictionary [channel : PyIpo or None] 114 @return: the Ipos for all the channels in the action 115 """
116
117 - def getChannelNames():
118 """ 119 Returns a list of channel names 120 @rtype: list 121 @return: the channel names that match bone and constraint names. 122 """
123
124 - def renameChannel(nameFrom, nameTo):
125 """ 126 rename an existing channel to a new name. 127 128 if the nameFrom channel dosnt exist or the nameTo exists, an error will be raised. 129 @return: None 130 """
131 132 import id_generics 133 Action.__doc__ += id_generics.attributes 134 135
136 -class ActionStrips:
137 """ 138 The ActionStrips object 139 ======================= 140 This object gives access to sequence of L{ActionStrip} objects for 141 a particular Object. 142 """ 143
144 - def __getitem__(index):
145 """ 146 This operator returns one of the action strips in the stack. 147 @type index: int 148 @return: an action strip object 149 @rtype: ActionStrip 150 @raise KeyError: index was out of range 151 """
152
153 - def __len__():
154 """ 155 Returns the number of action strips for the object. 156 @return: number of action strips 157 @rtype: int 158 """
159
160 - def append(action):
161 """ 162 Appends a new action to the end of the action strip sequence. 163 @type action: L{Action<NLA.Action>} 164 @param action: the action to use in the action strip 165 @rtype: ActionStrip 166 @return: the new action strip 167 """
168
169 - def remove(actionstrip):
170 """ 171 Remove an action strip from this object's actionstrip sequence. 172 @type actionstrip: an action strip from this sequence to remove. 173 @note: Accessing attributes of the action strip after it is removed will 174 throw an exception. 175 """
176
177 - def moveDown(actionstrip):
178 """ 179 Move the action strip down in the object's actionstrip sequence. 180 @type actionstrip: an action strip from this sequence. 181 """
182
183 - def moveUp(actionstrip):
184 """ 185 Move the action strip up in the object's actionstrip sequence. 186 @type actionstrip: an action strip from this sequence. 187 """
188
189 -class ActionStrip:
190 """ 191 The ActionStrip object 192 ====================== 193 This object gives access to a particular action strip. 194 @ivar action: Action associated with the strip. 195 @type action: BPy Action object 196 @ivar stripStart: Starting frame of the strip. 197 @type stripStart: float 198 @ivar stripEnd: Ending frame of the strip. 199 @type stripEnd: float 200 @ivar actionStart: Starting frame of the action. 201 @type actionStart: float 202 @ivar actionEnd: Ending frame of the action. 203 @type actionEnd: float 204 @ivar repeat: The number of times to repeat the action range. 205 @type repeat: float 206 @ivar mode: Controls the ActionStrip mode. See L{Modes} for 207 valid values. 208 @type mode: int 209 @ivar flag: Controls various ActionStrip attributes. Values can be ORed. 210 See L{Flags} for valid values. 211 @type flag: int 212 @ivar strideAxis: Dominant axis for stride bone. See L{StrideAxes} for 213 valid values. 214 @type strideAxis: int 215 @ivar strideLength: Distance covered by one complete cycle of the action 216 specified in the Action Range. 217 @type strideLength: float 218 @ivar strideBone: Name of Bone used for stride 219 @type strideBone: string 220 @ivar groupTarget: Armature object within DupliGroup for local animation 221 @type groupTarget: object 222 @ivar blendIn: Number of frames of motion blending. 223 @type blendIn: float 224 @ivar blendOut: Number of frames of ease-out. 225 @type blendOut: float 226 """ 227
228 - def resetActionLimits():
229 """ 230 Activates the functionality found in NLA Strip menu under "Reset Action 231 Start/End". This method restores the values of ActionStart and 232 ActionEnd to their defaults, usually the first and last frames within 233 an action that contain keys. 234 @rtype: None 235 """
236
237 - def resetStripSize():
238 """ 239 Activates the functionality found in NLA Strip menu under "Reset Strip 240 Size". This method resets the action strip size to its creation values. 241 @rtype: None 242 """
243
244 - def snapToFrame():
245 """ 246 Activates the functionality found in NLA Strip menu under "Snap to Frame". 247 This function snaps the ends of the action strip to the nearest whole 248 numbered frame. 249 @rtype: None 250 """
251