Skip to main content

Crunchyroll

The root module.

Types

AnimationTrack

interface AnimationTrack {
stop_fade_timenumber
start_fade_timenumber
weightnumber
alphanumber
prioritynumber
}

This table describes the state of an animation. It is agnostic to the animation asset.

Limb

interface Limb {
namestring
c0CFrame
c1CFrame
depends_onstring
}

This is the Crunchyroll equivalent of a Roblox Motor6D. depends_on is how the hierarchy works; for example "Head" depends on "Torso"

Functions

load_keyframe_sequence

Crunchyroll.load_keyframe_sequence(keyframe_sequenceKeyframeSequence) → AnimationAsset

Load a keyframe sequence from Roblox. This will return an AnimationAsset.

create_rig

Crunchyroll.create_rig(rig_hierarchyLimb) → Rig

Create a rig from a model. This will return a Rig.

solve_animation

Crunchyroll.solve_animation(
rigRig,
rootCFrame
) → ()

The primary function of the module. This will solve the animation for a rig. Example:

	crunchyroll.solve_animation(rig, {
		[animation] = {
			priority = 1,

			start_fade_time = 0,
			stop_fade_time = 0,
			weight = 1,

			alpha = 0.5,
		},
	}, character.HumanoidRootPart.CFrame)
Show raw api
{
    "functions": [
        {
            "name": "load_keyframe_sequence",
            "desc": "Load a keyframe sequence from Roblox. This will return an AnimationAsset.",
            "params": [
                {
                    "name": "keyframe_sequence",
                    "desc": "",
                    "lua_type": "KeyframeSequence"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "AnimationAsset"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 20,
                "path": "src/init.luau"
            }
        },
        {
            "name": "create_rig",
            "desc": "Create a rig from a model. This will return a Rig.",
            "params": [
                {
                    "name": "rig_hierarchy",
                    "desc": "",
                    "lua_type": "Limb"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Rig"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 30,
                "path": "src/init.luau"
            }
        },
        {
            "name": "solve_animation",
            "desc": "The primary function of the module. This will solve the animation for a rig.\nExample:\n```lua\n\tcrunchyroll.solve_animation(rig, {\n\t\t[animation] = {\n\t\t\tpriority = 1,\n\n\t\t\tstart_fade_time = 0,\n\t\t\tstop_fade_time = 0,\n\t\t\tweight = 1,\n\n\t\t\talpha = 0.5,\n\t\t},\n\t}, character.HumanoidRootPart.CFrame)\n```",
            "params": [
                {
                    "name": "rig",
                    "desc": "",
                    "lua_type": "Rig"
                },
                {
                    "name": "tracks",
                    "desc": "",
                    "lua_type": "{ [AnimationAsset]: AnimationTrack }"
                },
                {
                    "name": "root",
                    "desc": "",
                    "lua_type": "CFrame"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 55,
                "path": "src/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "AnimationTrack",
            "desc": "This table describes the state of an animation. It is agnostic to the animation asset.",
            "fields": [
                {
                    "name": "stop_fade_time",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "start_fade_time",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "weight",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "alpha",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "priority",
                    "lua_type": "number",
                    "desc": ""
                }
            ],
            "source": {
                "line": 86,
                "path": "src/init.luau"
            }
        },
        {
            "name": "Limb",
            "desc": "This is the Crunchyroll equivalent of a Roblox Motor6D.\n`depends_on` is how the hierarchy works; for example \"Head\" depends on \"Torso\"",
            "fields": [
                {
                    "name": "name",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "c0",
                    "lua_type": "CFrame",
                    "desc": ""
                },
                {
                    "name": "c1",
                    "lua_type": "CFrame",
                    "desc": ""
                },
                {
                    "name": "depends_on",
                    "lua_type": "string",
                    "desc": ""
                }
            ],
            "source": {
                "line": 98,
                "path": "src/init.luau"
            }
        }
    ],
    "name": "Crunchyroll",
    "desc": "The root module.",
    "source": {
        "line": 10,
        "path": "src/init.luau"
    }
}