Released 2020-07-17
Upgrade Guide
- See the Animancer v4.0 Upgrade Guide first if you are upgrading from a version older than that.
- The Minimum Unity Version is now 2018.4 and it requires the .NET 4.x scripting runtime (the default for all new projects) because it uses C# language features like expression bodied methods, ref returns, out variables, nameof, and string interpolation.
- Renamed the
AnimancerComponent.Play(object key)methods toTryPlayand changed them to throw exceptions if the key isn't found instead of returningnull. Unlike the otherPlaymethods, those ones can only use existing states but not create new ones so this change ensures that they can't be accidentally used when intending to use one of the other overloads and also prevents them from silently doing nothing if the key isn't found. - The
AnimancerPlayable.StateDictionaryindexers (animancer.States[...]) now throw an exception if no state is registered with the specified key. - When using a script to access Animancer Events in a Transition, instead of accessing them with
transition.Events.Sequence...you now only needtransition.Events...(the serialized sequence is accessible viatransition.SerializedEvents). MixerState.CreateStatehas been renamed toCreateChild.- Added
LinearMixerState.ExtrapolateSpeedto allow parameter values above the highest threshold to increase theSpeedof the mixer proportionally. This feature is enabled by default and you can try it out in the Linear Blending example by simply increasing the maximum value of the UI Slider.
Major Features
- Added Custom Fade system for easily fading weights using an
AnimationCurve, custom delegate, orInterpolation.Functionenum to tweak your transitions as described here. - Added
MixerParameterTweenfor easily interpolating mixer parameters over time. - Animancer can now be blended with an Animator Controller assigned to the regular
Controllerfield on theAnimatorcomponent, though this is subject to several limitations (described on that page). - Expanded support for Animation Jobs:
- Added several examples in the Examples/10 Animation Jobs folder:
- Two Bone IK: a basic IK system that works on Generic rigs (unlike Unity's built in IK).
- Damping: applies simple physics based drag to a character's limb.
- Lean: lets you dynamically lean a character with a slider.
- Added
AnimancerPlayable.InsertOutputJob,AnimancerPlayable.InsertOutputPlayable, andAnimancerUtilities.RemovePlayableto allow Animation Jobs and other playables to be easily added to the graph output. - Added
AnimancerPlayable.Disposableslist for easily registering objects that need to be cleaned up with the graph (mostlyNativeArrays). - Added
AnimancerUtilities.CreateNativeReferenceto create single element arrays for easy data interactions in and out of jobs. - Added several
MixerState.CreatePlayable<T>andGet/SetJobDatamethods to use Animation Jobs in Mixer States instead of the defaultAnimationMixerPlayable.
- Added several examples in the Examples/10 Animation Jobs folder:
Minor Features
- Added optional Event Names to
AnimancerEvent.SequenceandAnimancerEvent.Sequence.Serializableso they can be used to identify events when defining event times in the Inspector and assigning their callbacks in code. #56 - Improved Transition Previews:
- You can now pan the camera using Left Click while Right Click still rotates it as before.
- Added settings to customise the movement and rotation sensitivity.
- Added a field for selecting a model with a dropdown that remembers previously used assets.
- It automatically picks a recently used model based on the best match of properties animated by the transition and properties that exist in each model.
- Added default human model (uses Animancer's DefaultHumanoid if it exists, otherwise it uses Unity's DefaultAvatar which is just the same model with a different texture).
- Fixed the grid to properly draw behind
Sprites. - Added the ability to assign a custom floor material or disable the floor entirely because Scriptable Render Pipelines often break the default shader. #53
- Fixed the internal details display to use the correct margins in both the Inspector and
TransitionPreviewWindow. AnimancerState.RecreatePlayableis now overridden byControllerStateandMixerStateto retain their parameter values.- Fixed the preview time indicator in the
TimeRulerto work properly on transitions with a variableAnimancerState.Length(ControllerStateandMixerState). AnimationGatherernow stores exceptions in a list for theTransitionPreviewWindowto show instead of logging them.- It no longer resets the preview time after an assembly reload.
- Replaced the "Possible animation type mismatch..." warning in the Inspector with a compact icon:
- The icon differentiates between warnings (some animated properties aren't present in the Rig) and errors (none of the animated properties are present in the Rig).
- You can click the icon to have it log a full explanation of the incompatibilities between the animations and the Rig.
- If this feature is affecting your performance too much while you have a character selected, you can disable it via the Display Options in the layer context menu.
- Added DefaultHumanoid model (Unity's DefaultAvatar with a different texture) to replace the LowPolyMan.
- Fixed the finger pose of all Humanoid animations (the LowPolyMan didn't have individual fingers).
- Improved the SpiderBot model:
- Cleaned up the naming conventions for bones, meshes, etc.
- Added foot bones so it can be used with Two Bone IK (one of the Animation Jobs examples).
- Added
Start Timefield toControllerTransition. - Added
AnimancerEvent.Sequence.AddCallback. - Added
AnimancerPlayable.Graphto expose thePlayableGraph. #48- Removed
AnimancerNode.Graphsince custom states can now directly access theRoot.Graph.
- Removed
- Reworked the
AnimatedPropertysystem:- Instead of a
Typeenum parameter, it now has a generic base class with several subclasses:AnimatedFloat,AnimatedBool, andAnimatedInt. - Improved the performance of accessing the value.
- It is now supports accessing multiple properties in a single
AnimatedProperty, which is more efficient than making multiple separateAnimatedPropertyobjects. - Added
AnimancerJobbase class to allow custom Animation Jobs to be easily inserted into the graph. It intercepts the playable output instead of creating its own. This is more efficient and means that it and the Uneven Ground example no longer requires Unity 2019.1+. AnimatedPropertynow usesAnimancerPlayable.Disposablesto clean up itsNativeArrays so you no longer need to manually destroy them.
- Instead of a
- Added various state creation methods:
AnimancerLayer.CreateState<T>for creating any state type as a child of that layer (with the same inAnimancerPlayable.StateDictionaryfor the default layer).MixerState.CreateChild(index, transition)to avoid the need to callCreateStateandApplywhen manually constructing a mixer.- Renamed
MixerState.CreateStatetoCreateChild.
- Added
WarningTypeenum with various extension methods inValidateto standardise the way optional warning messages can be disabled.- These warnings can be disabled individually using
WarningType.X.Disable();. - Moved the Pro-Only, duplicate event, and unsupported event warnings to this system.
- Added a warning when attempting to enable IK on a
ControllerStateorPlayableAssetState. - Added a warning when attempting to use Animancer Events on a
ControllerStates explaining that it will probably not work as expected. #37 - Added a warning for when an
AnimancerPlayableis created for an inactiveGameObjectto explain that it needs to be manually destroyed if that object is never activated because Unity won't callOnDestroyotherwise. - Added a warning for when adding the same callback to an
AnimancerEvent.Sequencemultiple times, even if the delegate'sTargetobject is different. This allows it to detect situations where multiple objects are each adding their own version of an event to a shared sequence. - Added a warning for when the
Animator.speedis changed to explain thatAnimancerPlayable.Speedneeds to be used instead.
- These warnings can be disabled individually using
- Added
ObjectPoolmethods forStringBuilders and replaced all standard usage with them.
Changes
- Renamed the
AnimancerComponent.Play(object key)methods toTryPlayand changed them to throw exceptions if the key isn't found instead of returningnull. Unlike the otherPlaymethods, those ones can only use existing states but not create new ones so this change ensures that they can't be accidentally used when intending to use one of the other overloads and also prevents them from silently doing nothing if the key isn't found. - The
AnimancerPlayable.StateDictionaryindexers (animancer.States[...]) now throw an exception if no state is registered with the specified key. - Renamed the
AnimancerTransition.Eventsproperty toSerializedEventsand replaced the original with a property that returns theAnimancerEvent.Sequencedirectly instead of theAnimancerEvent.Sequence.Serializable. - Changed
AnimancerLayer.Playto only snap itsWeight = 1if it was at 0 rather than if it was not at 1. - Moved the editor version of Animancer.Lite.dll into the Internal/Core folder since having it visible in the root Animancer folder serves no purpose.
- Mixers now initialize with empty arrays of states and thresholds so they don't need to null check them.
ManualMixerState.Initialize(count)now creates thePlayableif theRootis set and simply changes the number of inputs if it already existed.- Moved various functionality from
ManualMixerStateinto the baseMixerStateso it can be used by custom mixers that don't want to inherit fromManualMixerState. - The
AnimancerComponentInspector now always shows theAnimancerPlayable.IsGraphPlayingfield (instead of only when it is paused) and also shows itsSpeedfield. - Changed
Transition.CreateStateto a method because it doesn't make much sense as a property. AnimancerUtilities.AddAnimancerComponent(anAnimatorextension method) now clears theruntimeAnimatorController.- Removed the standard Animation Event receiver methods from
AnimancerComponentsince they were not very convenient to use anyway.- Added
EndEventReceiverfor receiving Animation Events with the Function Name "End" and moved all the related functionality out ofAnimancerPlayableandAnimancerLayer.
- Added
- Removed the context menu functions from
AnimancerComponentsince they are no longer necessary with the changes to the runtime Inspector. - Standardised
AnimancerState.ToStringinstead of having each child class implement its own. - Split
AnimancerPlayable.AppendInternalDetailsout ofAppendDescriptionso it can be used to display updatables, dirty nodes, and disposables in a single label. AnimationType.Spritenow includes any object with onlySpriteRenderers in its children without any otherRenderertypes.- Moved
GetParameterValue(andSet) toAnimancerUtilitiesto be usable at runtime. - Changed
AnimancerPlayable.FrameIDfromuinttoulongto avoid the need for a cast. ScriptableObjectEditornow displays its message about changes being undone when exiting Play Mode as a warning rather than info and only in Play Mode.AnimancerNode.ConnectToGraphnow applies the weight instantly instead of registering the node to be updated.OrbitControlsnow uses an enum to specify the mouse button instead of an int slider.- Changed
KeyedList.AddNewto throw an exception if theitemis already in another list (sinceKeyedLists only allow eachitemto be in one list at a time).
Improvements
- Added
AnimancerUtilities.CreateStateAndApplyextension method forITransition. - Added
MixerState.DontSynchronizeChildrenwhich can be assigned to theSynchroniseChildrenproperty to easily disable synchronization for all children without needing to allocate an array of the correct size. - Added
contextparameter to various log messages so that clicking them in the Console window will highlight the object that caused the message. - Improved the "AnimancerNode.Root is null" exception message to explain that you probably just need to play the state or call
state.SetRoot(animancer)before trying to access it. - Added
Validate.AssertPlayableto give a more useful error message if a state'sPlayabledoesn't exist. - Middle clicking on live fields to reset them now deselects the active control since having a field selected would not display the modified value.
- All
Transition.CreateStatemethods now set theStateproperty. - Added more specific exceptions for if you try to initialize a mixer without any clips or thresholds.
- Added
ObjectPool.GetCachedResultfor easily creatingGUIStyles and other things that need caching. - The Display Options Conext Menu functions are now shown on states as well as layers.
- Added
Repaint Constantlyoption which can be disabled to reduce the automatic repainting rate to an interval specified in theAnimancerSettings(default 0.25 seconds) in case the constant repainting is affecting performance.
- Added
- Improved the 3D Game Kit example to use a
CustomFadefor the random idle animations and a Mixer for Locomotion instead of the old Blend Tree. - Improved the Inspector warning when the
Animator.runtimeAnimatorControllerfield is assigned to explain how generic rigs need a second layer.
Fixes
- Added
DummyObjectEditorback in for Unity 2018.4. - The Inspector warnings about layers being at 0 weight are no longer shown if the object is inactive since the default
DisableAction.Stopresets everything to 0 weight. - Fixed an exception when resizing transition arrays in the Inspector on a script without a custom Editor. #38
- Fixed the
AnimancerState.Timeproperty to work properly for Mixers. #51 - Fixed
AnimancerNode.ParentEffectiveSpeedto exclude the root because the delta time value already includes it.- This fixes cross fading to advance correctly when the root speed is not 1.
- Fixed
AnimancerNode.EffectiveSpeedto not throw exceptions if theRootis not set.
- Fixed the
MixerState.SynchroniseChildrensetter to correctly reset the speed of any children that were previously synced but aren't anymore. - Fixed the
AnimancerNode.WeightandTargetWeightfields in the Inspector to silently clamp the value to be non-negative instead of letting the underlying properties throw exceptions. - Fixed
AnimancerEvent.Sequence.CopyFromand the copy constructor to properly handle nulls. - Fixed GUI Layout bug in
AnimancerPlayable.DoUpdateListGUIif the lists are changed between Layout and Repaint events. - Fixed
AnimancerLayer.Playto respectFadeMode.FromStartwhen thefadeDurationis 0. - Fixed various Mixer methods to recalculate the child weights if necessary.
- Fixed
StackOverflowExceptioninLinearMixerState.Initialize(AnimationClip[], float, float). - Fixed formatting of
AnimancerEvent.AppendDetails. - Fixed
HybridAnimancerComponent.PlayandCrossFadeto not set theAnimancerState.NormalizedTimeto the default value (negative infinity). - Fixed the
AnimancerComponentInspector updatables list to not cause the horizontal scrollbar to appear. - Fixed
MouseDragto maintain a fixed distance to the target. - Fixed drag and drop into the
NamedAnimancerComponent.Animationsfield to work properly. - Fixed the
NamedAnimancerComponentInspector to not hide theAnimationsfields until Play Mode has been properly entered. - Fixed some minor pixel alignment issues in
TimeRuler. - Fixed Animancer Lite to correctly give a Pro-Only warning when using a custom End Event Time.
- Fixed the
TransitionInspector to allow events to be modified in Play Mode after they have been first used. - Fixed
TimeRulerto not show looping time indicators for super short animations if they would be so close together that they overlap. - Fixed
TimeRulerkeyboard controls for events. - Fixed
TimeRulerto properly show looped time indicators when the current time is out of bounds.