A Pose is a final transformation apply to the Bone of a SkeletalMesh which is in the most case driven by an Action.
Using the Pose interface you can gain access to the transformation matrix of each Bone forming the final pose of the SkeletalMesh that will be presented on the screen, and update them as you see fit.
The Pose API below you can also blend two pose together and form a new resulting pose that can be reassigned directly to a SkeletalMesh.
See Also
Name | Description |
---|---|
bone_count | Amount of Bone currently available by the current Pose. |
Name | Description |
---|---|
GetBoneMatrix | Retrieve a specific Bone transformation matrix. |
SetBoneMatrix | Retrieve a specific Bone transformation matrix. |
Blend | Helper function that allows you to blend the current Pose with another. |
Dealing with pose blending is a bit different than dealing with other table and references. You first need to actually create a Pose
variable and transfer the SkeletalMesh pose to it; operate than release it.
-- Create two new local pose variable.
local poseA = Pose.Init()
local poseB = Pose.Init()
-- Transfer the first animation pose to the variable `poseA`.
this.animation.object.data.skeletalmesh:GetPose(poseA)
-- Insert here the code to change to another pose.
-- Transfer the second animation pose to the variable `poseB`.
this.animation.object.data.skeletalmesh:GetPose(poseB)
-- Blend poseA and poseB at 50%
poseA:Blend(poseB,0.5)
-- Assign back the resulting pose to the skeletalmesh.
this.animation.object.data.skeletalmesh:SetPose(poseA)
-- Important: Always manually release the pose variables when
-- they are no longer required.
poseA = nil
poseB = nil
|