~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to doc/python_api/rst/bge_types/bge.types.BL_ArmatureChannel.rst

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
BL_ArmatureChannel(PyObjectPlus)
 
2
================================
 
3
 
 
4
.. module:: bge.types
 
5
 
 
6
base class --- :class:`PyObjectPlus`
 
7
 
 
8
.. class:: BL_ArmatureChannel(PyObjectPlus)
 
9
 
 
10
   Proxy to armature pose channel. Allows to read and set armature pose.
 
11
   The attributes are identical to RNA attributes, but mostly in read-only mode.
 
12
 
 
13
   .. attribute:: name
 
14
 
 
15
      channel name (=bone name), read-only.
 
16
 
 
17
      :type: string
 
18
 
 
19
   .. attribute:: bone
 
20
 
 
21
      return the bone object corresponding to this pose channel, read-only.
 
22
 
 
23
      :type: :class:`BL_ArmatureBone`
 
24
 
 
25
   .. attribute:: parent
 
26
 
 
27
      return the parent channel object, None if root channel, read-only.
 
28
 
 
29
      :type: :class:`BL_ArmatureChannel`
 
30
 
 
31
   .. attribute:: has_ik
 
32
 
 
33
      true if the bone is part of an active IK chain, read-only.
 
34
      This flag is not set when an IK constraint is defined but not enabled (miss target information for example).
 
35
 
 
36
      :type: boolean
 
37
 
 
38
   .. attribute:: ik_dof_x
 
39
 
 
40
      true if the bone is free to rotation in the X axis, read-only.
 
41
 
 
42
      :type: boolean
 
43
 
 
44
   .. attribute:: ik_dof_y
 
45
 
 
46
      true if the bone is free to rotation in the Y axis, read-only.
 
47
 
 
48
      :type: boolean
 
49
 
 
50
   .. attribute:: ik_dof_z
 
51
 
 
52
      true if the bone is free to rotation in the Z axis, read-only.
 
53
 
 
54
      :type: boolean
 
55
 
 
56
   .. attribute:: ik_limit_x
 
57
 
 
58
      true if a limit is imposed on X rotation, read-only.
 
59
 
 
60
      :type: boolean
 
61
 
 
62
   .. attribute:: ik_limit_y
 
63
 
 
64
      true if a limit is imposed on Y rotation, read-only.
 
65
 
 
66
      :type: boolean
 
67
 
 
68
   .. attribute:: ik_limit_z
 
69
 
 
70
      true if a limit is imposed on Z rotation, read-only.
 
71
 
 
72
      :type: boolean
 
73
 
 
74
   .. attribute:: ik_rot_control
 
75
 
 
76
      true if channel rotation should applied as IK constraint, read-only.
 
77
 
 
78
      :type: boolean
 
79
 
 
80
   .. attribute:: ik_lin_control
 
81
 
 
82
      true if channel size should applied as IK constraint, read-only.
 
83
 
 
84
      :type: boolean
 
85
 
 
86
   .. attribute:: location
 
87
 
 
88
      displacement of the bone head in armature local space, read-write.
 
89
 
 
90
      :type: vector [X, Y, Z].
 
91
 
 
92
      .. note::
 
93
      
 
94
         You can only move a bone if it is unconnected to its parent. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
 
95
 
 
96
      .. note::
 
97
      
 
98
         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`).
 
99
 
 
100
   .. attribute:: scale
 
101
 
 
102
      scale of the bone relative to its parent, read-write.
 
103
 
 
104
      :type: vector [sizeX, sizeY, sizeZ].
 
105
 
 
106
      .. note::
 
107
      
 
108
         An action playing on the armature may change the value.  An IK chain does not update this value, see joint_rotation.
 
109
 
 
110
      .. note::
 
111
      
 
112
         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
 
113
 
 
114
   .. attribute:: rotation_quaternion
 
115
 
 
116
      rotation of the bone relative to its parent expressed as a quaternion, read-write.
 
117
 
 
118
      :type: vector [qr, qi, qj, qk].
 
119
 
 
120
      .. note::
 
121
      
 
122
         This field is only used if rotation_mode is 0. An action playing on the armature may change the value.  An IK chain does not update this value, see joint_rotation.
 
123
 
 
124
      .. note::
 
125
      
 
126
         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
 
127
 
 
128
   .. attribute:: rotation_euler
 
129
 
 
130
      rotation of the bone relative to its parent expressed as a set of euler angles, read-write.
 
131
 
 
132
      :type: vector [X, Y, Z].
 
133
 
 
134
      .. note::
 
135
      
 
136
         This field is only used if rotation_mode is > 0. You must always pass the angles in [X, Y, Z] order; the order of applying the angles to the bone depends on rotation_mode. An action playing on the armature may change this field.  An IK chain does not update this value, see joint_rotation.
 
137
 
 
138
      .. note::
 
139
      
 
140
         Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`)
 
141
 
 
142
   .. attribute:: rotation_mode
 
143
 
 
144
      Method of updating the bone rotation, read-write.
 
145
 
 
146
      :type: integer (one of :ref:`these constants <armaturechannel-constants-rotation-mode>`)
 
147
 
 
148
   .. attribute:: channel_matrix
 
149
 
 
150
      pose matrix in bone space (deformation of the bone due to action, constraint, etc), Read-only.
 
151
      This field is updated after the graphic render, it represents the current pose.
 
152
 
 
153
      :type: matrix [4][4]
 
154
 
 
155
   .. attribute:: pose_matrix
 
