Since engine version: 4.0 OC
This function can be used to change the transformation of a bone set with TransformBone. This allows to create dynamic animations by script. Returns
trueif the new transformation was set or
falseif there is no such animation node or it was not created with TransformBone.
int SetAnimationBoneTransform(int animation_number, array transformation, int attach_number);
- Animation number of the animation whose bone transformation to change. The animation must have been created with TransformBone.
- [opt] If given, refers to the number of the attached mesh whose animation to change.
See the animation documentation for further explanations of the animation system.
The transformation passed to this function is not completely arbitrary, in particular it must not have components which skew the mesh along one of the axes. Skewing is not supported by the animation blending system. Skew matrices cannot be produced with one of the Trans_* functions directly, but it can result of the multiplication of a rotation matrix with a rotated scale matrix, e.g.
Trans_Mul(Trans_Rotate(...), Trans_Scale(...), Trans_Rotate(...)). Skewing cannot occur by combining translation and rotation matrices only.
SetAnimationBoneTransform(animation_number, Trans_Rotate(FrameCounter() % 360, 0, 1, 0));
Script for a timer to be called each frame: The bone for which the animation with
animation_numberwas started is turning with one revolution per 360 frames.