A2T [Animation2Table] Plugin V1.6

New Project (18) 500x500

Animation 2 Table is a pretty self explanatory plugin. It allows you to convert animations into a table of keyframes for all of your CFrame animation needs.
(only supports keyframe animations, i think)

<==----------------------------==>

Animation Controllers:
I think this plugin is at its most useful when you create a custom animation controller specifically made for your game and use it to dynamically switch between the animations, though I haven’t needed to do something like that yet so I cant provide an example. (maybe in the future I will lol)

Example Use Case:
One of the things I have found this plugin is especially useful for is to create Poses and switch between them using a script, if you want to see my implementation of this you can see the video and code below.

local Poses = {}
local RunService = game:GetService('RunService')
local TweenService = game:GetService('TweenService')

Poses.Idle = {
	["Keyframes"] = {
		[0] = {
			["Poses"] = {
				["HumanoidRootPart"] = {
					["EasingStyle"] = Enum.EasingStyle.Sine,
					["Weight"] = 0,
					["CFrame"] = CFrame.new(),
					["SubPoses"] = {
						["Torso"] = {
							["EasingStyle"] = Enum.EasingStyle.Sine,
							["Weight"] = 1,
							["CFrame"] = CFrame.new(0,-0.25,-0.04) * CFrame.Angles(math.rad(9),math.rad(0),math.rad(0)),
							["SubPoses"] = {
								["Left Leg"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.Angles(math.rad(-0),math.rad(-0),math.rad(-13.5)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Right Arm"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.new(0.92,0.03,-0.3) * CFrame.Angles(math.rad(-31.53),math.rad(31.87),math.rad(-146.64)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Left Arm"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.new(-0.26,0.16,-0.04) * CFrame.Angles(math.rad(1.95),math.rad(-40.07),math.rad(-100.23)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Right Leg"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.Angles(math.rad(0),math.rad(-0),math.rad(4.5)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Head"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.Angles(math.rad(5.78),math.rad(-2.59),math.rad(17.79)),
									["EasingDirection"] = Enum.EasingDirection.Out
								}
							},
							["EasingDirection"] = Enum.EasingDirection.Out
						}
					},
					["EasingDirection"] = Enum.EasingDirection.Out
				}
			},
			["Markers"] = {}
		}
	},
	["Loop"] = false,
	["Priority"] = Enum.AnimationPriority.Core
}

Poses.Point = {
	["Keyframes"] = {
		[0] = {
			["Poses"] = {
				["HumanoidRootPart"] = {
					["EasingStyle"] = Enum.EasingStyle.Sine,
					["Weight"] = 0,
					["CFrame"] = CFrame.new(),
					["SubPoses"] = {
						["Torso"] = {
							["EasingStyle"] = Enum.EasingStyle.Sine,
							["Weight"] = 1,
							["CFrame"] = CFrame.Angles(math.rad(-4.96),math.rad(2.65),math.rad(-28.01)),
							["SubPoses"] = {
								["Left Leg"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.Angles(math.rad(-0),math.rad(5.62),math.rad(11.25)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Right Arm"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.new(0.21,0.37,0.8) * CFrame.Angles(math.rad(90),math.rad(-73.12),math.rad(-151.88)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Left Arm"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.new(-0.39,-0.04,-0.48) * CFrame.Angles(math.rad(-10.9),math.rad(-50.68),math.rad(-94.88)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Head"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.Angles(math.rad(-14.16),math.rad(9.28),math.rad(-71.97)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Right Leg"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.Angles(math.rad(-1.19),math.rad(-22.44),math.rad(-5.97)),
									["EasingDirection"] = Enum.EasingDirection.Out
								}
							},
							["EasingDirection"] = Enum.EasingDirection.Out
						}
					},
					["EasingDirection"] = Enum.EasingDirection.Out
				}
			},
			["Markers"] = {}
		}
	},
	["Loop"] = false,
	["Priority"] = Enum.AnimationPriority.Core
}

Poses.Relax = {
	["Keyframes"] = {
		[0] = {
			["Poses"] = {
				["HumanoidRootPart"] = {
					["EasingStyle"] = Enum.EasingStyle.Sine,
					["Weight"] = 0,
					["CFrame"] = CFrame.new(),
					["SubPoses"] = {
						["Torso"] = {
							["EasingStyle"] = Enum.EasingStyle.Sine,
							["Weight"] = 1,
							["CFrame"] = CFrame.new(0,-0.04,-0.12) * CFrame.Angles(math.rad(-16.88),math.rad(0),math.rad(0)),
							["SubPoses"] = {
								["Left Leg"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.Angles(math.rad(16.13),math.rad(-16.84),math.rad(-58.35)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Right Arm"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.new(-0.29,1.18,0.64) * CFrame.Angles(math.rad(111),math.rad(-8.39),math.rad(-26.63)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Head"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.Angles(math.rad(-7.85),math.rad(11.03),math.rad(11.46)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Right Leg"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.Angles(math.rad(20.38),math.rad(2.49),math.rad(83.23)),
									["EasingDirection"] = Enum.EasingDirection.Out
								},
								["Left Arm"] = {
									["EasingStyle"] = Enum.EasingStyle.Sine,
									["Weight"] = 1,
									["CFrame"] = CFrame.new(0.32,1.22,0.55) * CFrame.Angles(math.rad(112.11),math.rad(4.28),math.rad(27.29)),
									["EasingDirection"] = Enum.EasingDirection.Out
								}
							},
							["EasingDirection"] = Enum.EasingDirection.Out
						}
					},
					["EasingDirection"] = Enum.EasingDirection.Out
				}
			},
			["Markers"] = {}
		}
	},
	["Loop"] = false,
	["Priority"] = Enum.AnimationPriority.Core
}

function Poses:GetMotorTransforms(Rig)
	local Transforms = {}
	for _,v in pairs(Rig:GetDescendants()) do
		if v:IsA('Motor6D') then
			Transforms[v.Part1] = v.Transform
		end
	end
	return Transforms
end

function Poses:TweenPoseRig(Rig,Pose,Time)
	local Transforms = self:GetMotorTransforms(Rig)
	local StartTime = time()
	local GoalTime = StartTime + Time
	
	local RenderSteppedAttach; RenderSteppedAttach = RunService.RenderStepped:Connect(function(Delta)
		local Alpha = math.clamp((time()-StartTime)/Time,0,1)
		self:PoseLimb(Rig,Transforms,nil,'HumanoidRootPart',Pose.Keyframes[0].Poses.HumanoidRootPart,Alpha)
		if Alpha == 1 then
			RenderSteppedAttach:Disconnect()
		end
	end)
end

function Poses:PoseLimb(Rig,Transforms,ParentLimb,LimbName,Limb,Alpha)
	local Motor
	if ParentLimb then
		for _,Motor6D in pairs(ParentLimb:GetChildren()) do
			if not Motor6D:IsA('Motor6D') then continue end
			
			if Motor6D.Part1.Name == LimbName then
				Motor = Motor6D
				break
			end
		end
		
		if not Motor then return warn('Could not find Limb: '..LimbName..' in '..ParentLimb.Name) end
		
		Motor.Transform = Transforms[Motor.Part1]:Lerp(CFrame.new():Lerp(Limb.CFrame,Limb.Weight),Alpha)
	end
	if Limb.SubPoses then
		for Name,v in pairs(Limb.SubPoses) do
			self:PoseLimb(Rig,Transforms,Motor and Motor.Part1 or Rig:FindFirstChild(LimbName),Name,v, TweenService:GetValue(Alpha,Limb.EasingStyle,Limb.EasingDirection))
		end
	end
end

return Poses

Example Animation Output:

return {
	["Keyframes"] = {
		[0] = {
			["Poses"] = {
				["HumanoidRootPart"] = {
					["EasingStyle"] = Enum.EasingStyle.Linear,
					["Weight"] = 0,
					["CFrame"] = CFrame.new(),
					["SubPoses"] = {
						["Torso"] = {
							["EasingStyle"] = Enum.EasingStyle.Linear,
							["Weight"] = 0,
							["CFrame"] = CFrame.new(),
							["SubPoses"] = {
								["Head"] = {
									["EasingStyle"] = Enum.EasingStyle.Linear,
									["Weight"] = 1,
									["CFrame"] = CFrame.new(),
									["EasingDirection"] = Enum.EasingDirection.In
								}
							},
							["EasingDirection"] = Enum.EasingDirection.In
						}
					},
					["EasingDirection"] = Enum.EasingDirection.In
				}
			},
			["Markers"] = {}
		},
		[0.4] = {
			["Poses"] = {
				["HumanoidRootPart"] = {
					["EasingStyle"] = Enum.EasingStyle.Linear,
					["Weight"] = 0,
					["CFrame"] = CFrame.new(),
					["SubPoses"] = {
						["Torso"] = {
							["EasingStyle"] = Enum.EasingStyle.Linear,
							["Weight"] = 0,
							["CFrame"] = CFrame.new(),
							["SubPoses"] = {
								["Head"] = {
									["EasingStyle"] = Enum.EasingStyle.Bounce,
									["Weight"] = 1,
									["CFrame"] = CFrame.Angles(math.rad(0),math.rad(0),math.rad(45)),
									["EasingDirection"] = Enum.EasingDirection.Out
								}
							},
							["EasingDirection"] = Enum.EasingDirection.In
						}
					},
					["EasingDirection"] = Enum.EasingDirection.In
				}
			},
			["Markers"] = {
				["Example Animation Event"] = "blah blah blah..."
			}
		},
		[1] = {
			["Poses"] = {
				["HumanoidRootPart"] = {
					["EasingStyle"] = Enum.EasingStyle.Linear,
					["Weight"] = 0,
					["CFrame"] = CFrame.new(),
					["SubPoses"] = {
						["Torso"] = {
							["EasingStyle"] = Enum.EasingStyle.Linear,
							["Weight"] = 0,
							["CFrame"] = CFrame.new(),
							["SubPoses"] = {
								["Head"] = {
									["EasingStyle"] = Enum.EasingStyle.Linear,
									["Weight"] = 1,
									["CFrame"] = CFrame.new(),
									["EasingDirection"] = Enum.EasingDirection.In
								}
							},
							["EasingDirection"] = Enum.EasingDirection.In
						}
					},
					["EasingDirection"] = Enum.EasingDirection.In
				}
			},
			["Markers"] = {}
		}
	},
	["Loop"] = false,
	["Priority"] = Enum.AnimationPriority.Core
}

How do I use it? To use this plugin simply select the rig and the animation you want to convert and press the Convert button! Note: if your animation Track is inside of a rig then it will automatically use that rig.

Note: If you have any errors or suggestions whilst using this plugin please reply to this thread.

7 Likes

Holy shit, if this works this is easily the best one of the best plugins I have found in 2023. Will test it out rn.
(Happily paying 100 robux under the assumption it works)

1 Like

i am currently trying to fix some bugs that another user found but it should work. hopefully

1 Like

Yeah, right now I have an animation selected and nothing happens.

i have just fixed it (hopefully) try now.

the fix did end up working so you can now use the plugin. I am also going to add a basic AnimationController to show how to use the Tables that the Plugins Create.

1 Like

i fixed the issue causing the animations to be converted wrong so the animation should work as intended.

image