RobloxAnimationPoseCFrameTrack
Extends CFrameTrack
Implementation of Roblox Animation (KeyframeSequence) to be played by rtrf.
Note
This is only the positioning implementation of Roblox Animations. As such, you need additional setup to play it as this is just one piece of the puzzle.
See (guide link here) for more information.
PosePath
PosePath tells this track what the deepest used Pose is.
It is implemented as a string array.
For example, say the path to our pose LeftArm
is as follows:
HumanoidRootPart -> Torso -> LeftArm
Our PosePath would look like in luau:
local posePath: {string} = {
"HumanoidRootPart",
"Torso",
"LeftArm",
}
It can be represented in a string by separating each name using a comma (and no space):
HumanoidRootPart,Torso,LeftArm
This is because the implementation uses string.split(posePathString, ",")
.
StartIndex
Sometimes you want to use a subset of poses or even just one which is deep in the rig.
StartIndex tells where in the PosePath should be where this subset should "start".
For example, given a PosePath HumanoidRootPart -> Torso -> LeftArm
, if our start path is 3
, then the
poses used will just be LeftArm
. (Remember, Roblox arrays start at 1).
The default, 1, will include our whole path, HumanoidRootPart -> Torso -> LeftArm
.
Finally, 2 will just include Torso -> LeftArm
.
This index should not be greater than the length of the PosePath array.
Types
PoseKeyframe
interface
PoseKeyframe {
cframe:
CFrame
easingStyle:
Enum.EasingStyle
easingDirection:
Enum.EasingDirection
position:
number
--
time position
}
Properties
rootCFrame
RobloxAnimationPoseCFrameTrack.rootCFrame:
CFrame
World-space CFrame used for determining the "start" or "root" position.
keyframeSequence
RobloxAnimationPoseCFrameTrack.keyframeSequence:
KeyframeSequence
hashers
length
RobloxAnimationPoseCFrameTrack.length:
number
Determined by the greatest Time property of KeyframeSequence's Keyframes.
isCircuited
RobloxAnimationPoseCFrameTrack.isCircuited:
boolean
Determined by KeyframeSequence.Looped
Functions
new
ConstructorcreateHashers
RobloxAnimationPoseCFrameTrack.
createHashers
(
posePath:
{
string
}
,
--
Full path to the deepest used Pose.
startIndex:
number?
,
--
Default = 1
hashInterval:
number?
--
Default = 1
) →
Result
<
PositionDataHasher
<
PoseKeyframe
>
,
string
>
Creates PositionDataHashers needed to create a RobloxAnimationPoseCFrameTrack
create
Types
interface
PosePathArgs {
posePath:
{
string
}
--
Full path (from animation root) to the deepest used pose as a string array.
startIndex:
number?
--
Alternate start index; Defaults to 1
hashInterval:
number?
--
Interval used for hashing the position data; Defaults to 1.0
}
Creates a RobloxAnimationPoseCFrameTrack. Extracts the KeyframeData and creates the necessary hashers for a RobloxAnimationPoseCFrameTrack.
fromInstance
RobloxAnimationPoseCFrameTrack.
fromInstance
(
instance:
Instance
) →
Result
<
RobloxAnimationPoseCFrameTrack,
string
>
Creates a RobloxAnimationPoseCFrameTrack from an Instance
Children
{
KeyframeSequence: KeyframeSequence | ObjectValue<KeyframeSequence>,
PosePath: StringValue,
StartIndex: IntValue?,
HashInterval: NumberValue?,
RootCFrame: CFrameInstance?,
}
Notes
- PosePath being an ObjectValue that points to a Pose in the KeyframeSequence is buggy.
getCFrame
Returns a CFrame