Welcome to mirror list, hosted at ThFree Co, Russian Federation.

NLA.py « doc « api2_2x « python « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0e30bfb118f59bc95c0e6c8875248a636bad2c2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# Blender.Armature.NLA module and the Action PyType object

"""
The Blender.Armature.NLA submodule.

NLA
===

This module provides access to B{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.

@type Flags: readonly dictionary
@var Flags: Constant dict used by the L{ActionStrip.flag} attribute.
It is a bitmask and settings are ORed together.
	- SELECT: action strip is selected in NLA window
	- STRIDE_PATH: play action based 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
	- MUTE: action strip does not contribute to the NLA solution
	- USEX: Turn off automatic single-axis cycling and use X as an offset axis.  Note that you can use multiple axes at once.
	- USEY: Turn off automatic single-axis cycling and use Y as an offset axis.  Note that you can use multiple axes at once.
	- USEZ: Turn off automatic single-axis cycling and use Z as an offset axis.  Note that you can use multiple axes at once.
	- AUTO_BLEND: Automatic calculation of blend in/out values
	
@type StrideAxes: readonly dictionary
@var StrideAxes: Constant dict used by the L{ActionStrip.strideAxis} attribute.
Values are STRIDEAXIS_X, STRIDEAXIS_Y, and STRIDEAXIS_Z.

@type Modes: readonly dictionary
@var Modes: Constant dict used by the L{ActionStrip.mode} attribute.
Currently the only value is MODE_ADD.
"""

def NewAction  (name = 'DefaultAction'):
	"""
	Create a new Action object.
	@type name: string
	@param name: The Action name.
	@rtype: PyAction
	"""
	
def CopyAction (action):
	"""
	Copy an action and it's keyframes
	@type action: PyAction
	@param action: The action to be copied.
	@rtype: PyAction
	@return: A copied action
	"""

def GetActions ():
	"""
	Get all actions and return them as a Key : Value Dictionary.
	@rtype: Dictionary of PyActions
	@return: All the actions in blender
	"""
	
class Action:
	"""
	The Action object
	=================
		This object gives access to Action-specific data in Blender.
	"""

	def getName():
		"""
		Get the name of this Action.
		@rtype: string
		"""
		
	def setName(name):
		"""
		Set the name of this Action.
		@type name: string
		@param name: The new name
		"""
		
	def setActive(object):
		"""
		Set this action as the current action for an object.
		@type object: PyObject 
		@param object: The object whose action is to be set
		"""
		
	def getChannelIpo(channel):
		"""
		Get the Ipo for the named channel in this action
		@type channel: string
		@param channel: The name of a channel in this action
		@rtype: PyIpo or None
		@return: the Ipo for the channel
		"""

	def getFrameNumbers():
		"""
		Gets the frame numbers at which a key was inserted into this action
		@rtype: PyList
		@return: a list of ints
		"""
		
	def removeChannel(channel):
		"""
		Remove a named channel from this action
		@type channel: string
		@param channel: The name of a channel in this action to be removed
		"""
		
	def getAllChannelIpos():
		"""
		Get the all the Ipos for this action
		@rtype: Dictionary [channel : PyIpo or None]
		@return: the Ipos for all the channels in the action
		"""

	def getChannelNames():
		"""
		Returns a list of channel names
		@rtype: list
		@return: the channel names that match bone and constraint names.
		"""

	def renameChannel(nameFrom, nameTo):
		"""
		rename an existing channel to a new name.
		
		if the nameFrom channel dosnt exist or the nameTo exists, an error will be raised.
		@return: None
		"""

import id_generics
Action.__doc__ += id_generics.attributes 


class ActionStrips:
	"""
	The ActionStrips object
	=======================
	This object gives access to sequence of L{ActionStrip} objects for
	a particular Object.
	"""

	def __getitem__(index):
		"""
		This operator returns one of the action strips in the stack.
		@type index: int
		@return: an action strip object
		@rtype: ActionStrip
		@raise KeyError: index was out of range
		"""

	def __len__():
		"""
		Returns the number of action strips for the object.
		@return: number of action strips
		@rtype: int
		"""

	def append(action):
		"""
		Appends a new action to the end of the action strip sequence.
		@type action: L{Action<NLA.Action>}
		@param action: the action to use in the action strip
		@rtype: ActionStrip
		@return: the new action strip
		"""

	def remove(actionstrip):
		"""
		Remove an action strip from this object's actionstrip sequence.
		@type actionstrip: an action strip from this sequence to remove.
		@note: Accessing attributes of the action strip after it is removed will 
		throw an exception.
		"""

	def moveDown(actionstrip):
		"""
		Move the action strip down in the object's actionstrip sequence.
		@type actionstrip: an action strip from this sequence.
		"""
	
	def moveUp(actionstrip):
		"""
		Move the action strip up in the object's actionstrip sequence.
		@type actionstrip: an action strip from this sequence.
		"""

class ActionStrip:
	"""
	The ActionStrip object
	======================
	This object gives access to a particular action strip.
	@ivar action: Action associated with the strip.
	@type action: BPy Action object
	@ivar stripStart: Starting frame of the strip.
	@type stripStart: float 
	@ivar stripEnd: Ending frame of the strip.
	@type stripEnd: float 
	@ivar actionStart: Starting frame of the action.
	@type actionStart: float 
	@ivar actionEnd: Ending frame of the action.
	@type actionEnd: float 
	@ivar repeat: The number of times to repeat the action range.
	@type repeat: float 
	@ivar mode: Controls the ActionStrip mode.  See L{Modes} for
	valid values.
	@type mode: int
	@ivar flag: Controls various ActionStrip attributes.  Values can be ORed.
	See L{Flags} for valid values.
	@type flag: int
	@ivar strideAxis: Dominant axis for stride bone. See L{StrideAxes} for
	valid values.
	@type strideAxis: int 
	@ivar strideLength: Distance covered by one complete cycle of the action
	specified in the Action Range.
	@type strideLength: float 
	@ivar strideBone: Name of Bone used for stride
	@type strideBone: string 
	@ivar groupTarget: Armature object within DupliGroup for local animation
	@type groupTarget: object
	@ivar blendIn: Number of frames of motion blending.
	@type blendIn: float 
	@ivar blendOut: Number of frames of ease-out.
	@type blendOut: float 
	"""

	def resetActionLimits():
		"""
		Activates the functionality found in NLA Strip menu under "Reset  Action
		Start/End". This method restores the values of ActionStart and
		ActionEnd to  their defaults, usually the first and last frames within
		an action  that contain keys.
		@rtype: None
		"""

	def resetStripSize():
		"""
		Activates the functionality found in NLA Strip menu under "Reset  Strip
		Size".  This method resets the action strip size to its creation values.
		@rtype: None
		"""

	def snapToFrame():
		"""
		Activates the functionality found in NLA Strip menu under "Snap to Frame".
		This function snaps the ends of the action strip to the nearest whole
		numbered frame.
		@rtype: None
		"""