OUTDATED NEW VERSION IS OUT
KeyframeSequanceAnimation module v2.12
2.1 changelog:
- Reverse
- Fixed Playing
- Changed GetRig name to make more sense
2.11 changelog: - I just figured out why you was unable to play more than 1 animation its now fixed
- V.C0: can play animations using C0 of motor
2.12: - Frame things
This took whole 17 days to update the module from 1.0 to 2.0 (i though that it took 30 days lol)
Supports Events,R15,R6,Loops,Easing Styles and much more!
Point of this module is to let you play animations though KeyframeSequance or Table in online mode!
In this post i want to showcase my module that letting you play keyframesequance animations.
feel free to edit it but i be very happy if you like or leave a credit to this module in your creations.Since its using KeyframeSequance and TweenService this may result into tons of bugs and lags and overall i dont recomend you using it in serious projects.
This my frist module that i made so it would be very unreadable ig.
But lets talk how to set it up!
Frist you can use id of module
i still suggest using C1 version instead of C0 its more natural to roblox engine
C1 Animations:
local AnimLibrary = require(15187566463)
C0 Animations
local AnimLibrary = require(15397576266)
^^ id is the same and not changed but here below i leave old version of module so you see all changes.
Archived
second you can get module and put into replicated storage or model you want to use
C1 Animations:
C0 Animations:
Lets talk about its advantages and disadvantages
Advantages
Can animate C0 if needed (roblox uses C1 for it but module can do this too)
Module is completally free and open source
have some features that roblox animations doesnt have
“Static” animations without consuming perfomance
You can play any non published animation
Supports R15 and R6
Simple to edit (i hope)
Disdvantages
Does not download copy of animation to a client and have to replicate it manually if played on a server,also its not optimized at all
Only support Motor6D animations
How does it work?
Module using own system based on tables and all information have to be converted into table
In most cases there enough to use only 1 command to do so but if its complex rig this may take a while
API
Generating Rig Table:
.GetBasicR15(rig) //Returns table with offsets and motors that exist in default R15 Dummy
.GetBasicRig6(rig) //Returns table with offsets and motors that exist in default R6 Dummy
.SetOwnRigStructure(tableData) //if you want make it by yourself and make own life harder use it its
so hard way that even creator of this post forgor how to use it
.OffSetTableReturn(model) //this probably old brother of “.GenerateRig(model)” but i edited it so many times that forgor
.GenerateRig(model) //Auto Generating Rig Table make sure that your rig currently not using any animations or else offsets may be broken
=============================================================================
Ok so once you got rig table your life will be easier and hardest part of module is done
Generating Keyframe Table:
.GenerateKeyframe(KeyFrameSequance) //Returns table of Keyframe sequance nothing hard really
Here Exemples of converting anims into table:
Your so damn right!I couldnt make quality of pictures even worse!xd
How module works?
Module reads all keyframes,sorts it and moves into format that readable
Animation API
Before go to animation list you need to make animation
local animation = AnimLibrary.new(RigTableHere,KeyframeSequanceTableHere)
now after it you can apply animation api to it
exemple:
animation:Play(0)
so here all api:
:SetSpeed(speed) -- Sets speed
:AddSpeed(speedAdd) -- adds speed
:SubstractSpeed(speedSubstract) -- subsctracts speed
:Stop() -- stops animation but doesn't resets motors position
:Cancel() -- like :Stop but now also resets position
:ResetMotors() -- reset motors6d position (probably wont work if animation is playing)
:SetFrame(numberOfFrame) -- basically static animation select index of frame you want to see for eternity 💀
:GetAmoutOfFrames() -- return amout of frames in animation
:GetFrames() -- return frames in animation
:Play(OutSpeed) -- Plays animation OutSpeed means it automatically move rigs to default position if 0 it sets it automatically if nothing or nil it just freeze animation on last frame
==========================================
.Playing // returns true or false
.FrameIndex // if you set index 15 for exemple it will start animation from 15th frame or how you guys call it "Keyframe" 1 is default and automatically set
.AcceptFrameDrop //if true animation will use frame drop to sycronize its time better but it will lose quality false is default
.Animated //if false it disables tweens and will just teleport bodypart to next Keyframe true is default
.Speed //name says about everything 1 is default
.Reverse //Just reverses animation also dont worry about .FrameIndex here please its autofixes
.Looped //name says about everything false is default
.Frame // Current frame of animation
//Now most interesting part:
.EventListener // You can listen to events of animation and Markers all API will be below:
-------- Inside this lines API C0 VERSION OF MODULE ONLY!!!:
.JointsWhiteListC1 = {}
exemple:
.JointsWhiteListC1 = {"Neck"} // This will make ONLY rig named "Neck" playing as C1!! others will remain C0!
------
Events
There 2 types of event in module “AnimationStatus” and “Markers”
Markers comes from Roblox Animations as you know but AnimationStatus comes from module
connect animation Events is very easy:
animation.EventListener.Event:Connect(function(Type,ActionName,MarkerValue,MarkerTime)
end)
“Type” can return “AnimStatus” if its Module Event or “Event” if its AnimationMarker from Roblox
ActionName may return Module Event Name such as “Start” if animation Started or if its AnimationMarker will return name of “Event”
MarkerValue is a Value of Marker “Event” and MarkerTime is time when event supposed to heppen
Now lets talk about all possible Events that comes from this Module:
"Start" -- Animation Started !!This also may heppen if you using loop
"AnimEnd" -- Fires instantly once last keyframe of animation is searched but that doesnt not mean that animation is fully complited!!!
"End" -- Animation is ended.
"Loop" -- New loop has begun
"LoopClosed" -- if you disabled Loop while it was true and anim was playing this event will fire once anim is ended
"PosSet" -- fires once you used :SetFrame(numberOfFrame)
"KeyframePassed" //self explained
"ResetMotors" -- fires once you used :ResetMotors()
"Cancel" -- fires once you used :Cancel()
"Stop" -- fires once you used :Stop()
i hope i dont missed anything,Have a nice day and goodluck in using module!
i forgor to say in previous update that there exist
.GetHumanoidRigType(rig)
– idk why but i added it
I also made a plugin to convert it manually https://www.roblox.com/library/15151820544/Yariks-Tools
Also i will probably make it for Motor.C0 latter