156
 
 
157
      pose matrix in armature space, read-only, 
 
158
      This field is updated after the graphic render, it represents the current pose.
 
159
 
 
160
      :type: matrix [4][4]
 
161
 
 
162
   .. attribute:: pose_head
 
163
 
 
164
      position of bone head in armature space, read-only.
 
165
 
 
166
      :type: vector [x, y, z]
 
167
 
 
168
   .. attribute:: pose_tail
 
169
 
 
170
      position of bone tail in armature space, read-only.
 
171
 
 
172
      :type: vector [x, y, z]
 
173
 
 
174
   .. attribute:: ik_min_x
 
175
 
 
176
      minimum value of X rotation in degree (<= 0) when X rotation is limited (see ik_limit_x), read-only.
 
177
 
 
178
      :type: float
 
179
 
 
180
   .. attribute:: ik_max_x
 
181
 
 
182
      maximum value of X rotation in degree (>= 0) when X rotation is limited (see ik_limit_x), read-only.
 
183
 
 
184
      :type: float
 
185
 
 
186
   .. attribute:: ik_min_y
 
187
 
 
188
      minimum value of Y rotation in degree (<= 0) when Y rotation is limited (see ik_limit_y), read-only.
 
189
 
 
190
      :type: float
 
191
 
 
192
   .. attribute:: ik_max_y
 
193
 
 
194
      maximum value of Y rotation in degree (>= 0) when Y rotation is limited (see ik_limit_y), read-only.
 
195
 
 
196
      :type: float
 
197
 
 
198
   .. attribute:: ik_min_z
 
199
 
 
200
      minimum value of Z rotation in degree (<= 0) when Z rotation is limited (see ik_limit_z), read-only.
 
201
 
 
202
      :type: float
 
203
 
 
204
   .. attribute:: ik_max_z
 
205
 
 
206
      maximum value of Z rotation in degree (>= 0) when Z rotation is limited (see ik_limit_z), read-only.
 
207
 
 
208
      :type: float
 
209
 
 
210
   .. attribute:: ik_stiffness_x
 
211
 
 
212
      bone rotation stiffness in X axis, read-only.
 
213
 
 
214
      :type: float between 0 and 1
 
215
 
 
216
   .. attribute:: ik_stiffness_y
 
217
 
 
218
      bone rotation stiffness in Y axis, read-only.
 
219
 
 
220
      :type: float between 0 and 1
 
221
 
 
222
   .. attribute:: ik_stiffness_z
 
223
 
 
224
      bone rotation stiffness in Z axis, read-only.
 
225
 
 
226
      :type: float between 0 and 1
 
227
 
 
228
   .. attribute:: ik_stretch
 
229
 
 
230
      ratio of scale change that is allowed, 0=bone can't change size, read-only.
 
231
 
 
232
      :type: float
 
233
 
 
234
   .. attribute:: ik_rot_weight
 
235
 
 
236
      weight of rotation constraint when ik_rot_control is set, read-write.
 
237
 
 
238
      :type: float between 0 and 1
 
239
 
 
240
   .. attribute:: ik_lin_weight
 
241
 
 
242
      weight of size constraint when ik_lin_control is set, read-write.
 
243
 
 
244
      :type: float between 0 and 1
 
245
 
 
246
   .. attribute:: joint_rotation
 
247
 
 
248
      Control bone rotation in term of joint angle (for robotic applications), read-write.
 
249
 
 
250
      When writing to this attribute, you pass a [x, y, z] vector and an appropriate set of euler angles or quaternion is calculated according to the rotation_mode.
 
251
 
 
252
      When you read this attribute, the current pose matrix is converted into a [x, y, z] vector representing the joint angles.
 
253
 
 
254
      The value and the meaning of the x, y, z depends on the ik_dof_x/ik_dof_y/ik_dof_z attributes:
 
255
 
 
256
      * 1DoF joint X, Y or Z: the corresponding x, y, or z value is used an a joint angle in radiant
 
257
      * 2DoF joint X+Y or Z+Y: treated as 2 successive 1DoF joints: first X or Z, then Y. The x or z value is used as a joint angle in radiant along the X or Z axis, followed by a rotation along the new Y axis of y radiants.
 
258
      * 2DoF joint X+Z: treated as a 2DoF joint with rotation axis on the X/Z plane. The x and z values are used as the coordinates of the rotation vector in the X/Z plane.
 
259
      * 3DoF joint X+Y+Z: treated as a revolute joint. The [x, y, z] vector represents the equivalent rotation vector to bring the joint from the rest pose to the new pose.
 
260
 
 
261
      :type: vector [x, y, z]
 
262
      
 
263
      .. note::
 
264
      
 
265
         The bone must be part of an IK chain if you want to set the ik_dof_x/ik_dof_y/ik_dof_z attributes via the UI, but this will interfere with this attribute since the IK solver will overwrite the pose. You can stay in control of the armature if you create an IK constraint but do not finalize it (e.g. don't set a target) the IK solver will not run but the IK panel will show up on the UI for each bone in the chain.
 
266
 
 
267
      .. note::
 
268
      
 
269
         [0, 0, 0] always corresponds to the rest pose.
 
270
 
 
271
      .. note::
 
272
      
 
273
         You must request the armature pose to update and wait for the next graphic frame to see the effect of setting this attribute (see :data:`BL_ArmatureObject.update`).
 
274
 
 
275
      .. note::
 
276
      
 
277
         You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute.
 
278