EMI: Save and restore animation states. Fixes #902