1
BL_ArmatureChannel(PyObjectPlus)
2
================================
6
base class --- :class:`PyObjectPlus`
8
.. class:: BL_ArmatureChannel(PyObjectPlus)
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.
15
channel name (=bone name), read-only.
21
return the bone object corresponding to this pose channel, read-only.
23
:type: :class:`BL_ArmatureBone`
27
return the parent channel object, None if root channel, read-only.
29
:type: :class:`BL_ArmatureChannel`
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).
38
.. attribute:: ik_dof_x
40
true if the bone is free to rotation in the X axis, read-only.
44
.. attribute:: ik_dof_y
46
true if the bone is free to rotation in the Y axis, read-only.
50
.. attribute:: ik_dof_z
52
true if the bone is free to rotation in the Z axis, read-only.
56
.. attribute:: ik_limit_x
58
true if a limit is imposed on X rotation, read-only.
62
.. attribute:: ik_limit_y
64
true if a limit is imposed on Y rotation, read-only.
68
.. attribute:: ik_limit_z
70
true if a limit is imposed on Z rotation, read-only.
74
.. attribute:: ik_rot_control
76
true if channel rotation should applied as IK constraint, read-only.
80
.. attribute:: ik_lin_control
82
true if channel size should applied as IK constraint, read-only.
86
.. attribute:: location
88
displacement of the bone head in armature local space, read-write.
90
:type: vector [X, Y, Z].
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.
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`).
102
scale of the bone relative to its parent, read-write.
104
:type: vector [sizeX, sizeY, sizeZ].
108
An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation.
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`)
114
.. attribute:: rotation_quaternion
116
rotation of the bone relative to its parent expressed as a quaternion, read-write.
118
:type: vector [qr, qi, qj, qk].
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.
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`)
128
.. attribute:: rotation_euler
130
rotation of the bone relative to its parent expressed as a set of euler angles, read-write.
132
:type: vector [X, Y, Z].
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.
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`)
142
.. attribute:: rotation_mode
144
Method of updating the bone rotation, read-write.
146
:type: integer (one of :ref:`these constants <armaturechannel-constants-rotation-mode>`)
148
.. attribute:: channel_matrix
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.
155
.. attribute:: pose_matrix
157
pose matrix in armature space, read-only,
158
This field is updated after the graphic render, it represents the current pose.
162
.. attribute:: pose_head
164
position of bone head in armature space, read-only.
166
:type: vector [x, y, z]
168
.. attribute:: pose_tail
170
position of bone tail in armature space, read-only.
172
:type: vector [x, y, z]
174
.. attribute:: ik_min_x
176
minimum value of X rotation in degree (<= 0) when X rotation is limited (see ik_limit_x), read-only.
180
.. attribute:: ik_max_x
182
maximum value of X rotation in degree (>= 0) when X rotation is limited (see ik_limit_x), read-only.
186
.. attribute:: ik_min_y
188
minimum value of Y rotation in degree (<= 0) when Y rotation is limited (see ik_limit_y), read-only.
192
.. attribute:: ik_max_y
194
maximum value of Y rotation in degree (>= 0) when Y rotation is limited (see ik_limit_y), read-only.
198
.. attribute:: ik_min_z
200
minimum value of Z rotation in degree (<= 0) when Z rotation is limited (see ik_limit_z), read-only.
204
.. attribute:: ik_max_z
206
maximum value of Z rotation in degree (>= 0) when Z rotation is limited (see ik_limit_z), read-only.
210
.. attribute:: ik_stiffness_x
212
bone rotation stiffness in X axis, read-only.
214
:type: float between 0 and 1
216
.. attribute:: ik_stiffness_y
218
bone rotation stiffness in Y axis, read-only.
220
:type: float between 0 and 1
222
.. attribute:: ik_stiffness_z
224
bone rotation stiffness in Z axis, read-only.
226
:type: float between 0 and 1
228
.. attribute:: ik_stretch
230
ratio of scale change that is allowed, 0=bone can't change size, read-only.
234
.. attribute:: ik_rot_weight
236
weight of rotation constraint when ik_rot_control is set, read-write.
238
:type: float between 0 and 1
240
.. attribute:: ik_lin_weight
242
weight of size constraint when ik_lin_control is set, read-write.
244
:type: float between 0 and 1
246
.. attribute:: joint_rotation
248
Control bone rotation in term of joint angle (for robotic applications), read-write.
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.
252
When you read this attribute, the current pose matrix is converted into a [x, y, z] vector representing the joint angles.
254
The value and the meaning of the x, y, z depends on the ik_dof_x/ik_dof_y/ik_dof_z attributes:
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.
261
:type: vector [x, y, z]
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.
269
[0, 0, 0] always corresponds to the rest pose.
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`).
277
You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute.