# AnimationServer class

Namespace: [Grasshopper2.Animation](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.animation.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class AnimationServer : IStorable
```

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.

## Properties

- [Animations](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/animations.md): Gets all animations in this document.
- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/count.md): Gets the number of animations in this document.
- [Document](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/document.md): Gets the document this server belongs to.
- [IsRunning](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/isrunning.md): Gets whether an animation is running.
- [Running](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/running.md): Gets the animation currently running, or null.
- [StoredCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/storedcount.md): Gets how many animations would actually be written to a file, which is every one except the placeholders. Deleting the last animation leaves an empty one behind so the animation window still has something to show. That stand-in is not saved, so a document holding nothing else has nothing to write and should not be asked to.

## Methods

- [Add](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/add.md): Add an animation to this document.
- [Adopt](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/adopt.md): Find the animation which drives an object, or create one for it. This is what the 'animate this' entry point on an object calls.
- [Cancel](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/cancel.md): Ask the running animation to stop. The current frame is abandoned rather than finished, and the document is put back the way it was.
- [Find](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/find.md): Find an animation by identity.
- [FindByObject](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/findbyobject.md): Find the first animation which drives a specific object.
- [Remove](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/remove.md): Remove an animation from this document.
- [Run](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/run.md): Run an animation. The returned task completes when the run does; it does not fault, every failure is reported through the resulting report instead.
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/store.md): This method is called whenever the instance is required to serialize itself.
- [SuggestName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/suggestname.md): Suggest a name for a new animation which is not already in use.

## Events

- [Progress](https://developer.rhino3d.com/api/gh2/type/grasshopper2.animation.animationserver/progress.md): Raised once per frame while an animation runs. Raised on the animation thread, so a handler which touches the user interface must marshal.
