KeyframeSequance to Animation v3

OUTDATED

PLEASE USE KeyframeSequance to Animation v4

New and better version of previous Module.
This module will work absolutelly differently to previous one!
This nodule is letting you play KeyframeAnimations in runtime dirrectly

Clear some confusions :question:

  • Previous one used C0/C1 but this one uses .Transform!
  • Yes it still supports EasingStyle
  • Yes its now supporting Skinned Mesh (Bone) animations aswell
  • Yes aswell supports R6 and R15

Bonefits :chart_with_upwards_trend:

  • Instead of mindlessly going from frame to frame this one is trying to simulate a animation timeline and is dynamic to timeline aswell as more user friendly
  • Have autofill for creating an animation class
  • Have speed multiplier that can be not only positive but also a negative for reversing animation
  • Have somewhat working animation blending
  • Have a sync system that would sync animation if you set its play in middle of timeline for example
  • have a public demo (yes real) it took me sometime to make
  • all other bonefits from previous module
  • Maybe better code?
  • Split into smaller components for readability
  • Plays both Motor6D and Bone (Skinned mesh) animations

Downsides :chart_with_downwards_trend:

  • bad optimization?
    Either for my bad scripting or for it being Luau compare to roblox animator using C++ we have that we have

Demo showcase :play_or_pause_button:

Note: all animations (exept for sitting one :]) are not my and i got them randomly either from toolbox or Roblox Cartoon Animation pack

PublicDemo.rbxl (205.0 KB)

image

Module :scroll:

API :star:

module.CreateModuleGroup(): ModuleScript
-- Module that can be passed into Group Parameter for Animation class
module.AutoGetMotor6D(Object:Model,Motor6DorBone:"Motor6D"|"Bone"): {}
-- Not important unless you want to manually pass it?
module.KeyFrameSequanceToTable(KeyFrameSequance:KeyframeSequence): {}
-- Not important it converts KeyFrameSequance into table that is used by module for animation.
module.new(Motor6DTable:Model|{},KeyFrameSequance:KeyframeSequence|{},Settings:SettingsType,AnimationGroup:ModuleScript?,Motor6DorBone:Motor6DorBones):AnimType
-- Animation Class itself
--[[
Parameters:
Motor6DTable -- Either Rig you making animation for or result of module.AutoGetMotor6D
KeyFrameSequance -- Either Keyframe sequance dirrectly or result of module.KeyFrameSequanceToTable
Settings: {} -- [[Custom Type where you can pass settings while creating animation
["Priority"]:Enum.AnimationPriority -- Is very important!!
]]
Optional Parameters [[
AnimationGroup -- result of module.CreateModuleGroup recomended if you want animations to not interupt each other put them in one group
]]
Motor6DorBone:"Motor6D"|"Bone"|nil
]]

Methods for animation :heavy_division_sign:

module:DestroyFadingData() -- used by another methods just ignore its existance
module:Cancel(DontResetMotor6D:boolean):YourAnimationHere.Settings.CurrentlyAt -- if DontResetMotor6D true does not reset motor6D to original position
method fully stops animation and deletes its thread
module:Freeze():YourAnimationHere.Settings.CurrentlyAt -- does not stop animation thread but prevents it from playing if that makes sense
module:UnFreeze() -- opposite of module:Freeze() (resumes thread)
module:Destroy() -- you already know what this method does...
module:Stop(FadeTime:number) --similar to module:Freeze() but it triggers fading time if passed in while :Play() or passed in :Stop() itself DOES NOT DELETES THREAD
module:Play(TimeStamp:number,FadeTime:number)
TimeStamp will trigger Settings["UpsyncThePlaying"] if possible
FadeTime will trigger if animation is not on loop
Plays animation itself

Events :zap:

self.Event:Connect(function(SygnalType: “MarkerSignal” | “KeyframeMarker”, Name: “string” ,Value: “string” | nil)

end)

  • KeyframeMarker will fire only for KeyframeMarker instances in timeline (User defined animation events) and will return Name of it and Value
  • MarkerSignal is an animation status related and NEVER RETURNS VALUE PARAMETER

Events for MarkerSignal

  • Canceled fires after method :Cancel() being applied
  • Frozen fires after method :Freeze() being applied
  • UnFrozen fires after method :UnFreeze() being applied
  • Stopped fires after method :Stop() being applied OR STOP OF ANIMATION WITHOUT FADING BEING ENDED YET
  • Play fires after method :Play() being applied
  • DidLoop fires after looped animation jumping into another loop
  • Ended FULL STOP OF AN ANIMATION

Settings :hammer:

Accesing settings = YourAnimationHere.Settings
[“Priority”]:Enum.AnimationPriority
[“Name”]:string – optional
[“StartsAt”]:number – force animation to start at X time of timeline
[“CurrentlyAt”]:number – you can force animation to change its time on timeline xd
[“Speed”]:number – speed multiplier of an animation,negative value reverses an animation
[“Playing”]:boolean – self explanatory
[“Loop”]:boolean – will animation loop?
[“Animate”]:boolean – supposed to remove all lerping completelly,was never tested more info you can find by reading comments in module itself
[“UpsyncThePlaying”]:number – here is a copy of comment in module:–[[
1 a little speed up ramp and then return to normal speed with now synced animation
2 increase speed in all animation to sync ]]
[“Lengh”]:number – lengh of an animation

Known issues

Module is not perfect but you can improve it :grinning:
Animation blending is very poorly made and i will be super happy if anyone will fix it and will post on devforum

1 Like

Ah, what can I say: First of all, both Transform and C0 - bullsh… for modules of this type (my module has both C0 and Transform and Combined type) Why did I say that both of them suck? because C0 does not allow other animations to be played (for cutscenes), and Transform, on the contrary, “merges” not only with the animations you need, but also with the basic ones, which of course is not very good. (I may have confused Transform and C0) About EasingStyle - my module supports each of these styles! SkinnedMesh,R6 and R15 - well, this is the “base”. And about the video - is the animation lagging or is the video itself actually? -
in short, my module is better (I suppose in everything), but don’t worry too, you’re doing very well too. For the average scriptwriter. KeyFrameSequence Reader - Better LoadAnimation - Help and Feedback / Creations Feedback - Developer Forum | Roblox :money_mouth_face:

1 Like

Roblox animator does change Transform after PreSimulation i think and Stepped comes right after it
You could track roblox changes and then blend them with your animation hower i see that kinda useless.I dont fully understand how roblox does blend both or more animations hower since there is 0 explanations to it from docs.
Also Transform does not replicate itself (that why i have made anymatioj syncing and UpsyncThePlaying also animation is not lagging in the video exept for animation blending attempt as i said its the video itself insanely xompressed to fit 10MB cap more over u have provided testing place
Please do research before commenting anything
Answering your question what is C0 and c1
C0 is a position of cframe
C1 is an offset
Transform is c0*c1
That is what i remember i meight be wrong
Currently tryping it on phone at night so meight make some mistakes
Also i don’t accept criticism without deep research and analyzing thanks for trying tho
I haven’t tried your module so cannot say anything about it.

1 Like

i decided to do more research on how blending works and possibly rescript module once again
and fix some bugs that is possible to appear

1 Like

too much changes but in past 2 days i archived:
Attempt to fully mimic AnimationTrack | Documentation - Roblox Creator Hub style
Somewhat working blending
I understood how for 100% mimic it but requires a lot of micro managing so right now its pure random but will work regardless and almost unnoticable.

Currently its done? but i want to update demo place
Edit: also added weigh system better


gifFunny

i made another post

due to change of format aswell i want to keep this post