Skip to main content

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 {
cframeCFrame
easingStyleEnum.EasingStyle
easingDirectionEnum.EasingDirection
positionnumber--

time position

}

Properties

rootCFrame

RobloxAnimationPoseCFrameTrack.rootCFrame: CFrame

World-space CFrame used for determining the "start" or "root" position.

keyframeSequence

RobloxAnimationPoseCFrameTrack.keyframeSequence: KeyframeSequence

hashers

RobloxAnimationPoseCFrameTrack.hashers: {PositionDataHasher<PoseKeyframe>}

length

RobloxAnimationPoseCFrameTrack.length: number

Determined by the greatest Time property of KeyframeSequence's Keyframes.

isCircuited

RobloxAnimationPoseCFrameTrack.isCircuited: boolean

Determined by KeyframeSequence.Looped

Functions

new

Constructor
RobloxAnimationPoseCFrameTrack.new(
keyframeSequenceKeyframeSequence,
hashers{PositionDataHasher<PoseKeyframe>},--

Full path to the deepest used Pose.

rootCFrameCFrame?--

Defaults to CFrame.new()

) → RobloxAnimationPoseCFrameTrack

createHashers

RobloxAnimationPoseCFrameTrack.createHashers(
keyframeSequenceKeyframeSequence,
posePath{string},--

Full path to the deepest used Pose.

startIndexnumber?,--

Default = 1

hashIntervalnumber?--

Default = 1

) → Result<PositionDataHasher<PoseKeyframe>,string>

Creates PositionDataHashers needed to create a RobloxAnimationPoseCFrameTrack

create

RobloxAnimationPoseCFrameTrack.create(
keyframeSequenceKeyframeSequence,
posePathArgsPosePathArgs,
rootCFrameCFrame?
) → Result<RobloxAnimationPoseCFrameTrack,string>

Types

