Released 2019-05-27
Upgrade Guide
You must delete any old version of Animancer before importing a new one because Unity's package importer doesn't handle deleting or moving files.
It is also recommended that you use the latest possible Unity version.
All of the Major Features and Changes are listed below.
The features included in Animancer Lite have been changed slightly:
AnimancerComponent.CrossFadeis now allowed, but only with the default 0.3 second fade duration.AnimancerState.TimeandSpeedcan no longer be set in Lite runtime builds (exceptTime = 0).- Added once-off log message when a Pro-Only feature is used in an Animancer Lite build.
Quite a few things have been renamed to be shorter and/or better reflect their purpose:
| Old Name | New Name |
|---|---|
AnimancerControllerLegacyAnimancerControllerSimpleEventAnimancerControllerIAnimancer |
AnimancerComponentNamedAnimancerComponentEventfulAnimancerComponentIAnimancerComponent |
AnimationMixerLinearAnimationMixerCartesianAnimationMixerDirectionalAnimationMixer |
MixerStateLinearMixerStateCartesianMixerStateDirectionalMixerState |
AnimatorControllerStateFloatParameterControllerStateVector2ParameterControllerStateVector3ParameterControllerState |
ControllerStateFloatControllerStateVector2ControllerStateVector3ControllerState |
AnimancerExtensions |
AnimancerUtilities |
AnimancerStateInspector |
AnimancerStateDrawer |
AnimancerController.CrossFadeNew |
AnimancerComponent.CrossFadeFromStart |
AnimancerController.StopAll |
AnimancerComponent.Stop |
AnimancerPlayable.StopGraphAnimancerPlayable.PlayGraph |
AnimancerPlayable.PauseGraphAnimancerPlayable.UnpauseGraph |
AnimancerPlayable.DisconnectAnimationsOnStop |
AnimancerPlayable.KeepPlayablesConnected (meaning is reversed) |
AnimancerState.MainAsset |
AnimancerState.MainObject |
ClipState.ApplyPlayableIK |
ClipState.ApplyAnimatorIK |
Major Features
- Replaced the 3 rudimentary demos with 22 proper Example Scenes that have highly detailed tutorial explanations.
- Massively improved the documentation in general with lots of code examples and animated gifs.
- Added
AnimancerState.Serializableclasses which make it easy to group additional details with eachAnimationClip(such asSpeedandStart Time), as well as set up Mixers and Controller States in the Inspector. - Added proper support for playing animations in Edit Mode. See the Doors example for a demonstration.
- Improved performance, especially in situations when lots of animations are inactive.
- Improved the API for managing IK defaults and added an
ExposedCurveclass which extracts a curve from anAnimationClipso you can access it at runtime. The inability to access curves directly was the main reason Inverse Kinematics was not listed as supported in previous versions. - Improved the Finite State Machine system.
- It now has a base class which allows you to reference states directly instead of using a keyed dictionary.
- Added support for Animation Events called "End" which invoke the
AnimancerState.OnEndcallback so that animations can pretend they are ending early, usually to begin fading out as the animation approaches its end. - Greatly improved various aspects of the Inspector.
- Added
AnimancerComponent.StopOnDisableto control whether all animations are stopped byOnDisable. Also exposed it in the Inspector. - Implemented the
IAnimationClipSourceinterface introduced in Unity 2018.3 throughout the system:- Added
IAnimancerClipSourcefor classes to indicate that they can provide animations to an AnimancerComponent forIAnimationClipSourcein Unity 2018.3. The actual implementation is done using reflection inAnimancerEditorUtilities. - This allows custom components using Animancer to provide
AnimationClips to the Animation window without needing anAnimatorController.
- Added
Minor Features
- Added
SoloAnimationcomponent for playing a single animation on startup in the simplest way possible. - Added
AnimationEventparameter toEventfulAnimancerComponentand added an optionalEventSourceproperty to exclude events from other clips. - [Pro-Only] Added
ManualMixerStatewhich gives full manual control over the child weights instead of trying to calculate them automatically based on a parameter. - Added
OrbitControlscomponent to allow standard camera movement in the example scenes. - Added
PixelPerfectPositioningcomponent for the sprite examples. - Added
DirectionalAnimationSetandDirectionalAnimationSet8for the sprite examples. - Added
NamedAnimancerComponent.DefaultAnimationfor convenience. - Added
BoolPrefto wrap anEditorPrefsbool. - Added the ability to set
AnimancerState.LayerIndexto swap between layers. - Added a
Toggle Legacycontext menu function toAnimationClips. - Added
AnimancerState.IsActiveto check if it is playing and fading in. - Added default IK properties and properties that set the IK flags of all states at once to
AnimancerLayer. Added context menu functions to set them. - Added Editor-Only finalisers to ensure that the
PlayableGraphis disposed so animations can be played properly in Edit Mode. - Added automatic update system for
AnimancerPlayables that are created in Edit Mode. - Added
AnimancerComponent.CurrentEndEventandCalculateFadeOutDurationto easily access the remaining duration during an early "End" event.
Changes
- Renamed lots of things - see the Upgrade Guide.
- Moved documentation website to kybernetikgames.github.io/animancer.
- Changed
ICanFadeintoAnimancerNodeas a common base class for states and layers.- Reworked the whole node hierarchy system.
- All nodes now have a direct reference to the root
AnimancerPlayablewhich must be provided in the constructor so they can always access its dictionary and graph even without a parent.
Playmethods no longer reset theAnimancerState.Timeto 0. You can easily do so after the call if necessary, but you generally just want the animation to continue playing.- Organised common functions into
EditorUtilities.- Added
EditorUtils.GetNarrowTextto include or remove spaces from Inspector labels based on whether the Inspector is wide enough to space the room.
- Added
- Removed
AnimancerState.PauseandResumemethods. - Moved
CrossFadeFromStartfunctionality intoAnimancerLayer. - [Pro-Only] Rearranced
MixerState.UpdateTimeto update itself last like withUpdatePlayable. - Moved the State Machine system out of Examples to its own folder and into the
Animancer.FSMnamespace. - Added virtual
AnimancerState.Lengthand moved the loading bar style time display into the baseAnimancerStateDrawerfor any state that has a length. - Changed IK get/set methods to properties.
- Moved all
ScriptableObjects to the Assets/Create/Animancer sub-menu. - Replaced
AnimancerComponent.AddStatewithAnimancerState.Key. - Stopped exposing
Playables publically and made theminternalso they can be used internally without copying. - Changed
AnimancerTransitionto just be a wrapper around aClipState.Serializable. - Moved the component type swap from
AnimancerComponent.ResetintoAnimancerEditorUtils.IfMultiComponentThenChangeType. - Merged the
Play,CrossFade, andCrossFadeFromStartoverloads that useITransitioninto a singleTransitionmethod that chooses which method to use based on the transition itself. - Moved the main logic for playing
ITransitions intoAnimancerPlayable. - Changed
AnimancerPlayable.DefaultFadeDurationto 0.3 since that's what the Legacy Animation system uses. - Added
[DefaultExecutionOrder(-5000)]toAnimancerComponent. - Added the ability to directly set the
AnimancerState.Clip(and theControllerState.Controller).- Merged
AnimancerComponent.ForceSetClipintoGetOrCreateStatewith an optional parameter and changed it to set the clip without destroying the state (it still destroys the internalPlayable, just not theAnimancerStateobject so any existing references to it will remain valid).
- Merged
Improvements
- Added internal lists for states that need to be updated so the entire graph doesn't need to be traversed every update. This gives a negligible performance improvement with a small graph, but scales better with lots of inactive states.
- Improved the
AnimancerState.OnEndcallback:- Removed the 'event' keyword.
- They now trigger every frame while a non-looping animation is past its length.
AnimancerState.Stopnow clears the callback so that states stopped byPlaywill have it cleared just like states that fade out from aCrossFade.
- Added
AnimancerPlayable.IsValidso theAnimancerComponentcan recreate it if it was disposed. - Added
DestroyStatestoAnimancerPlayableandAnimancerLayer. - Split
NestedAnimatorEditorout ofAnimancerPlayableEditor:- Improved all fields to work as the do in the regular
AnimatorInspector (particularly at runtime). - Fixed
NestedAnimatorEditorto show the prefab override status correctly. - The nested Animator fields are no longer hidden while the regular Animator Inspector is expanded. Also improved their tooltips.
- Improved all fields to work as the do in the regular
- Improved many comments with code examples such as
AnimancerState.OnEndandAnimancerState.Time.- Improved comments describing exceptions in validation methods.
- Added
<exception>tags to all methods that throw exceptions. - Replaced
<code>tags in comments with<c>where they are intended to occupy a single line only (for the API Documentation.
- Added an assembly definition file to speed up compilation in Unity 2017.3+.
- Renamed Animancer.dll to Animancer.Lite.dll to resolve naming conflict with the
Animancerassembly definition.
- Renamed Animancer.dll to Animancer.Lite.dll to resolve naming conflict with the
- Added more detail to the "Playable is not initialized" message in the Inspector.
- Added
#pragmas to disable the "field will always have its default value" warnings in the example scripts. - Improved the layout of the
WelcomeWindow. - Improved layer fading.
- Layers now start on 0 weight and automatically get set to 1 when they play an animation so that extra layers can be initialized and left idle without needing to set the weight to 0.
- Calling
CrossFadewith the layer at 0 weight will fade the layer in andPlaythe animation immediately. - Calling
CrossFadeon the base layer will immediately set its weight to 1 since it can't blend effectively with anything else anyway. - Starting a layer fade now clears the
OnEndcallback of all its states.
- Added
AnimancerPlayable.maxLayerCount(Editor-Only). - Fixed
CrossFadeto callOnStartFadeon all states when it continues a faster fade, not only the target state. - Added the ability for
AnimancerComponentEditors to override the GUI for specific properties. - Added NamedAnimancerComponentEditor:
- Draws the default animation as a separate field from the rest of the array for convenience.
- Draws the Animations array as a reorderable list.
- Highlights animations that appear multiple times in the array.
- Improved tooltips.
- Added
AnimationTypeenum which is used to compare theAnimatorto theAnimationClipto determine if the clip is suitable so a warning can be shown in the Inspector if necessary. - Added
PlayableGraphname for thePlayable Graph Visualiser. - Added methods for tracking non critical issues (such as non-essential reflection attempts that fail) and changed the
Log Description of Statesmenu function to log them as well. - [Pro-Only] Split
AnimancerLayer.Infoout intoEditor.AnimancerLayerEditor. - Destroying layers now uses
PlayableGraph.DestroySubgraphfor better efficiency. ClipStatenow dirties its time at the end of each update (instead of the start) since the playable is updated immediately afterwards.- Removed
AnimancerPlayable.OnAnimancerChangedto save the performance when the Inspector isn't shown. - Added
AnimancerState.NormalizedSpeed. AnimancerComponentnow checks that itsPlayableis valid rather than only null checking it.- Added a custom Inspector for
AnimancerTransitions which explains that they are assets so changes won't be undone when leaving Play Mode. - Added
GetStateandTryGetStateovelroads which take anAnimationClipand useGetKey. - Added
DelegateStateandInputBufferto theAnimancer.FSMsystem. - Split
StateMachine.TrySetStateso that it now immediately returns true if the specified state is already the current state whileTryResetStatedoes not. ClipStatenow looks one frame ahead when checking itsOnEndcallback to line up with Mecanim sequencing a bit better.- Changed
ClipStateto use the frame ID to determine when the time is dirty instead of flagging it every frame. - Merged
AnimancerState.PortIndexandAnimancerLayer.LayerIndexintoAnimancerNode.PortIndex. - Improved validation when connecting states to a
MixerState. AnimancerPlayable.KeepPlayablesConnectedis now false by default.- Added
IAnimationMixer.KeepWeightlessPlayablesConnectedso mixers can prevent their children from being disconencted. - Removed the list of spare ports in each layer. Destroying a state now swaps the last state into its place so there are no gaps. This means that iterating through the states doesn't require any null checks.
- Cleaned up enumerators for yield instructions and foreach loops.
- Standardised
GetComponentInHierarchyinAnimancerUtilities. - Improved layout of
ControllerState.Drawer. - [Pro-Only] Added
ParametizedAnimancerStateDrawerto standardise the drawing of parameters inMixerStates andControllerStates. - [Pro-Only] Added
AnimancerLayer.CurrentStateIDto count the number of times theCurrentStateis changed. - Removed the
virtualkeyword fromAnimancerComponent.PlayandCrossFade. - Reworked
SimpleEventAnimancerComponent:- It now uses the
CurrentStateIDto determine whether the registered event is still valid so it doesn't need to clear the event all the time. - Renamed it to replace the base
EventfulAnimancerComponent.
- It now uses the
- Added standard Animation Event receivers to
AnimancerComponentforPlayand related methods. - [Pro-Only] Added
ControllerState.Parameterstruct to wrap name/hash pairs. - Added
IHasKeybase interface forITransition.- Added
GetState(IHasKey)and related methods.
- Added
Inspector Improvements
- Improved the
AnimancerComponentInspector details displayed in Play Mode.- Improved the weight display to round everything to 1 decimal place in the main view and only show the full number in the expanded details. It also uses Italics to indicate when a value is being rounded and fades the colour proportional to the value.
- Added a foldout to the layer Inspector with all their details (weight, fade, additive, mask).
- Setting a layer mask now uses its name as the layer name if none was set yet.
- Fixed errors for 0 length clips (such as a single keyframe Idle).
- The time highlight box now stays full for states with 0 length instead of staying empty.
- When the
PlayableGraphis not playing, the Inspector will now show a toggle to play it. - You can now
Ctrl + Clickon a state in the Inspector toCrossFadeto it. - [Pro-Only]
ControllerStatenow shows its time in the same way asClipState. - [Pro-Only] Added Inspector controls for Parameter Controller States.
- String keys are now shown with quotation marks.
- Improved warnings in the
AnimancerComponentInspector:- Improved the warning when an
AnimatorControlleris assigned and turned it into a button linking to the documentation. - Improved the warnings for update modes and layer weight and turned them into buttons that link to the documentation.
- Added a warning when no layers are at weight 1.
- Added a warning when no Animator is assigned. You can click it to automatically search for one nearby.
- Added a warning when an animation has an "End" event but no
OnEndcallback is registered.
- Improved the warning when an
- Added Drag and Drop support to the
AnimancerComponentInspector to create aClipStatefrom anAnimationClipor several from anIAnimationClipSource. Animations that already have states won't create new ones. - Added Drag and Drop support to the
NamedAnimancerComponentInspector to add anAnimationClipto theAnimationslist. - Improved the
NamedAnimancerComponentInspector:- It now uses a
ReorderableListto display theAnimationslist. - It now removes null elements from the
Animationslist. - It now hides the
Play AutomaticallyandAnimationsfields in play mode.
- It now uses a
- Added and improved menu context menu functions:
- Improved the state Inspector context menu layout and added context menu functions for
PlayandCrossFade. - Added context menu functions to the layer Inspector.
- Added documentation links to all context menus.
- Replaced
PortIndexin context menu details with the state's hierarchy path. - Improved Inspector context menu handling. The base layer can now show its menu even when it's not showing the header because it's the only layer.
- Added
AnimancerComponentcontext menu functions to Pause/Unpause the graph, which will freeze/unfreeze all animations on that object. - Added a layer context menu function to open the Playable Graph Visualiser if it exists in the project.
- Added context menu functions to change the way states are displayed in the Inspector and changed the default to sort by name and not split active/inactive into separate lists.
- Replaced "Add Layer" context menu function with "Initialize" when the
AnimancerPlayableisn't initialized so it doesn't create two layers at once. - Added a context menu toggle for
AnimancerPlayable.KeepPlayablesConnectedand fixed it to properly set the weight of reconnected states.
- Improved the state Inspector context menu layout and added context menu functions for
Fixes
- Fixed the obfuscated DLLs in Animancer Lite to not cause exceptions in Unity 2018.3 (the exceptions were harmless and didn't affect functionality at all, but were very annoying).
AnimancerLayer.CrossFadenow makes sure to callClearOnEndEventeven if it only continues an existing fade.- Fixed
AnimancerLayerandAnimancerPlayable.IsPlayingto return false when there are no layers or states respectively. - Fixed auto-collapse of the
Animatorcomponent to be executed when anAnimancerComponentis first added. - Moved
AnimancerLayer.DisposeintoAnimancerPlayable.LayerCount(when reducing the value) since it otherwise leaves the layer list in an invalid state. - Fixed
AnimancerState.OnEndinvocation with negative speed to occur when time is below 0. - Fixed
NamedAnimancerComponentto properly unpause the graph when re-enabling. - Fixed reconnecting a state to the graph to leave the weight alone if it wasn't dirty.
- Setting
AnimancerPlayable.KeepPlayablesConnectednow changes all connections to properly reflect its new value. - Fixed
AnimancerState.MoveNextto support properly work with negative speeds. - [Pro-Only] Added exception to
ControllerStateconstructor if thecontrolleris null. - Fixed
AnimancerPlayable.GetOrCreateStateto properly change the layer index. - Fixed a bug in the Inspector when undoing an
AnimancerComponenttype change.