Custom Timeline Keyframes and Data Painter Tools
Custom keyframes for Unity's timeline allow for easy interpolation of any custom data type including visual tools and a modular tooling system to creatively manipulate your data for use as input of generative animation and more
2021-11-18-110410-640p.mp4
Features
- Custom keyframes (keyframe and interpolate any collection of types)
- Undo / Redo
- C# to compute shader binding
See videos below
State of the project
This tool was originally developed to ease animating with code and give me some flexible and visual tools to control generative animation. It should be in a working state but still rough around the edges of e.g. UX, is not tested in production of any real project. Yet I think it can be useful and I hope to return to it one day to improve all the things that need attention (e.g. better documentation, improving the UI and UX for the modular tools, fixing of bugs, improving performance, finish implementation of C# β compute binding).
That being said: please open issues if you have problems or contribute by opening a PR
Samples
A minimal sample is in projects/Timeline-2020_3/Assets
. More examples for getting started can be found in the playground repository. I'll try to cleanup and provide better samples soon
Dependencies
Getting started
- Create a timeline, add a
Code Control
track to it. Right click in the control track to create aControl Track Asset
(same as AnimationClip but for custom data, it can be re-used multiple times in a timeline or other timelines) - Create script that implements the
IAnimated
interface or derives from theAnimated
class:
public class SimpleScript : Animated
{
// Here is a custom type that you can control via timeline
public class Point
{
// a field named position will automatically be detected by the spray tool to be painted in 3d space
public Vector3 Position;
// you may name fields as you like and add as many as you want. They will show up in the tool to be painted and individually manipulated
public float Radius = .1f;
}
// annotade any field that you want to animate via timeline with the Animate attribute:
[Animate]
public List<Point> MyList;
// this is just for the sake of visualizing the painted points:
private void OnDrawGizmos()
{
if (MyList == null) return;
foreach (var pt in MyList)
{
Gizmos.DrawSphere(pt.Position, pt.Radius);
}
}
}
- Add the script to your control track
- Open the
Tools/Timeline Tools
window - Open the curve views of the Control Track and click the record button for the field in your script, then start painting data.