interface PosePathArgs {
posePath{string}--

Full path (from animation root) to the deepest used pose as a string array.

startIndexnumber?--

Alternate start index; Defaults to 1

hashIntervalnumber?--

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(instanceInstance) → 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

RobloxAnimationPoseCFrameTrack:getCFrame(
positionnumber--

This is the Time position

) → CFrame

Returns a CFrame

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "",
            "params": [
                {
                    "name": "keyframeSequence",
                    "desc": "",
                    "lua_type": "KeyframeSequence"
                },
                {
                    "name": "hashers",
                    "desc": "Full path to the deepest used Pose.",
                    "lua_type": "{PositionDataHasher<PoseKeyframe>}"
                },
                {
                    "name": "rootCFrame",
                    "desc": "Defaults to CFrame.new()",
                    "lua_type": "CFrame?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "RobloxAnimationPoseCFrameTrack"
                }
            ],
            "function_type": "static",
            "tags": [
                "Constructor"
            ],
            "source": {
                "line": 128,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        },
        {
            "name": "createHashers",
            "desc": "Creates PositionDataHashers needed to create a RobloxAnimationPoseCFrameTrack",
            "params": [
                {
                    "name": "keyframeSequence",
                    "desc": "",
                    "lua_type": "KeyframeSequence"
                },
                {
                    "name": "posePath",
                    "desc": "Full path to the deepest used Pose.",
                    "lua_type": "{string}"
                },
                {
                    "name": "startIndex",
                    "desc": "Default = 1",
                    "lua_type": "number?"
                },
                {
                    "name": "hashInterval",
                    "desc": "Default = 1",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Result<PositionDataHasher<PoseKeyframe>, string>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 160,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        },
        {
            "name": "create",
            "desc": "Creates a RobloxAnimationPoseCFrameTrack.\nExtracts the KeyframeData and creates the necessary hashers for a RobloxAnimationPoseCFrameTrack.",
            "params": [
                {
                    "name": "keyframeSequence",
                    "desc": "",
                    "lua_type": "KeyframeSequence"
                },
                {
                    "name": "posePathArgs",
                    "desc": "",
                    "lua_type": "PosePathArgs"
                },
                {
                    "name": "rootCFrame",
                    "desc": "",
                    "lua_type": "CFrame?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Result<RobloxAnimationPoseCFrameTrack, string>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 305,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        },
        {
            "name": "fromInstance",
            "desc": "Creates a RobloxAnimationPoseCFrameTrack from an Instance\n\n### Children\n```ts\n{\n\tKeyframeSequence: KeyframeSequence | ObjectValue<KeyframeSequence>,\n\tPosePath: StringValue,\n\n\tStartIndex: IntValue?,\n\tHashInterval: NumberValue?,\n\tRootCFrame: CFrameInstance?,\n}\n```\n\n### Notes\n- PosePath being an ObjectValue that points to a Pose in the KeyframeSequence is buggy.",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Result<RobloxAnimationPoseCFrameTrack, string>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 346,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        },
        {
            "name": "getCFrame",
            "desc": "Returns a CFrame",
            "params": [
                {
                    "name": "position",
                    "desc": "This is the Time position",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "CFrame"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 436,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "rootCFrame",
            "desc": "World-space CFrame used for determining the \"start\" or \"root\" position.",
            "lua_type": "CFrame",
            "source": {
                "line": 103,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        },
        {
            "name": "keyframeSequence",
            "desc": "",
            "lua_type": "KeyframeSequence",
            "source": {
                "line": 106,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        },
        {
            "name": "hashers",
            "desc": "",
            "lua_type": "{PositionDataHasher<PoseKeyframe>}",
            "source": {
                "line": 109,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        },
        {
            "name": "length",
            "desc": "Determined by the greatest Time property of KeyframeSequence's Keyframes.",
            "lua_type": "number",
            "source": {
                "line": 113,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        },
        {
            "name": "isCircuited",
            "desc": "Determined by `KeyframeSequence.Looped`",
            "lua_type": "boolean",
            "source": {
                "line": 117,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        }
    ],
    "types": [
        {
            "name": "PoseKeyframe",
            "desc": "",
            "fields": [
                {
                    "name": "cframe",
                    "lua_type": "CFrame",
                    "desc": ""
                },
                {
                    "name": "easingStyle",
                    "lua_type": "Enum.EasingStyle",
                    "desc": ""
                },
                {
                    "name": "easingDirection",
                    "lua_type": "Enum.EasingDirection",
                    "desc": ""
                },
                {
                    "name": "position",
                    "lua_type": "number",
                    "desc": "time position"
                }
            ],
            "source": {
                "line": 38,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        },
        {
            "name": "PosePathArgs",
            "desc": "",
            "fields": [
                {
                    "name": "posePath",
                    "lua_type": "{string}",
                    "desc": "Full path (from animation root) to the deepest used pose as a string array."
                },
                {
                    "name": "startIndex",
                    "lua_type": "number?",
                    "desc": "Alternate start index; Defaults to 1"
                },
                {
                    "name": "hashInterval",
                    "lua_type": "number?",
                    "desc": "Interval used for hashing the position data; Defaults to 1.0"
                }
            ],
            "source": {
                "line": 293,
                "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
            }
        }
    ],
    "name": "RobloxAnimationPoseCFrameTrack",
    "desc": "#### Extends [CFrameTrack]\n\nImplementation of Roblox Animation ([KeyframeSequence]) to be played by rtrf.\n\n### Note\nThis is only the *positioning* implementation of Roblox Animations. As such, you need additional setup\nto play it as this is just one piece of the puzzle.\n\nSee (guide link here) for more information.\n\n### PosePath\n\nPosePath tells this track what the *deepest* used Pose is.\n\nIt is implemented as a string array.\n\nFor example, say the path to our pose `LeftArm` is as follows:\n\n`HumanoidRootPart -> Torso -> LeftArm`\n\nOur PosePath would look like in luau:\n\n```lua\nlocal posePath: {string} = {\n\t\"HumanoidRootPart\",\n\t\"Torso\",\n\t\"LeftArm\",\n}\n```\n\nIt can be represented in a string by separating each name using a comma (and no space):\n\n```\nHumanoidRootPart,Torso,LeftArm\n```\n\nThis is because the implementation uses `string.split(posePathString, \",\")`.\n\n### StartIndex\n\nSometimes you want to use a subset of poses or even just one which is deep in the rig.\n\nStartIndex tells where in the PosePath should be where this subset should \"start\".\n\nFor example, given a PosePath `HumanoidRootPart -> Torso -> LeftArm`, if our start path is `3`, then the\nposes used will just be `LeftArm`. (Remember, Roblox arrays start at 1).\n\nThe default, 1, will include our whole path, `HumanoidRootPart -> Torso -> LeftArm`.\nFinally, 2 will just include `Torso -> LeftArm`.\n\nThis index should not be greater than the length of the PosePath array.",
    "source": {
        "line": 99,
        "path": "src/shared/cframeTrack/RobloxAnimationPose.lua"
    }
}