# Grasshopper2.Animation namespace

Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

## Interfaces

- [IAnimatableObject](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.ianimatableobject.md): Implemented by document objects which can be driven by an animation. An animatable object can snapshot its own state, describe the two extremes it is able to reach, and move itself to the state belonging to a frame.
- [IObjectState](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.iobjectstate.md): A snapshot of the animatable state of a single object. States are opaque: only the object which made one knows what it contains, and an object being handed a state it does not recognise is expected to ignore it rather than throw. A state is a value, not a live view of the object. Taking one and applying it later must put the object back the way it was, which is what lets an animation leave a document exactly as it found it. States are stored with the animation which uses them, so every implementation needs an [IoIdAttribute](https://developer.rhino3d.com/api/gh2/type/grasshopperio.ioidattribute.md) and a constructor taking a reader, exactly as any other storable type does. They are read back through the interface rather than through the concrete type, so the identifier is what decides which type gets built. The stored form is also what a resumable render is fingerprinted against, so it has to describe the state completely. [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring) is not part of the contract. Where a state is shown to a user it draws itself; anything it returns from ToString is for logs and debuggers, and implementations are free to leave it alone.

## Classes

- [Animation](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animation.md): A single, named animation setup stored inside a document. An animation knows which objects it drives, how many frames it consists of, and where the resulting images are supposed to end up. An animation holds no live state of its own. Running one is the job of the [AnimationServer](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver.md), which may run the same animation any number of times.
- [AnimationBinding](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationbinding.md): A single binding between an animation and one animatable object in the document. Bindings reference their object by instance id rather than by reference, so a binding survives a document reload and tolerates an object which has been deleted and restored by an undo.
- [AnimationManifest](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationmanifest.md): The record an animation leaves in its output folder. It exists so an interrupted animation can be picked up where it left off, so a resumed animation can tell whether the frames already on disk belong to the same setup, and so a folder full of numbered images can say what it is and where it came from. A manifest is derived data, not part of the document. It lives with the images it describes, which is what keeps an unrelated edit to the definition from invalidating a half finished render.
- [AnimationProgressEventArgs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationprogresseventargs.md): Progress of a running animation. Raised once per frame, on the thread driving the animation rather than the user interface thread.
- [AnimationReport](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationreport.md): What an animation run did. Frames which failed are listed rather than merely counted: a hole in the middle of a sequence is easy to miss on playback and impossible to find afterwards.
- [AnimationServer](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver.md): The animation server owns the named animations belonging to a document, and runs them. Animations are an offline batch process. A frame takes as long as it takes to solve the document and capture the images, which is typically far longer than a frame is meant to last on playback, so the server writes numbered images to disk rather than trying to keep any kind of real time schedule. Only one animation may run at a time, and a run may be cancelled or resumed.

## Enums

- [AnimationOutcome](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationoutcome.md): How an animation run ended.
- [FrameDisposal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.framedisposal.md): What becomes of the frame images once a post-process has made something out of them.
- [PostProcess](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.postprocess.md): What to make out of an animation's frames once every one of them is on disk. A post-process only ever runs after a completed run. A cancelled run, or one which could not write every frame, leaves a hole in the sequence, and every encoder here would quietly stop at that hole rather than complain about it.
