spine-ts WebGL
Please see the top-level README.md for more information.
The official Spine Runtimes for the web.
Please see the top-level README.md for more information.
spPhysicsConstraintTimeline
and spPhysicsConstraintResetTimeline
spPhysics
to be passed to spSkeleton_updateWorldTransform()
spSkeletonData_findPhysicsConstraint()
to query a physics constraint by namespSkeleton_findPhysicsConstraint()
to query a physics constraint by namespSkeleton_physicsTranslate()
to translate all physics constraints by some distances in the skeleton coordinate systemspSkeleton_physicsRotate()
to rotate all physics constraints by some distances in the skeleton coordinate systemspSkeleton::time
to keep track of time for physics simulationsspSkeleton_updateWorldTransform()
and the requirement to call spSkeleton_update()
to advance
pyhsics each frame.spInheritTimeline
spTrackEntry::alphaAttachmentThreshold
const
qualifiers where appropriatespTrackEntry_setMixDuration()
to set the mix duration in conjunction with a delayspTrackEntry_wasApplied()
to check if the entry has been appliedspBone_worldToParent()
to transform coordinates from world space to the parent space of a bonespBone_localToParent()
to transform coordinates from a bone's local space to its parent spaceicon
and visible
to spBoneData
path
and visible
to spSlotData
spTrackEntry::attachmentThreshold
to spTrackEntry::mixAttachmentThreshold
spTrackEntry::drawOrderThreshold
to spTrackEntry::mixDrawOrdertThreshold
spTransformMode
to spInherit
and all SP_TRANSFORMMODE_*
enums to SP_INHERIT_*
spMeshAttachment::edges
from int *
to unsigned short *
spSkeleton_update(delta)
before calling spSkeleton_updateWorldTransform()
if the frame time has advanced. This is needed to update physics accordinglyspSkeleton_updateWorldTransform()
takes an additional spPhysics
parameter. See the spPhysics
documentation for information on what the different enum values doSkeletonDrawable::update()
now takes an additional spPhysics physics
parameter that specifies how physics should be updatedspSkeletonDrawable_update()
now takes an additional spPhysics physics
parameter that specifies how physics should be updatedPhysicsConstraintXXXTimeline
and PhysicsConstraintResetTimeline
Physics
to be passed to Skeleton::updateWorldTransform()
SkeletonData::findPhysicsConstraint()
and SkeletonData::getPhysicsConstraints()
to query physics constraintsSkeleton::findPhysicsConstraint()
and Skeleton::getPhysicsConstraints()
to query physics constraintsSkeleton::physicsTranslate()
to translate all physics constraints by some distances in the skeleton coordinate systemSkeleton::physicsRotate()
to rotate all physics constraints by some distances in the skeleton coordinate systemSkeleton::time
to keep track of time for physics simulationsSkeleton::updateWorldTransform()
and the requirement to call Skeleton::update()
to advance
pyhsics each frame.InheritTimeline
TrackEntry::_alphaAttachmentThreshold
TrackEntry::setMixDuration()
to set the mix duration in conjunction with a delayTrackEntry::wasApplied()
to check if the entry has been appliedBone::worldToParent()
to transform coordinates from world space to the parent space of a boneBone::localToParent()
to transform coordinates from a bone's local space to its parent spaceicon
and visible
to BoneData
path
and visible
to SlotData
setToSetupPose()
to all contraint classesTrackEntry::attachmentThreshold
to TrackEntry::mixAttachmentThreshold
TrackEntry::drawOrderThreshold
to TrackEntry::mixDrawOrdertThreshold
TransformMode
to Inherit
and all TransformMode_*
enums to Inherit_*
Skeleton::update(delta)
before calling Skeleton::updateWorldTransform()
if the frame time has advanced. This is needed to update physics accordinglySkeleton::updateWorldTransform()
takes an additional Physics
parameter. See the Physics
documentation for information on what the different enum values doUpdatable
sub-classes like Bone
and constraints now take an additional Physics
parameter for their update()
methodsSkeletonDrawable::update()
now takes an additional Physics physics
parameter that specifies how physics should be updatedSkeletonDrawable::update()
now takes an additional Physics physics
parameter that specifies how physics should be updatedspine-ue4
to spine-ue
SpinePlugin
. You must update your project's Build.cs
file accordingly.skel
/.json
and .atlas
files in the same folder must NOT have a common prefix. E.g. skeleton.json
and skeleton.atlas
will not work. Make sure to rename at least one of the two files so there is no prefix collision, e.g. skeleton-data.json
and skeleton.atlas
.PhysicsTranslate()
, PhysicsRotate()
and ResetPhysicsConstraints()
(which will reset all physics constraints in the skeleton) to SpineSkeletonComponent
and SpineWidget
.TrackEntry.set_attachment_threshold
and TrackEntry.get_attachment_threshold
to TrackEntry.set_mix_attachment_threshold
and TrackEntry.get_mix_attachment_threshold
TrackEntry.set_draw_order_threshold
and TrackEntry.get_draw_order_threshold
to TrackEntry.set_mix_draw_order_threshold
and TrackEntry.get_mix_draw_order_threshold
SpineSkeleton.update_world_transform
takes an additional physics
parameter that specifies how physics should be updatedSpineBone.world_to_parent
to transform coordinates from world space to the parent space of a boneSpineBone.local_to_parent
to transform coordinates from a bone's local space to its parent spaceSpineBone.get_inherit
/SpineBone.set_inherit
SpinePhysicsConstraint
and SpinePhysicsConstraintData
SpineSkeleton.update()
to advance the physics timeSpineSkeleton.get_time
/SpineSkeleton.set_time
to access the physics timeSpineSkeleton.physics_translate()
to translate all physics constraints by some distances in the skeleton coordinate systemSpineSkeleton.physics_rotate()
to rotate all physics constraints by some distances in the skeleton coordinate systemSpineSkeleotnDataResource.set_reference_scale
/SpineSkeletonDataResource.get_reference_scale
to access the reference scale of the loaded skeleton dataTrackEntry.set_alpha_attachment_threshold
TrackEntry.set_mix_duration_and_delay()
to set the mix duration in conjunction with a delayTrackEntry::was_applied()
to check if the entry has been appliedAdditions
Breaking changes
TrackEntry
AttachmentThreshold
to MixAttachmentThreshold
, renamed DrawOrderThreshold
to MixDrawOrderThreshold
.Skeleton.UpdateWorldTransform()
to UpdateWorldTransform(Skeleton.Physics physics)
. The default replacement for skeleton.UpdateWorldTransform()
calls is skeleton.UpdateWorldTransform(Skeleton.Physics.Update)
. If you are certain that a subsequent call to skeleton.UpdateWorldTransform(Skeleton.Physics.Update)
follows in the same frame, you can pass Skeleton.Physics.Pose
as argument instead of Skeleton.Physics.Update
.Officially supported Unity versions are 2017.1-6000.0.
Additions
OnPostProcessVertices
callback parameter MeshGeneratorBuffers
now provides access to uv2Buffer
and uv3Buffer
properties of MeshGenerator
, automatically allocating buffers upon access if tintBlack
is disabled. This allows for passing own vertex data to a shader on second and third uv channels.Spine/SkeletonGraphic Grayscale
shader to provide a basic grayscale shader for SkeletonGraphic as well. SkeletonGraphic Material SkeletonGraphicDefaultGrayscale
uses this shader and can be assigned at SkeletonGraphic
components as usual.SkeletonGraphic
now supports automatic scaling based on its RectTransform
bounds. Automatic scaling can be enabled by setting the added Layout Scale Mode
Inspector property to either Width Controls Height
, Height Controls Width
, FitInParent
or EnvelopeParent
. It is set to None
by default to keep previous behaviour and avoid breaking existing projects. To modify the reference layout bounds, hit the additional Edit Layout Bounds
toggle button to switch into edit mode, adjust the bounds or hit Match RectTransform with Mesh
, and hit the button again when done adjusting. The skeleton will now be scaled accordingly to fit the reference layout bounds to the object's RectTransform
.Universal Render Pipeline/2D/Spine/Skeleton
.Universal Render Pipeline/Spine/Sprite
shader.Timeline
- Default Mix Duration
has been added, setting newly added SpineAnimationStateClip
clips accordingly, defaults to false. This Spine preferences parameter can be enabled to default to the previous behaviour before this update.Spine/Sprite
shaders. This feature can be enabled via the Tint Black
material parameter in the Inspector. Note: The URP Sprite shaders provided in the Spine URP Shaders extension UPM package require the latest version of the spine-unity runtime (package version 4.1.12, 2023-05-31 or newer) to display the added material parameters in the Inspector GUI.SkeletonGraphic.MeshScale
property to allow access to calculated mesh scale. MeshScale
is based on (1) Canvas pixels per unit, and (2) RectTransform
bounds when using Layout Scale Mode
other than None
at SkeletonGraphic
which scales the skeleton mesh to fit the parent RectTransform
bounds accordingly.updateSeparatorPartScale
property to SkeletonGraphic
to let render separator parts follow the scale (lossy scale) of the SkeletonGraphic
GameObject. Defaults to false
to maintain existing behaviour.EditorSkeletonPlayer
component to allow Editor playback of the initial animation set at SkeletonAnimation
or SkeletonGraphic
components. Add this component to your skeleton GameObject to enable the in-editor animation preview. Allows configurations for continuous playback when selected, deselected, and alternative single-frame preview by setting Fixed Track Time
to any value other than 0. Limitations: At skeletons with variable material count the Inspector preview may be too unresponsive. It is then recommended to disable the EditorSkeletonPlayer
component (at the top of the Inspector) to make it responsive again, then you can disable Play When Selected
and re-enable the component to preview playback only when deselected.RenderCombinedMesh
to render a combined mesh of multiple meshes or submeshes. This is required by OutlineOnly
shaders to render a combined outline when using SkeletonRenderSeparator
or multiple atlas pages which would normally lead to outlines around individual parts. To add a combined outline to your SkeletenRenderer:RenderCombinedMesh
component, provided in the Spine Examples/Scripts/Sample Components
directory.Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly
or Spine/Outline/OutlineOnly-ZWrite
.MeshRenderer
component.
If you are using SkeletonRenderSeparator
and need to enable and disable the SkeletonRenderSeparator
component at runtime, you can increase the RenderCombinedMesh
Reference Renderers
array by one and assign the SkeletonRenderer
itself at the last entry after the parts renderers. Disabled MeshRenderer
components will be skipped when combining the final mesh, so the combined mesh is automatically filled from the desired active renderers.EditorEvent
callback to allow editor scripts to react to animation events outside of play-mode. Register to the events via Spine.Unity.Playables.SpineAnimationStateMixerBehaviour.EditorEvent += YourCallback;
.Depth Write
property to shaders Universal Render Pipeline/Spine/Skeleton
and Universal Render Pipeline/Spine/Skeleton Lit
. Defaults to false to maintain existing behaviour.Animation Update
mode (called UpdateTiming
in code) In Late Update
for SkeletonAnimation
, SkeletonMecanim
and SkeletonGraphic
. This allows you to update the SkeletonMecanim
skeleton in the same frame that the Mecanim Animator updated its state, which happens between Update
and LateUpdate
.PhysicsConstraints
. You can disable applying translation or rotation at the Skeleton component Inspector under Advanced - Physics Inheritance
by setting Position
to (0,0)and Rotation
to 0, or by setting the properties physicsPositionInheritanceFactor
to Vector2.zero
and physicsRotationInheritanceFactor
to 0
at the skeleton component via code.Physics Constraints
example scene (located in Spine Examples/Other Examples
) together with celestial-circus
example skeleton assets. This scene demonstrates Transform movement automatically affecting physics constraints of a skeleton.Movement relative to
property. Leave this property at null
(the default) to use world-space Transform movement for physics.Editor Instantiation
- Physics Inheritance
- Default Position
and Default Rotation
to initialize skeletons physics settings with the desired Transform position and rotation inheritance factors when added to a scene via drag-and-drop.Spine/SkeletonGraphic Tint Black Additive
, Spine/SkeletonGraphic Tint Black Multiply
and Spine/SkeletonGraphic Tint Black Screen
.spine-unity/Materials
instead of requiring manual copies:
SkeletonGraphic-PMATexture
containing materials for premultiplied-alpha texture workflow (Straight Alpha Texture
disabled) and SkeletonGraphic-StaightAlphaTexture
containing materials for straight alpha texture workflow (Straight Alpha Texture
enabled). These directories contain a set of materials with CanvasGroup Compatible
disabled for usage with Advanced - PMA Vertex Color
enabled at the component. Each directory also provides a subdirectory CanvasGroupCompatible
with materials with CanvasGroup Compatible
enabled for usage with CanvasGroup
alpha (requiring Advanced - PMA Vertex Color
disabled at the component).Advanced
- Tint Black
, CanvasGroup Compatible
and PMA Vertex Color
. If unsure which settings are correct, hit the Detect
button next to each parameter, in top to bottom order, or the Detect Settings
to detect all three. Also added automatic material assignment via a Detect Material
button in the Advanced
section and a Detect
button next to the Material
property at the top of the component Inspector, as well as next to the Blend Mode Materials
section when using multiple canvas renderers with blend modes. The suitable material is selected based on these three settings, combined with texture settings (PMA or straight alpha texture settings). If you receive incorrect results, likely your texture settings are incorrectly setup for your PMA or Straight alpha texture export settings.SkeletonRenderTexture
example components now provide a shaderPasses
parameter to customize which passes are rendered to the RenderTexture
. It defaults to -1
for all passes to keep the existing behaviour. You might want to set it to 0
to only render the first pass e.g. to avoid issues when using a URP shader at the original skeleton.SkeletonGraphicRenderTexture
example component now also received a quadMaterial
property, defaulting to the newly added Material asset RenderQuadGraphicMaterial
which applies proper premultiplied-alpha blending of the render texture. The quadMaterial
member variable was moved from SkeletonRenderTexture
to the common base class SkeletonRenderTextureBase
.Width in Screen Space
. Enable it to keep the outline width constant in screen space instead of texture space. Requires more expensive computations, so enable only where necessary. Defaults to disabled
to maintain existing behaviour.SkeletonDataAsset.SetupRuntimeBlendModeMaterials
. See example scene Spine Examples/Other Examples/Instantiate from Script
for a usage example.Layout Scale Mode
scales the mesh smaller and towards the pivot (e.g. the feet) and thus out of the frame. Now you can keep the pivot in the center of the RectTransform
while offsetting only the mesh downwards, keeping the desired skeleton area (e.g. the face) centered while resizing. Moving the new larger green circle handle moves the mesh offset, while moving the blue pivot circle handle moves the pivot as usual.Universal Render Pipeline/Spine/Skeleton
shader now performs proper alpha-testing when Depth Write
is enabled, using the existing Shadow alpha cutoff
parameter.SkeletonRootMotion
components now provide a public Initialize()
method which is automatically called when calling skeletonAnimation.Initialize(true)
to update the necessary skeleton references. If a different root bone shall be used, be sure to set skeletonRootMotion.rootMotionBoneName
before calling skeletonAnimation.Initialize(true)
.Mix Mode
Match
. When selected, Spine animation weights are calculated to best match the provided Mecanim clip weights. This mix mode is recommended on any layer using blend tree nodes.ZWrite
variant of outline shader Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly ZWrite
. Suitable for e.g. depth of field (DoF) effect where writing to the depth buffer is required. Note that for DoF effect, Render Queue
needs to be set to Alpha Test
.SetScaledPivotOffset
as public method outside of the editor to support programatically moving mesh offsets at runtime based on mesh bounds.Scene Preview
option to preview an Animation Clip for e.g. easier event placement. When enabled, the Animation Clip selected in the Animation window is previewed in the Scene and Game views. Lock the SkeletonMecanim
Inspector window, open the Animation window and select the Animation Clip. Then in the Animation window scrub through the timeline to see the current animation frame previewed.Universal Render Pipeline/Spine/Skeleton Lit
shader now supports Adaptive Probe Volumes (APV) introduced in Unity 6. The shader also provides a new material property APV per Pixel
to either calculate APV lighting contribution per pixel (the default) or per vertex.Universal Render Pipeline/Spine/Sprite
shader now also supports Adaptive Probe Volumes (APV) introduced in Unity 6. APV lighting contribution is automatically calculated per pixel.Fill
. Enable it to also fill the opaque area inside the outline with the outline color. Prevents a semi-transparent gap between outline and skeleton. Defaults to disabled
to maintain existing behaviour.RenderExistingMeshGraphic
(similar to RenderExistingMesh
) to render a SkeletonGraphic
mesh again with different materials. This might be required by e.g. URP and SkeletonGraphic outline shaders skipping additional render passes. To add a second outline variant of your SkeletonGraphic:RenderExistingMeshGraphic
component.RenderExistingMeshGraphic
component Inspector at Reference Skeleton Graphic
assign the original SkeletonGraphic
object.Replacement Material
assign e.g. the included SkeletonGraphicDefaultOutline material to replace all materials with this material. Alternatively, if Multiple CanvasRenderers
is enabled at the reference SkeletonGraphic, you can add entries to the Replacement Materials
list and at each entry assign the original SkeletonGraphic material (e.g. SkeletonGraphicDefault) to be replaced and the respective Replacement Material
(e.g. SkeletonGraphicDefaultOutline).Breaking changes
SpineShaderWithOutlineGUI
outline related methods from private
to protected virtual
to allow for custom shader GUI subclasses to switch to different outline shaders.BoneFollower
and BoneFollowerGraphic
methods LateUpdate
and Initialize
to virtual
to allow easier overriding for e.g. positional offset in custom subclasses.MeshGenerator
received a new optimization option to avoid rendering fully transparent attachments at slot alpha 0 by default. Comment out #define SLOT_ALPHA_DISABLES_ATTACHMENT
in MeshGenerator.cs
to revert to previous behaviour. You may only need this option disabled when utilizing a custom shader which uses vertex color alpha for purposes other than transparency.ApplyTranslationToPhysics
and ApplyRotationToPhysics
were changed to Vector2 PhysicsPositionInheritanceFactor
and float PhysicsRotationInheritanceFactor
to allow the Transform movement the be scaled by a factor before being applied to the skeleton. You can set the properties to Vector2.zero
and 0
respectively to disable applying any Transform movement at all. The Advanced
Inspector section Physics Constraints
was renamed to Physics Inheritance
, the properties in the section are now called Position
and Rotation
.CanvasGroupCompatible
parameters, the default SkeletonGraphic materials all have CanvasGroup Compatible
disabled. Please assign the respective material from the CanvasGroupCompatible
material subdirectory if you want CanvasGroup Compatible
enabled at your SkeletonGraphic.SkeletonGraphic.MeshGenerator.settings.canvasGroupTintBlack
was changed to canvasGroupCompatible
to help with auto-detecting correct Vertex Data and Material settings. Set the parameter to true if the SkeletonGraphic component is located below a CanvasGroup
component. The parameter value is automatically migrated from canvasGroupTintBlack
.SpineSkin()
now allows to include <None>
in the list of parameters. Previously the includeNone=true
parameter of the SpineSkin()
attribute defaulted to true
but was ignored. Now it defaults to false
and has an effect on the list. Only the Inspector GUI is affected by this behaviour change.SkeletonGraphicRenderTexture
example component: protected RawImage quadRawImage
was changed to protected SkeletonSubmeshGraphic quadMaskableGraphic
for a bugfix. This is only relevant for subclasses of SkeletonGraphicRenderTexture
or when querying the RawImage
component via e.g. skeletonGraphicRenderTexture.quad.GetComponent<RawImage>()
.PMA vertex colors
enabled, additive slots add a too dark (too transparent) color value. If you want the old incorrect behaviour (darker additive slots) or are not using Linear but Gamma color space, you can comment-out the define LINEAR_COLOR_SPACE_FIX_ADDITIVE_ALPHA
in MeshGenerator.cs
to deactivate the fix or just to skip unnecessary instructions.#define USE_APPLIED_PARENT_SCALE
in SkeletonRootMotionBase.cs.UpdateLocal
, UpdateWorld
or UpdateComplete
yourself and relied on a certain callback order. One solution is to then resubscribe your own callback events accordingly by calling
.UpdateLocal -= Callback; .UpdateLocal += Callback;
.Changes of default values
Deprecated
Restructuring (Non-Breaking)
Skeleton.X
or Skeleton.Y
, you can apply external game object movement to skeleton physics as follows:
Add a Vector2 lastPosition;
member variable to your class interacting with the skeleton. Then call e.g. the following code each frame:Vector2 currentPosition = <current world position>;
Vector2 externalPositionDelta = currentPosition - lastPosition;
skeleton.PhysicsTranslate(externalPositionDelta.x, externalPositionDelta.y);
lastPosition = currentPosition;
PhysicsConstraintXXXTimeline
and PhysicsConstraintResetTimeline
Physics
to be passed to Skeleton#updateWorldTransform()
SkeletonData#findPhysicsConstraint()
and SkeletonData#getPhysicsConstraints()
to query physics constraintsSkeleton#findPhysicsConstraint()
and Skeleton#getPhysicsConstraints()
to query physics constraintsSkeleton#physicsTranslate()
to translate all physics constraints by some distances in the skeleton coordinate systemSkeleton#physicsRotate()
to rotate all physics constraints by some distances in the skeleton coordinate systemSkeleton#time
and respective setters/getters to keep track of time for physics simulationsSkeleton#updateWorldTransform()
and the requirement to call Skeleton#update()
to advance
pyhsics each frame.InheritTimeline
TrackEntry#alphaAttachmentThreshold
TrackEntry#setMixDuration()
to set the mix duration in conjunction with a delayTrackEntry#wasApplied()
to check if the entry has been appliedBone#worldToParent()
to transform coordinates from world space to the parent space of a boneBone#localToParent()
to transform coordinates from a bone's local space to its parent spaceicon
and visible
to BoneData
path
and visible
to SlotData
setToSetupPose()
to all contraint classesTrackEntry#attachmentThreshold
to TrackEntry#mixAttachmentThreshold
along with respective getters/settesrTrackEntry::drawOrderThreshold
to TrackEntry#mixDrawOrdertThreshold
along with respective getters/settesrTransformMode
to Inherit
and all TransformMode_*
enums to Inherit_*
Skeleton#update(delta)
before calling Skeleton#updateWorldTransform()
if the frame time has advanced. This is needed to update physics accordinglySkeleton#updateWorldTransform()
takes an additional Physics
parameter. See the Physics
documentation for information on what the different enum values doUpdatable
sub-classes like Bone
and constraints now take an additional Physics
parameter for their update()
methodsPhysicsConstraintXXXTimeline
and PhysicsConstraintResetTimeline
Physics
to be passed to Skeleton#updateWorldTransform()
SkeletonData#findPhysicsConstraint()
and SkeletonData#getPhysicsConstraints()
to query physics constraintsSkeleton#findPhysicsConstraint()
and Skeleton#getPhysicsConstraints()
to query physics constraintsSkeleton#physicsTranslate()
to translate all physics constraints by some distances in the skeleton coordinate systemSkeleton#physicsRotate()
to rotate all physics constraints by some distances in the skeleton coordinate systemSkeleton#time
and respective setters/getters to keep track of time for physics simulationsSkeleton#updateWorldTransform()
and the requirement to call Skeleton#update()
to advance
pyhsics each frame.InheritTimeline
TrackEntry#alphaAttachmentThreshold
TrackEntry#setMixDuration()
to set the mix duration in conjunction with a delayTrackEntry#wasApplied()
to check if the entry has been appliedBone#worldToParent()
to transform coordinates from world space to the parent space of a boneBone#localToParent()
to transform coordinates from a bone's local space to its parent spaceicon
and visible
to BoneData
path
and visible
to SlotData
setToSetupPose()
to all contraint classesTrackEntry#attachmentThreshold
to TrackEntry#mixAttachmentThreshold
along with respective getters/settesrTrackEntry::drawOrderThreshold
to TrackEntry#mixDrawOrdertThreshold
along with respective getters/settesrTransformMode
to Inherit
and all TransformMode_*
enums to Inherit_*
Skeleton#update(delta)
before calling Skeleton#updateWorldTransform()
if the frame time has advanced. This is needed to update physics accordinglySkeleton#updateWorldTransform()
takes an additional Physics
parameter. See the Physics
documentation for information on what the different enum values doUpdatable
sub-classes like Bone
and constraints now take an additional Physics
parameter for their update()
methodsscale
field to configuration which defines the scale to load the skeleton atupdateWorldTransform
field to configuration which expects a function that updates the skeleton. Defaults to player.skeleton.updateWorldTransform(spine.Physics.update)skeleton
to SpinePlayerConfig
to specify the URL of the skeleton .json or .skel file. Deprecated jsonURL
and binaryURL
. The old fields can still be used, but will be removed in Spine 4.3atlas
to SpinePlayerConfig
to specify the URL of the .atlas file. Deprecated atlasURL
. The old field can still be used, but will be removed in Spine 4.3.shortestRotation
in animation state. See https://github.com/esotericsoftware/spine-runtimes/issues/2027.SPINE_SANITIZE
which will enable sanitizers on macOS and Linux.SPINE_MAJOR_VERSION
, SPINE_MINOR_VERSION
, and SPINE_VERSION_STRING
. Parsing skeleton .JSON and .skel files will report an error if the skeleton version does not match the runtime version.spRegionAttachment
and spMeshAttachment
now contain a spTextureRegion*
instead of encoding region fields directly.sp_AttachmentLoader_newRegionAttachment()
and spAttachmentLoader_newMeshAttachment()
now take an additional Sequence*
parameter.spMeshAttachment_updateUVs()
was renamed to spMeshAttachment_updateRegion()
.spRegionAttachment_updateOffset()
was renamed to spRegionAttachment_updateRegion()
, spRegionAttachment_setUVs()
was merged into spRegionAttachment_updateRegion()
.spSlot_getAttachmentTime()
and spSlot_setAttachmentTime()
have been removed.spVertexAttachment->deformAttachment
was renamed to spVertexAttachment->timelineAttachment
.spSkeleton_update()
has been removed.spSkeleton->time
has been removed.spVertexEffect
has been removed.shortestRotation
in animation state. See https://github.com/esotericsoftware/spine-runtimes/issues/2027.SPINE_SANITIZE
which will enable sanitizers on macOS and Linux.SPINE_MAJOR_VERSION
, SPINE_MINOR_VERSION
, and SPINE_VERSION_STRING
. Parsing skeleton .JSON and .skel files will report an error if the skeleton version does not match the runtime version.SkeletonBounds::getBoundingBox()
, SkeletonBounds::getPolygons()
, and SkeletonBounds::getBoundingBoxes()
.RegionAttachment
and MeshAttachment
no longer implement HasRendererObject
.RegionAttachment
and MeshAttachment
now contain a TextureRegion*
instead of encoding region fields directly.AttachmentLoader::newRegionAttachment()
and AttachmentLoader::newMeshAttachment()
now take an additional Sequence*
parameter.MeshAttachment::updateUVs()
was renamed to MeshAttachment::updateRegion()
.RegionAttachment::updateOffset()
was renamed to RegionAttachment::updateRegion()
, RegionAttachment::setUVs()
was merged into updateRegion()
.Slot::getAttachmentTime()
and Slot::setAttachmentTime()
have been removed.VertexAttachment::getDeformAttachment()
was renamed to VertexAttachment::getTimelineAttachment()
.Skeleton::update()
has been removed.Skeleton::getTime()
has been removed.VertexEffect
has been removed.SkeletonRenderer
to SkeletonRendererCocos2dX
to avoid name clash with spine-cpp class.Additions
shortestRotation
in animation state. See https://github.com/esotericsoftware/spine-runtimes/issues/2027.RegionAttachment
and MeshAttachment
now provide a Region
property. Use this property instead of the removed RendererObject
property (see section Breaking Changes below).Breaking changes
RendererObject
property from RegionAttachment
and MeshAttachment
. Use attachment.Region
property instead. Removed removed IHasRendererObject
interface. Use IHasTextureRegion
instead.RegionAttachment.UpdateOffset
and MeshAttachment.UpdateUVs
with Attachment.UpdateRegion
. The caller must ensure that the attachment's region is not null
.AttachmentRegionExtensions
methods Attachment.SetRegion
, MeshAttachment.SetRegion
and RegionAttachment.SetRegion(region, update)
. Use attachment.Region = region; if (update) attachment.UpdateRegion()
instead.AttachmentLoader.NewRegionAttachment()
and AttachmentLoader.NewMeshAttachment()
take an additional Sequence
parameter.VertexAttachment.DeformAttachment
property has been replaced with VertexAttachment.TimelineAttachment
.RegionAttachment.ComputeWorldVertices()
takes a Slot
instead of a Bone
as the first argument.Skeleton.Update(float deltaTime)
method.Slot.AttachmentTime
property.AtlasRegion.GetSpineAtlasRect()
parameter includeRotate
(with default value true
). Most likely this method was never used with includeRotate=false
in user code so no changes are required.AtlasRegion.PackedWidth
and AtlasRegion.PackedHeight
are swapped compared to 4.0 when packing rotation is equal to 90 degrees. Most likely this property was never accessed in user code so no changes are required.Officially supported Unity versions are 2017.1-2023.1.
Additions
SpineAtlasAsset.CreateRuntimeInstance
methods now provide an optional newCustomTextureLoader
parameter (defaults to null
) which can be set to e.g. (a) => new YourCustomTextureLoader(a)
to use your own TextureLoader
subclass instead of MaterialsTextureLoader
.SkeletonAnimation
, SkeletonMecanim
and SkeletonGraphic
now provide an Inspector parameter Advanced
- Animation Update
with modes In Update
(previous behaviour, the default), In FixedUpdate
and Manual Update
. This allows to update animation in FixedUpdate
when using the SkeletonRootMotion
component (which is the recommended combination now, issuing a warning otherwise). The reason is that when root motion leads to a collision with a physics collider, it can introduce jittery excess movement when updating animation in Update
due to more Update
calls following a single FixedUpdate
call.SkeletonRootMotion
properties PreviousRigidbodyRootMotion
and AdditionalRigidbody2DMovement
. Setting or querying these movement vectors can be necessary when multiple scripts call Rigidbody2D.MovePosition
on the same object where the last call overwrites the effect of preceding ones.BoneFollower
and BoneFollowerGraphic
now provide an additional Follow Parent World Scale
parameter to allow following simple scale of parent bones (rotated/skewed scale can't be supported).Advanced - Fix Prefab Override MeshFilter
property for SkeletonRenderer
(and subclassesSkeletonAnimation
and SkeletonMecanim
), now providing an additional option to use a global value which can be set in Edit - Preferences - Spine
.Spine AnimationState Clip
Inspector parameter Custom Duration
changed and inverted to Default Mix Duration
for more clarity. Shortened all Timeline add track menu entries from: Spine.Unity.Playables - <track type>
to Spine - <track type>
, Spine Animation State Track
to SkeletonAnimation Track
, Spine AnimationState Graphic Track
to SkeletonGraphic Track
, and Spine Skeleton Flip Track
to Skeleton Flip Track
.SkeletonRenderTexture
to render a SkeletonRenderer
to a RenderTexture
, mainly for proper transparency. Added an example scene named RenderTexture FadeOut Transparency
that demonstrates usage for a fadeout transparency effect.SkeletonRenderTextureFadeout
which takes over transparency fadeout when enabled. You can use this component as-is, attach it in disabled state and enable it to start a fadeout effect.Alpha
parameter for setting a custom constant mix alpha value other than 1.0, just as TrackEntry.Alpha
. Defaults to 1.0.GetRemappedClone
copying from Sprite
now provides additional pmaCloneTextureFormat
and pmaCloneMipmaps
parameters to explicitly specify the texture format of a newly created PMA texture.Animation Name
, Bone Name
, Slot
and similar) now display the name in red when the respective animation/bone/etc no longer exists at the skeleton data. This may be helpful when such items have been renamed or deleted.UnscaledTime
property at SkeletonAnimation
as well, behaving like SkeletonGraphic.UnscaledTime
. If enabled, AnimationState uses unscaled game time (Time.unscaledDeltaTime
), running animations independent of e.g. game pause (Time.timeScale
).SkeletonAnimation
, SkeletonMecanim
and SkeletonGraphic
now provide an additional OnAnimationRebuild
callback delegate which is issued after both the skeleton and the animation state have been initialized.SkeletonAnimation Track
and SkeletonGraphic Track
now provide an Unscaled Time
property. Whenever starting a new animation clip of this track, SkeletonAnimation.UnscaledTime
or SkeletonGraphic.UnscaledTime
will be set to this value. This allows you to play back Timeline clips either in normal game time or unscaled game time. Note that PlayableDirector.UpdateMethod
is ignored and replaced by this property, which allows more fine-granular control per Timeline track.SkeletonRootMotion
callback delegates ProcessRootMotionOverride
and PhysicsUpdateRootMotionOverride
to customize how root motion is applied. The new property disableOnOverride
determines whether the callback will be issued in addition or instead of normally applying root motion. Added property rootMotionScaleRotation
to allow scaling rotational root-motion to match e.g. a 90 degree rotation to a custom target angle.Advanced - Opaque Alpha
which can be used to exclude problematic semi-transparent areas, which may receive an undesired large outline color overlay otherwise.Prefabs
- Optimize Preview Meshes
. When enabled, Spine prefab preview meshes will be removed in a pre-build step to reduce build size. This increases build time as all prefabs in the project will be processed. Defaults to false to not slow down builds substantially every time.Reload SkeletonData after Play
. When enabled, the shared SkeletonData
of all skeletons in the active scene is reloaded (from the .json
or .skel.bytes
file) after exiting play-mode. You can disable this setting to avoid the reloading delay if you can ensure that there are no (accidental) modifications to the shared SkeletonData
during play-mode (otherwise it would carry over its effect into subsequent plays). Defaults to true
(the safe setting), which maintains existing behaviour.SkeletonAnimationMulti
sample component methods SetActiveSkeleton(int index)
and getter property SkeletonAnimations
to more easily apply changes at all SkeletonAnimation instances instead of only the active one.sRGB (Color Texture)
disabled by default, the preset template PMATexturePreset.preset
has been adjusted accordingly. As PMA textures are only allowed with Gamma color space, sRGB (Color Texture)
shall be disabled to prevent border artifacts when mipmaps are enabled. In Gamma color space having this setting disabled has no drawbacks, only benefits.SkeletonRenderTexture
and SkeletonGraphicRenderTexture
components now support automatic down-scaling when required size on screen exceeds Max Render Texture Size
.Spine/SkeletonGraphic Fill
shader to provide functionality of Spine/Skeleton Fill
shader for SkeletonGraphic
.Universal Render Pipeline/Spine/Sprite
and Universal Render Pipeline/Spine/Skeleton Lit
) now support Forward+
rendering path as introduced by Unity 2022.2 and URP version 14.SkeletonGraphic
now supports automatic scaling based on its RectTransform
bounds. Automatic scaling can be enabled by setting the added Layout Scale Mode
Inspector property to either Width Controls Height
, Height Controls Width
, FitInParent
or EnvelopeParent
. It is set to None
by default to keep previous behaviour and avoid breaking existing projects. To modify the reference layout bounds, hit the additional Edit Layout Bounds
toggle button to switch into edit mode, adjust the bounds or hit Match RectTransform with Mesh
, and hit the button again when done adjusting. The skeleton will now be scaled accordingly to fit the reference layout bounds to the object's RectTransform
.Universal Render Pipeline/2D/Spine/Skeleton
.Universal Render Pipeline/Spine/Sprite
shader.Timeline
- Default Mix Duration
has been added, setting newly added SpineAnimationStateClip
clips accordingly, defaults to false. This Spine preferences parameter can be enabled to default to the previous behaviour before this update.Spine/Sprite
shaders. This feature can be enabled via the Tint Black
material parameter in the Inspector. Note: The URP Sprite shaders provided in the Spine URP Shaders extension UPM package require the latest version of the spine-unity runtime (package version 4.1.12, 2023-05-31 or newer) to display the added material parameters in the Inspector GUI.SkeletonGraphic.MeshScale
property to allow access to calculated mesh scale. MeshScale
is based on (1) Canvas pixels per unit, and (2) RectTransform
bounds when using Layout Scale Mode
other than None
at SkeletonGraphic
which scales the skeleton mesh to fit the parent RectTransform
bounds accordingly.updateSeparatorPartScale
property to SkeletonGraphic
to let render separator parts follow the scale (lossy scale) of the SkeletonGraphic
GameObject. Defaults to false
to maintain existing behaviour.EditorSkeletonPlayer
component to allow Editor playback of the initial animation set at SkeletonAnimation
or SkeletonGraphic
components. Add this component to your skeleton GameObject to enable the in-editor animation preview. Allows configurations for continuous playback when selected, deselected, and alternative single-frame preview by setting Fixed Track Time
to any value other than 0. Limitations: At skeletons with variable material count the Inspector preview may be too unresponsive. It is then recommended to disable the EditorSkeletonPlayer
component (at the top of the Inspector) to make it responsive again, then you can disable Play When Selected
and re-enable the component to preview playback only when deselected.RenderCombinedMesh
to render a combined mesh of multiple meshes or submeshes. This is required by OutlineOnly
shaders to render a combined outline when using SkeletonRenderSeparator
or multiple atlas pages which would normally lead to outlines around individual parts. To add a combined outline to your SkeletenRenderer:RenderCombinedMesh
component, provided in the Spine Examples/Scripts/Sample Components
directory.Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly
or Spine/Outline/OutlineOnly-ZWrite
.MeshRenderer
component.
If you are using SkeletonRenderSeparator
and need to enable and disable the SkeletonRenderSeparator
component at runtime, you can increase the RenderCombinedMesh
Reference Renderers
array by one and assign the SkeletonRenderer
itself at the last entry after the parts renderers. Disabled MeshRenderer
components will be skipped when combining the final mesh, so the combined mesh is automatically filled from the desired active renderers.EditorEvent
callback to allow editor scripts to react to animation events outside of play-mode. Register to the events via Spine.Unity.Playables.SpineAnimationStateMixerBehaviour.EditorEvent += YourCallback;
.Depth Write
property to shaders Universal Render Pipeline/Spine/Skeleton
and Universal Render Pipeline/Spine/Skeleton Lit
. Defaults to false to maintain existing behaviour.Animation Update
mode (called UpdateTiming
in code) In Late Update
for SkeletonAnimation
, SkeletonMecanim
and SkeletonGraphic
. This allows you to update the SkeletonMecanim
skeleton in the same frame that the Mecanim Animator updated its state, which happens between Update
and LateUpdate
.Breaking changes
SkeletonGraphic.unscaledTime
parameter protected, use the new property UnscaledTime
instead.SkeletonGraphic
OnRebuild
callback delegate is now issued after the skeleton has been initialized, before the AnimationState
component is initialized. This makes behaviour consistent with SkeletonAnimation
and SkeletonMecanim
component behaviour. Use the new callback OnAnimationRebuild
if you want to receive a callback after the SkeletonGraphic
AnimationState
has been initialized.Skeleton Prefab Mesh "name"
to Skeleton Prefab Mesh [name]
to avoid issues with quotes in mesh asset names (see this issue). Likely this change poses no problems at all, however if you are parsing the prefab's mesh name for whatever reason, be sure to adjust the pattern accordingly.Changes of default values
Deprecated
RETURN_UNLIT_IF_ADDITIVE_SLOT
in spine-unity/Shaders/Sprite/CGIncludes/ShaderShared.cginc
has been deprecated and will be removed in spine-unity 4.2. Use RETURN_UNLIT_IF_ADDITIVE_SLOT_TINT instead.Restructuring (Non-Breaking)
Spine Universal RP Shaders
package in the Package Manager window, expand Samples
at the bottom and hit Import
next to Examples
. This follows the standard samples guideline and prevents warning messages about unexpectedly altered immutable assets.shortestRotation
in animation state. See https://github.com/esotericsoftware/spine-runtimes/issues/2027.AttachmentLoader#newRegionAttachment()
and AttachmentLoader#newMeshAttachment()
take an additional Sequence
parameter.Slot#setAttachmentTime()
and Slot#getAttachmentTime()
have been removed.VertexAttachment#setDeformAttachment()
and VertexAttachment#getDeformAttachment()
have been replaced with VertexAttachment#setTimelineAttachment()
and VertexAttachment#getTimelineAttachment()
.RegionAttachment#updateOffset()
has been renamed to RegionAttachment#updateRegion()
. The caller must ensure that the attachment's region is not null
.RegionAttachment#computeWorldVertices()
takes a Slot
instead of a Bone
as the first argument.VertexEffect
has been removed.spine-libgdx
, spine-libgdx-tests
, and spine-skeletonviewer
are now fully Gradle-ified.spine-skeletonviewer
now supports quickly loading skeletons by dragging and dropping .json
or .skel
skeleton files onto the window.Promise
based AssetManager.loadAll()
. Allows synchronous waiting via await assetManager.loadAll()
, simplifying loader logic in applications.shortestRotation
in animation state. See https://github.com/esotericsoftware/spine-runtimes/issues/2027.AttachmentLoader#newRegionAttachment()
and AttachmentLoader#newMeshAttachment()
take an additional Sequence
parameter.Slot#attachmentTime
and has been removed.VertexAttachment#deformAttachment
has been replaced with VertexAttachment#timelineAttachment
.RegionAttachment#updateOffset()
has been renamed to RegionAttachment#updateRegion()
. The caller must ensure that the attachment's region is not null
.RegionAttachment#computeWorldVertices()
takes a Slot
instead of a Bone
as the first argument.PlayerEditor
.VertexEffect
has been removed.RegionAttachment.rendererObject
.TextureRegion.renderObject
to TextureRegion.texture
.PolygonBatcher
can now disable culling automatically if the static variable PolygonBatcher.disableCulling
is set to true.SpineCanvas
, a simpler way to render a scene via spine-webgl. See spine-ts/spine-webgl/examples/barebones.html
and spine-ts/spine-webgl/examples/mix-and-match.html
.SpineCanavs.dispose()
to halt the updating and rendering of the canvas.SkeletonMesh
takes an optional SkeletonMeshMaterialCustomizer
, allowing modification of materials used by SkeletonMesh
.SkeletonMeshMaterial.alphaTest
, when > 0, alpha testing will be performed and fragments will not be written to the depth buffer, if depth writes are enabled.SpinePlayer.dispose()
to explicitely dispose of all resources the player holds on to.NOTE: Spine 4.0 will be the last release supporting spine-as3. Starting from Spine 4.1, spine-as3 will no longer be supported or maintained.
README.md
files for instructions.AnimationState.clearNext()
which removes the given TrackEntry
and all entries after it.AtlasRegion.names
and AtlasRegion.values
.TrackEntry.reverse
.NOTE: Spine 4.0 will be the last release supporting spine-starling. Starting from Spine 4.1, spine-starling will no longer be supported or maintained.
README.md
files for instructions.SPINE_SHORT_NAMES
define and C++ constructors.spAnimationState_clearNext()
which removes the given spTrackEntry
and all entries after it.spAtlasRegion.keyValues
.spTrackEntry.reverse
.NOTE: Spine 4.0 will be the last release supporting spine-cocos2d-objc. Starting from Spine 4.1, spine-cocos2d-objc will no longer be supported or maintained.
ikDemo()
in main.cpp
. to illustrate how to drive a bone and IK chain through mouse movement.x
and y
on SkeletonData
through getters and setters.AnimationState.clearNext()
which removes the given TrackEntry
and all entries after it.AtlasRegion.names
and AtlasRegion.values
.TrackEntry.reverse
.IKExample
scene to illustrate how to drive a bone and IK chain through mouse movement.SkeletonAnimation::setPreUpdateWorldTransformsListener()
and SkeletonAnimation::setPostUpdateWorldTransformsListener()
. This allows users to modify bone transforms and other skeleton properties before and after the world transforms of all bones are calculated. See the IKExample
for a usage example.ikDemo()
in main.cpp
. to illustrate how to drive a bone and IK chain through mouse movement.SpineWidget
now supports the full widget transform, including rendering scale/shear.SkeletonRendererComponent
are now blueprint read and writeable. This allows setting dynamic material instances at runtime.InitialSkin
property to USpineWidget
. This allows previewing different skins in the UMG Designer. Initial skins can still be overridden via blueprint events such as On Initialized
.SpineWidget
no longer has the Scale
property. Instead the size x/y properties can be used.SetSlotColor
on USpineSkeletonComponent
to easily set the color of a slot via blueprints.SkeletonDataAsset
will now be applied to instances of USpineSkeletonComponent
..json
files that are actually encoding Spine skeletons will be loaded. Other .json
files will be left to other importers.AnimationState.clearNext()
which removes the given TrackEntry
and all entries after it.AtlasRegion.names
and AtlasRegion.values
.TrackEntry.Reverse
.SkeletonData
and Skeleton
methods: FindBoneIndex
, FindSlotIndex
. Bones and slots have an Index
field that should be used instead. Be sure to check for e.g. bone == null
accordingly before accessing bone.Index
.Breaking changes
Spine.Unity.AttachmentTools.SkinUtilities
Skin extension methods. These have become obsoleted and error-prone since the introduction of the new Skin API in 3.8. To fix any compile errors, replace any usage of Skin
extension methods with their counterparts, e.g. replace occurrances of skin.AddAttachments()
with skin.AddSkin()
. Please see the example scene Mix and Match Skins
on how to use the new Skin API to combine skins, or the updated old example scenes Mix and Match
and Mix and Match Equip
on how you can update an existing project using the old workflow. If you are using skeletonAnimation.Skeleton.UnshareSkin()
in your code, you can replace it with Skin customSkin = new Skin("custom skin"); customSkin.AddSkin(skeletonAnimation.Skeleton.Skin);
.Skin.GetAttachments()
has been replaced by Skin.Attachments
, returning an ICollection<SkinEntry>
. This makes access more consistent and intuitive. To fix any compile errors, replace any occurrances of Skin.GetAttachments()
by Skin.Attachments
.Spine.Unity.AttachmentTools.AttachmentCloneExtensions
extension methods Attachment.GetCopy()
and Attachment.GetLinkedMesh()
. To fix any compile errors, replace any occurrances with Attachment.Copy()
and Attachment.NewLinkedMesh()
.Spine.Unity.AttachmentTools.AttachmentRegionExtensions
extension methods Attachment.GetRegion()
. Use Attachment.RendererObject as AtlasRegion
instead.Removed redundant Spine.SkeletonExtensions
extension methods:
Replace:
Skeleton.SetPropertyToSetupPose()
Skeleton.SetDrawOrderToSetupPose()
Skeleton.SetSlotAttachmentsToSetupPose()
Skeleton.SetSlotAttachmentToSetupPose()
with Skeleton.SetSlotsToSetupPose()
.
Replace:
Slot.SetColorToSetupPose()
Slot.SetAttachmentToSetupPose()
with Slot.SetToSetupPose()
.
Also removed less commonly used extension methods:
TrackEntry.AllowImmediateQueue()
, Animation.SetKeyedItemsToSetupPose()
and Attachment.IsRenderable()
.
SkeletonGraphic
now no longer uses a RawImage
component at each submesh renderer GameObject when allowMultipleCanvasRenderers
is true. Instead, a new custom component SkeletonSubmeshGraphic
is used which is more resource friendly. Replacement of these components will be performed automatically through editor scripting, saving scenes or prefabs will persist the upgrade.
Linear
color space in Unity but incorrect in Spine, you might want to adjust the tweaked colors. Slot colors displayed in Unity should now match colors displayed in the Spine Editor when configured to display as Linear
color space in the Spine Editor Settings.Light Affects Additive
which defaults to false
, as it is the more intuitive default value. You can enable the old behaviour by setting this parameter to true
.Sprite
shaders in Premultiply Alpha
blend mode (including URP and LWRP packages). Previously vertex color alpha was premultiplied again, even though Premultiply Alpha
blend mode assumes PMA texture and PMA vertex color input. Slot-alpha blending will thus be correctly lighter after upgrading to 4.0. If you have compensated this problem by disabling Advanced - PMA Vertex Colors
you can now re-enable this parameter, also allowing for rendering Additive slots in a single pass.Outline
shaders outline thickness when Advanced - Sample 8 Neighbourhood
is disabled (thus using 4 Neighbourhood
). Previously weighting was incorrectly thick (4x as thick) compared to 8 neighbourhood, now it is more consistent. This might require adjustment of all your outline materials where Sample 8 Neighbourhood
is disabled to restore the previous outline thickness, by adjusting the Outline Threshold
parameter through adding a /4
to make the threshold 4 times smaller.BoneFollower
property followLocalScale
has intermediately been renamed to followScale
but was renamed back to followLocalScale
. Serialized values (scenes and prefabs) will automatically be upgraded, only code accessing followScale
needs to be adapted.Don't Pause with Director
provided that can be enabled for each Timeline clip.Spine AnimationState Clips
ignoring empty space on the Timeline after a clip's end. Timeline clips now also offer Don't End with Clip
and Clip End Mix Out Duration
parameters if you prefer the old behaviour of previous versions. By default when empty space follows the clip on the timeline, the empty animation is set on the track with a MixDuration of Clip End Mix Out Duration
. Set Don't End with Clip
to true
to continue playing the clip's animation instead and mimic the old 3.8 behaviour. If you prefer pausing the animation instead of mixing out to the empty animation, set Clip End Mix Out Duration
to a value less than 0, then the animation is paused instead.Additions and Improvements
disabled
(previous behaviour).
Applies only when 3+ submeshes are used (2+ materials with alternating order, e.g. "A B A").
If true
, MaterialPropertyBlocks are assigned at each material to prevent aggressive batching of submeshes
by e.g. the LWRP renderer, leading to incorrect draw order (e.g. "A1 B A2" changed to "A1A2 B").
You can leave this parameter disabled when everything is drawn correctly to save the additional performance cost.Speed Multiplier
, a start time offset parameter Clip In
, support for blending successive animations by overlapping tracks. An additional Use Blend Duration
parameter (defaults to true) allows for automatic synchronisation of MixDuration with the current overlap blend duration. An additional Spine preferences parameter Use Blend Duration
has been added which can be disabled to default to the previous behaviour before this update.SpriteMask and RectMask2D
example scene added for demonstration of mask setup and interaction.Real physics hinge chains
for both 2D and 3D physics. The SkeletonUtilityBone Inspector provides an interface to create 2D and 3D hinge chains. Previously created chains have only been respecting gravity, but not momentum of the skeleton or parent bones. The new physics rig created when pressing Create 3D Hinge Chain
and Create 2D Hinge Chain
creates a more complex setup that also works when flipping the skeleton. Note that the chain root node is no longer parented to bones of the skeleton. This is a requirement in Unity to have momentum applied properly - do not reparent the chain root to bones of your skeleton, or you will loose any momentum applied by the skeleton's movement.Outline rendering functionality for all shaders.
Every shader now provides an additional set of Outline
parameters to enable custom outline rendering. When outline rendering is enabled via the Material
inspector, it automatically switches the shader to the respective Spine/Outline
shader variant. Outlines are generated by sampling neighbour pixels, so be sure to add enough transparent padding when exporting your atlas textures to fit the desired outline width. In order to enable outline rendering at a skeleton, it is recommended to first prepare an additional outline material copy and then switch the material of the target skeleton to this material. This prevents unnecessary additional runtime material copies and drawcalls. Material switching can be prepared via a SkeletonRendererCustomMaterials component and then enabled or disabled at runtime. Alternatively, you can also directly modify the SkeletonRenderer.CustomMaterialOverride
property.
Outline rendering is fully supported on SkeletonGraphic
shaders as well.SkeletonRenderer.EditorSkipSkinSync
scripting API property to be able to set custom skins in editor scripts. Enable this property when overwriting the Skeleton's skin from an editor script. Without setting this parameter, changes will be overwritten by the next inspector update. Only affects Inspector synchronisation of skin with initialSkinName
, not startup initialization.AtlasUtilities.GetRepackedAttachments()
and AtlasUtilities.GetRepackedSkin()
provide support for additional texture channels such as normal maps via the optional parameter additionalTexturePropertyIDsToCopy
. See the spine-unity runtime documentation, section Combining Skins - Advanced - Runtime Repacking with Normalmaps for further info and example usage code.BoneFollower
can now optionally follow (uniform) world scale of the reference bone. There is now a Mode
dropdown selector in the Inspector which can be set to either Local
or World Uniform
.Spine/SkeletonGraphic
shaders now provide a parameter CanvasGroup Compatible
which can be enabled to support CanvasGroup
alpha blending. For correct results, you should then disable Pma Vertex Colors
in the SkeletonGraphic
Inspector, in section Advanced
(otherwise Slot alpha will be applied twice).Now supporting Universal Render Pipeline (URP), including the 2D Renderer pipeline, through an additional UPM package.
Installation: You can download the Unity Package Manager (UPM) package via the download page or find it in the spine-runtimes/spine-unity/Modules subdirectory on the git repository. You can then either unzip (copy if using git) the package to
Packages
directory in your project where it will automatically be loaded, or+
icon, choose Add package from disk..
and point it to the package.json file.The Project panel should now show an entry Spine Universal RP Shaders
under Packages
. If the directory is not yet listed, you will need to close and re-open Unity to have it display the directory and its contents.
Usage: The package provides two shaders specifically built for the universal render pipeline:
Universal Render Pipeline/Spine/Skeleton
, as a universal variant of the Spine/Skeleton
shader,Universal Render Pipeline/Spine/Skeleton Lit
, as a universal variant of the Spine/Skeleton Lit
shader,Universal Render Pipeline/Spine/Sprite
, as a universal variant of the Spine/Sprite/Vertex Lit
and Pixel Lit
shaders, which were not functioning in the universal render pipeline,Universal Render Pipeline/2D/Spine/Skeleton Lit
, as a universal 2D Renderer variant of the Spine/Skeleton Lit
shader, andUniversal Render Pipeline/2D/Spine/Sprite
, as a universal 2D Renderer variant of the Spine/Sprite/Vertex Lit
and Pixel Lit
shaders.
The shaders can be assigned to materials as usual and will respect your settings of the assigned UniversalRenderPipelineAsset
under Project Settings - Graphics
.Premultiply alpha
(PMA) atlas textures in Linear color space. Please export your atlas textures as straight alpha
textures with disabled Premultiply alpha
setting when using Linear color space. You can check the current color space via Project Settings - Player - Other Settings - Color Space.
.com.esotericsoftware.spine.urp-shaders-3.8/Examples/URP Shaders.unity
that demonstrates usage of the URP shaders.Spine Preferences now provide an Atlas Texture Settings
parameter for applying customizable texture import settings at all newly imported Spine atlas textures.
When exporting atlas textures from Spine with Premultiply alpha
enabled (the default), you can leave it at PMATexturePreset
. If you have disabled Premultiply alpha
, set it to the included StraightAlphaTexturePreset
asset. You can also create your own TextureImporter
Preset
asset and assign it here (include PMA
or Straight
in the name). In Unity versions before 2018.3 you can use Texture2D
template assets instead of the newer Preset
assets. Materials created for imported textures will also have the Straight Alpha Texture
parameter configured accordingly.
Sprite
shaders (including URP and LWRP extension packages) now provide an additional Fixed Normal Space
option World-Space
. PReviously options were limited to View-Space
and Model-Space
.SkeletonGraphic
now fully supports SkeletonUtility
for generating a hierarchy of SkeletonUtilityBones
in both modes Follow
and Override
. This also enables creating hinge chain physics rigs and using SkeletonUtilityConstraints
such as SkeletonUtilityGroundConstraint
and SkeletonUtilityEyeConstraint
on SkeletonGraphic
.Additive
, Multiply
and Screen
with automatic assignment at newly imported skeleton assets. BlendModeMaterialAssets
are now obsolete and replaced by the native properties at SkeletonDataAsset
. The SkeletonDataAsset
Inspector provides a new Blend Modes - Upgrade
button to upgrade an obsolete BlendModeMaterialAsset
to the native blend modes properties. This upgrade will be performed automatically on imported and re-imported assets.BoneFollower
and BoneFollowerGraphic
components now provide better support for following bones when the skeleton's Transform is not the parent of the follower's Transform. Previously e.g. rotating a common parent Transform did not lead to the desired result, as well as negatively scaling a skeleton's Transform when it is not a parent of the follower's Transform.Linear
color space in Spine Editor Settings). This is now fixed at all shaders, including URP and LWRP shaders.PMA Vertex Colors
in combination with Linear
color space. Thus when using Spine shaders, you should always enable PMA Vertex Colors
at the SkeletonRenderer
component. This allows using single pass Additive
Slots rendering. Note that textures shall still be exported as Straight alpha
when using Linear
color space, so combine PMA Vertex Colors
with Straight Texture
. All Sprite
shaders now provide an additional blend mode for this, named PMA Vertex, Straight Texture
which shall be the preferred Sprite shader blend mode in Linear
color space.Light Affects Additive
which defaults to false
, as it is the more intuitive default value. You can enable the old behaviour by setting this parameter to true
.SkeletonRootMotion
and SkeletonMecanimRootMotion
components now support arbitrary bones in the hierarchy as Root Motion Bone
. Previously there were problems when selecting a non-root bone as Root Motion Bone
. Skeleton.ScaleX
and .ScaleY
and parent bone scale is now respected as well.Sprite
and SkeletonLit
shaders no longer require Advanced - Add Normals
enabled to properly cast and receive shadows. It is recommended to disable Add Normals
if normals are otherwise not needed.RootMotionDeltaCompensation
located in Spine Examples/Scripts/Sample Components
which can be used for applying simple delta compensation. You can enable and disable the component to toggle delta compensation of the currently playing animation on and off.SkeletonRagdoll
and SkeletonRagdoll2D
now support bone scale at any bone in the skeleton hierarchy. This includes negative scale and root bone scale.Attachment.GetRemappedClone(Sprite)
method now provides an additional optional parameter useOriginalRegionScale
. When set to true
, the replaced attachment's scale is used instead of the Sprite's Pixel per Unity
setting, allowing for more consistent scaling. Note: When remapping Sprites, be sure to set the Sprite's Mesh Type
to Full Rect
and not Tight
, otherwise the scale will be wrong.SkeletonGraphic
now supports all Slot blend modes when Advanced - Multiple Canvas Renderers
is enabled in the Inspector. The SkeletonGraphic
Inspector now provides a Blend Mode Materials
section where you can assign SkeletonGraphic
materials for each blend mode, or use the new default materials. New SkeletonGraphic
shaders and materials have been added for each blend mode. The BlendModes.unity
example scene has been extended to demonstrate this new feature. For detailed information see the SkeletonGraphic documentation page
.Don't End with Clip
and Clip End Mix Out Duration
parameters. By default when empty space follows the clip on the timeline, the empty animation is set on the track with a MixDuration of Clip End Mix Out Duration
. Set Don't End with Clip
to true
to continue playing the clip's animation instead and mimic the old 3.8 behaviour. If you prefer pausing the animation instead of mixing out to the empty animation, set Clip End Mix Out Duration
to a value less than 0, then the animation is paused instead.SkeletonRenderer
, SkeletonAnimation
and SkeletonMecanim
now provide a proper Editor preview, including the preview thumbnail.SkeletonRenderer
(and subclassesSkeletonAnimation
and SkeletonMecanim
) now provide a property Advanced - Fix Prefab Override MeshFilter
, which when enabled fixes the prefab always being marked as changed. It sets the MeshFilter's hide flags to DontSaveInEditor
. Unfortunately this comes at the cost of references to the MeshFilter
by other components being lost, therefore this parameter defaults to false
to keep the safe existing behaviour.BoundingBoxFollower
and BoundingBoxFollowerGraphic
now provide previously missing usedByEffector
and usedByComposite
parameters to be set at all generated colliders.BoneFollower
and BoneFollowerGraphic
now provide an additional Follow Parent World Scale
parameter to allow following simple scale of parent bones (rotated/skewed scale can't be supported).Advanced - Fix Prefab Override MeshFilter
property for SkeletonRenderer
(and subclassesSkeletonAnimation
and SkeletonMecanim
), now providing an additional option to use a global value which can be set in Edit - Preferences - Spine
.Spine AnimationState Clip
Inspector parameter Custom Duration
changed and inverted to Default Mix Duration
for more clarity. Shortened all Timeline add track menu entries from: Spine.Unity.Playables - <track type>
to Spine - <track type>
, Spine Animation State Track
to SkeletonAnimation Track
, Spine AnimationState Graphic Track
to SkeletonGraphic Track
, and Spine Skeleton Flip Track
to Skeleton Flip Track
.SkeletonRenderTexture
to render a SkeletonRenderer
to a RenderTexture
, mainly for proper transparency. Added an example scene named RenderTexture FadeOut Transparency
that demonstrates usage for a fadeout transparency effect.SkeletonRenderTextureFadeout
which takes over transparency fadeout when enabled. You can use this component as-is, attach it in disabled state and enable it to start a fadeout effect.Alpha
parameter for setting a custom constant mix alpha value other than 1.0, just as TrackEntry.Alpha
. Defaults to 1.0.SkeletonGraphic
now provides additional render callback delegates OnInstructionsPrepared
, AssignMeshOverrideSingleRenderer
and AssignMeshOverrideMultipleRenderers
. OnInstructionsPrepared
is raised at the end of LateUpdate after render instructions are done, target renderers are prepared, and the mesh is ready to be generated. The two AssignMeshOverride
delegates allow separate code to take over mesh and material assignment of a SkeletonGraphic
component.SkeletonGraphicRenderTexture
to render a SkeletonGraphic
to a RenderTexture
(similar as SkeletonRenderTexture
), mainly for proper transparency. Extended example scene RenderTexture FadeOut Transparency
accordingly.Changes of default values
Deprecated
Restructuring (Non-Breaking)
SpineEffectNormalmap
and support for loading multiple texture layers following a suffix-pattern. Please see the example code on how to use them.Z
property to SkeletonRenderer
to provide a constant Z offset that's added to all vertices.ZSpacing
property to SkeletonRenderer
to allow specifying the distance on the z-axis between attachments.AnimationState.clearNext()
which removes the given TrackEntry
and all entries after it.Region.names
and Region.values
.TrackEntry.getReverse()
and TrackEntry.setReverse()
.SkeletonData
and Skeleton
methods: findBoneIndex
, findSlotIndex
. Bones and slots have an index
field that should be used instead.SkeletonRendererDebug
.AnimationState.clearNext()
which removes the given TrackEntry
and all entries after it.AtlasRegion.names
and AtlasRegion.values
.TrackEntry.reverse
.require "spine-corona.spine"
statements to require "spine-solar2d.spine"
build/
folder and compiled artifacts are no longer part of the repository. Instead, npm run build
in spine-ts/
to generate ECMAScript modules and IIFE modules in spine-<module-name>/dist
..npmignore
and package.json
files in the root directory have been deleted. Use the corresponding files in spine-ts/
instead, or better, depend on the packages from the NPM registry.AssetManager#setRawDataURI(path, data)
. Allows to set raw data URIs for a specific path, which in turn enables embedding assets into JavaScript/HTML.AnimationState.clearNext()
which removes the given TrackEntry
and all entries after it.AtlasRegion.names
and AtlasRegion.values
.TrackEntry.reverse
.AssetManager
constructor now takes an option Downloader
instance. Used to download assets only once and share them between AssetManager
instances.AssetManager
.AnimationState
methods for ease of use.SpineCanvas
, a simpler way to render a scene via spine-webgl. See spine-ts/spine-webgl/examples/barebones.html
and spine-ts/spine-webgl/examples/mix-and-match.html
.SharedAssetManager
. Use AssetManager
with a shared Downloader
instance instead.spine.webgl
no longer exists. All classes and functions are now exposed on the global spine
object directly. Simply replace any reference to spine.webgl.
in your source code with spine.
.spine.canvas
no longer exists. All classes and functions are now exposed on the global spine
object directly. Simply replace any reference to spine.canvas.
in your source code with spine.
.SkeletonMesh
now takes an optional SkeletonMeshMaterialParametersCustomizer
function that allows you to modify the ShaderMaterialParameters
before the material is finalized. Use it to modify things like THREEJS' Material.depthTest
etc. See #1590.spine.canvas
no longer exists. All classes and functions are now exposed on the global spine
object directly. Simply replace any reference to spine.threejs.
in your source code with spine.
.SkeletonMeshMaterial
now explicitely discards fragments with alpha < 0.5. See https://github.com/EsotericSoftware/spine-runtimes/issues/1985SkeletonMeshMaterial
does no longer discard fragments with alpha < 0.5. Pass a SkeletonMeshMaterialParametersCustomizer
to the SkeletonMesh
constructor, and modify parameters.alphaTest
to be > 0.SpinePlayerConfig.rawDataURIs
. Allows to embed data URIs for skeletons, atlases and atlas page images directly in the HTML/JS without needing to load it from a separate file. See the example for a demonstration.SpinePlayerConfig.frame
. If set, the callback is called each frame, before the skeleton is posed or drawn.SpinePlayerConfig.update
. If set, the callback is called each frame, just after the skeleton is posed.SpinePlayerConfig.draw
. If set, the callback is called each frame, just after the skeleton is drawn.SpinePlayerConfig.downloader
. The spine.Downloader
instance can be shared between players so assets are only downloaded once.SpinePlayerConfig.jsonURL
ends with an anchor, the anchor text is used to find the skeleton in the specified JSON file.SpinePlayer.dispose()
, disposes all CPU and GPU side resources, removes all listeners, and removes the player DOM from the parent.Breaking changes
Slot#getAttachmentVertices()
to Slot#getDeform()
..json
curve format and added more assumptions for omitted values, reducing the average size of JSON exports.Skin#addAttachment()
to Skin#setAttachment()
.VertexAttachment#applyDeform()
and replaced it with VertexAttachment#deformAttachment
. The attachment set on this field is used to decide if a DeformTimeline
should be applied to the attachment active on the slot to which the timeline is applied.inheritDeform
field, getter, and setter from MeshAttachment
..skel
binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably..json
and .skel
file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.README.md
files for instructions.Additions
SkeletonBinary
to load binary .skel
files. See MixAndMatchExample.as
in spine-startling-example
.x
and y
coordinates for setup pose AABB in SkeletonData
.Skin#getAttachments()
. Returns all attachments in the skin.Skin#getAttachments(int slotIndex)
. Returns all attachements in the skin for the given slot index.Skin#addSkin(Skin skin)
. Adds all attachments, bones, and skins from the specified skin to this skin.Skin#copySkin(Skin skin)
. Adds all attachments, bones, and skins from the specified skin to this skin. VertexAttachment
are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.Attachment#copy()
to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.MeshAttachment#newLinkedMesh()
, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.MixAndMatchExample.as
to demonstrate the new Skin API additions and how to load binary .skel
files.README.md
files for instructions.Breaking changes
spSlot#attachmentVertices
to spSlot#deform
..json
curve format and added more assumptions for omitted values, reducing the average size of JSON exports.spSkin_addAttachment()
to Skin#spSkin_addAttachment()
.spVertexAttachment_applyDeform()
and replaced it with VertexAttachment#deformAttachment
. The attachment set on this field is used to decide if a spDeformTimeline
should be applied to the attachment active on the slot to which the timeline is applied.inheritDeform
field, getter, and setter from spMeshAttachment
..skel
binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably..json
and .skel
file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.Additions
x
and y
coordinates for setup pose AABB in spSkeletonData
.spSkin_getAttachments()
. Returns all attachments in the skin.spSkin_getAttachments(int slotIndex)
. Returns all attachements in the skin for the given slot index.spSkin_addSkin(spSkin* skin)
. Adds all attachments, bones, and skins from the specified skin to this skin.spSkin_copySkin(spSkin* skin)
. Adds all attachments, bones, and skins from the specified skin to this skin. spVertexAttachment
are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.spAttachment_copy()
to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.spMeshAttachment_newLinkedMesh()
, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.IKExample
.SkeletonAnimation preUpdateWorldTransformsListener
and SkeletonAnimation postUpdateWorldTransformsListener
. When set, these callbacks will be invokved before and after the skeleton's updateWorldTransforms()
method is called. See the IKExample
how it can be used.IKExample
.Breaking Changes
Slot::getAttachmentVertices()
to Slot::getDeform()
..json
curve format and added more assumptions for omitted values, reducing the average size of JSON exports.Skin::addAttachment()
to Skin::setAttachment()
.VertexAttachment::applyDeform()
and replaced it with VertexAttachment::getDeformAttachment()
. The attachment set on this field is used to decide if a DeformTimeline
should be applied to the attachment active on the slot to which the timeline is applied._inheritDeform
field, getter, and setter from MeshAttachment
..skel
binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably..json
and .skel
file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.Additions
AnimationState
and TrackEntry
now also accept a subclass of AnimationStateListenerObject
as a listener for animation events in the overloaded setListener()
method.SkeletonBinary
and SkeletonJson
now parse and set all non-essential data like audio path.x
and y
coordinates for setup pose AABB in SkeletonData
.Skin#getAttachments()
. Returns all attachments in the skin.Skin#getAttachments(int slotIndex)
. Returns all attachements in the skin for the given slot index.Skin#addSkin(Skin &skin)
. Adds all attachments, bones, and skins from the specified skin to this skin.Skin#copySkin(Skin &skin)
. Adds all attachments, bones, and skins from the specified skin to this skin. VertexAttachment
are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.Attachment#copy()
to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.MeshAttachment#newLinkedMesh()
, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.x
and y
on SkeletonData
through getters and setters.IKExample
.SkeletonAnimation::setPreUpdateWorldTransformsListener()
and SkeletonAnimation::setPreUpdateWorldTransformsListener()
. When set, these callbacks will be invokved before and after the skeleton's updateWorldTransforms()
method is called. See the IKExample
how it can be used.bAutoPlaying
flag to USpineSkeletonAnimationComponent
. When false
, the component will not update the internal animation state and skeleton.USpineSkeletonRendererComponent
allows passing a USpineSkeletonComponent
to update it. This way, the renderer component can be used without a skeleton component on the same actor.SpineSkeletonComponent
and SpineSkeletonAnimationComponent
to query and set skins, and enumerate bones, slots, and animations.RHI
, RenderCore
, and ShaderCore
.SkeletonRendererComponent
are now blueprint read and writeable. This allows setting dynamic material instances at runtime.InitialSkin
property to USpineWidget
. This allows previewing different skins in the UMG Designer. Initial skins can still be overridden via blueprint events such as On Initialized
.USpineWidget
will now report its own desired size based on the setup pose dimensions of the skeleton. This is used when selecting Size to content
on a USpineWidget
in the designer.Breaking changes
IkConstraintData.Bones
type from List<BoneData>
to ExposedList<BoneData>
for unification reasons. Note: this modification will most likely not affect user code.Slot.AttachmentVertices
to Slot.Deform
..json
curve format and added more assumptions for omitted values, reducing the average size of JSON exports.Skin.AddAttachment()
to Skin.SetAttachment()
.FindAttachmentsForSlot(int slotIndex, List<Attachment> attachments)
and FindNamesForSlot (int slotIndex, List<string> names)
and replaced it with Skin.GetAttachments(int slotIndex, List<SkinEntry> attachments)
which returns the combined SkinEntry
object holding both name and attachment.VertexAttachment.ApplyDeform()
and replaced it with VertexAttachment.DeformAttachment
. The attachment set on this field is used to decide if a DeformTimeline
should be applied to the attachment active on the slot to which the timeline is applied.inheritDeform
field, getter, and setter from MeshAttachment
..skel
binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably..json
and .skel
file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.Additions
x
and y
coordinates for setup pose AABB in SkeletonData
.Skin.GetAttachments()
. Returns all attachments in the skin.Skin.GetAttachments(int slotIndex, List<SkinEntry> attachments)
. Returns all attachements in the skin for the given slot index. This method replaces FindAttachmentsForSlot
and FindNamesForSlot
.Skin.AddSkin(Skin skin)
. Adds all attachments, bones, and skins from the specified skin to this skin.Skin.CopySkin(Skin skin)
. Adds all attachments, bones, and skins from the specified skin to this skin. VertexAttachment
are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.Attachment.Copy()
to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.MeshAttachment.NewLinkedMesh()
, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.Breaking changes
.asmdef
files are again active by default. They have previously been deactivated to .txt
extension which is now no longer necessary.AnimationState.ClearTrack(0);
followed by var entry = AnimationState.SetAnimation(0, animation, loop); entry.TrackTime = time
to achieve similar behaviour.Shadow alpha cutoff
shader parameter is now respecting slot-color alpha values at all Spine shaders. A fragment's texture color alpha is multiplied with slot-color alpha before the result is tested against the Shadow alpha cutoff
threshold.Attachment.GetClone()
and MeshAttachment.GetLinkedClone()
extension methods. Use methods Attachment.Copy
and MeshAttachment.NewLinkedMesh()
instead.Attachment.GetClone(bool cloneMeshesAsLinked)
to Attachment.GetCopy(bool cloneMeshesAsLinked)
to follow the naming scheme of the Spine API.SkeletonDataAsset.atlasAssets
is now an array of the base class AtlasAssetBase
instead of SpineAtlasAsset
, which provides IEnumerable<> Materials
instead of List<> materials
. Replace any access via atlasAsset.materials[0]
with atlasAsset.Materials.First()
and add a using System.Linq;
statement.MeshAttachment.GetLinkedMesh()
method signatures: removed optional parameters bool inheritDeform = true, bool copyOriginalProperties = false
.Spine.Unity.Modules
to Spine.Unity
and Spine.Unity.Examples
after restructuring (see section below) in respective classes:using Spine.Unity.Modules.AttachmentTools;
with using Spine.Unity.AttachmentTools;
. You can remove using Spine.Unity.Modules;
statements when a using Spine.Unity
statement is already present in the file.AttachmentTools
, SkeletonPartsRenderer
, SkeletonRenderSeparator
, SkeletonRendererCustomMaterials
changed to namespace Spine.Unity
.SkeletonGhost
, SkeletonGhostRenderer
, AtlasRegionAttacher
, SkeletonGraphicMirror
, SkeletonRagdoll
, SkeletonRagdoll2D
, SkeletonUtilityEyeConstraint
, SkeletonUtilityGroundConstraint
, SkeletonUtilityKinematicShadow
changed to namespace Spine.Unity.Examples
.Editor/Utility/SpineEditorUtilities
class into multiple files with partial class qualifier.SpineEditorUtilities.AssetUtility
and SpineEditorUtilities.EditorInstantiation
are now no longer nested. If you receive namespace related errors, replace any occurrance ofSpineEditorUtilities.AssetUtility
with AssetUtility
andSpineEditorUtilities.EditorInstantiation
with EditorInstantiation
.Modules/Timeline
directory and was deactivated by default, making it necessary to activate it via the Spine Preferences. Now the Timeline integration has been moved to an additional UPM package which can be found under Modules/com.esotericsoftware.spine.timeline
.Packages
directory in your project where it will automatically be loaded, or
b) to an arbitrary directory outside the Assets directory and then open Package Manager in Unity, select the +
icon, choose Add package from disk..
and point it to the package.json file.
The Project panel should now show an entry Spine Timeline Extensions
under Packages
. If the directory is not yet listed, you will need to close and re-open Unity to have it display the directory and its contents.SkeletonMecanim
's Layer Mix Mode
enum name MixMode.SpineStyle
has been renamed to MixMode.Hard
. This is most likely not set via code and thus unlikely to be a problem. Serialized scenes and prefabs are unaffected.SkeletonRootMotion
and SkeletonMecanimRootMotion
components now support arbitrary bones in the hierarchy as Root Motion Bone
. Previously there were problems when selecting a non-root bone as Root Motion Bone
. Skeleton.ScaleX
and .ScaleY
and parent bone scale is now respected as well.Additions
SettingsProvider
API, storing settings in a SpineSettings.asset file which can be shared with team members. Your old preferences are automatically migrated to the new system.SkeletonAnimation
and SkeletonMecanim
. All mask interaction modes are supported. See this blog post.Create 2D Hinge Chain
button at SkeletonUtilityBone
inspector, previously only Create 3D Hinge Chain
was available.Now supporting Lightweight Render Pipeline (LWRP) through an additional UPM package.
Installation: You can download the Unity Package Manager (UPM) package via the download page or find it in the spine-runtimes/spine-unity/Modules subdirectory on the git repository. You can then either unzip (copy if using git) the package to
Packages
directory in your project where it will automatically be loaded, or+
icon, choose Add package from disk..
and point it to the package.json file.If you are using git and Unity 2019.2 or newer versions and receive an error that dependencies could not be resolved by the package manager (only higher versions of Unity's
Lightweight RP
package are available, e.g.6.9.0
and up), please copy the prepared package-UNITYVERSION.json file for your Unity version (e.g.package-2019.2.json
) over the existing package.json file to change the dependency accordingly. Unfortunately Unity's Package Manager does not provide a way to specify a version range for a dependency like "5.7.2 - 6.9.0" yet, so this manual step is necessary for git users.
The Project panel should now show an entry Spine Lightweight RP Shaders
under Packages
. If the directory is not yet listed, you will need to close and re-open Unity to have it display the directory and its contents.
Usage: The package provides two shaders specifically built for the lightweight render pipeline:
Lightweight Render Pipeline/Spine/Skeleton
, as a lightweight variant of the Spine/Skeleton
shader,Lightweight Render Pipeline/Spine/Skeleton Lit
, as a lightweight variant of the Spine/Skeleton Lit
shader andLightweight Render Pipeline/Spine/Sprite
, as a lightweight variant of the Spine/Sprite/Vertex Lit
and Pixel Lit
shaders, which were not functioning in the lightweight render pipeline. The shaders can be assigned to materials as usual and will respect your settings of the assigned LightweightRenderPipelineAsset
under Project Settings - Graphics
.Premultiply alpha
(PMA) atlas textures in Linear color space. Please export your atlas textures as straight alpha
textures with disabled Premultiply alpha
setting when using Linear color space. You can check the current color space via Project Settings - Player - Other Settings - Color Space.
.com.esotericsoftware.spine.lwrp-shaders-3.8/Examples/LWRP Shaders.unity
that demonstrates usage of the LWRP shaders.Added Spine/Skeleton Lit ZWrite
shader. This variant of the Spine/Skeleton Lit
shader writes to the depth buffer with configurable depth alpha threshold. Apart from that it is identical to Spine/Skeleton Lit
.
End
, Complete
and Interrupt
.WaitForSpineAnimationComplete
now proves an additional bool includeEndEvent
parameter, defaults to false
(previous behaviour).WaitForSpineAnimationEnd
yield instruction.WaitForSpineAnimation
yield instruction which can be configured to wait for any combination of animation track events. It is now used as base class for WaitForSpineAnimationComplete
and WaitForSpineAnimationEnd
.disabled
(previous behaviour).
Applies only when 3+ submeshes are used (2+ materials with alternating order, e.g. "A B A").
If true, MaterialPropertyBlocks are assigned at each material to prevent aggressive batching of submeshes
by e.g. the LWRP renderer, leading to incorrect draw order (e.g. "A1 B A2" changed to "A1A2 B").
You can leave this parameter disabled when everything is drawn correctly to save the additional performance cost.Speed Multiplier
, a start time offset parameter Clip In
, support for blending successive animations by overlapping tracks. An additional Use Blend Duration
parameter (defaults to true) allows for automatic synchronisation of MixDuration with the current overlap blend duration. An additional Spine preferences parameter Use Blend Duration
has been added which can be disabled to default to the previous behaviour before this update.SpriteMask and RectMask2D
example scene added for demonstration of mask setup and interaction.Real physics hinge chains
for both 2D and 3D physics. The SkeletonUtilityBone Inspector provides an interface to create 2D and 3D hinge chains. Previously created chains have only been respecting gravity, but not momentum of the skeleton or parent bones. The new physics rig created when pressing Create 3D Hinge Chain
and Create 2D Hinge Chain
creates a more complex setup that also works when flipping the skeleton. Note that the chain root node is no longer parented to bones of the skeleton. This is a requirement in Unity to have momentum applied properly - do not reparent the chain root to bones of your skeleton, or you will loose any momentum applied by the skeleton's movement.Outline rendering functionality for all shaders.
Every shader now provides an additional set of Outline
parameters to enable custom outline rendering. When outline rendering is enabled via the Material
inspector, it automatically switches the shader to the respective Spine/Outline
shader variant. Outlines are generated by sampling neighbour pixels, so be sure to add enough transparent padding when exporting your atlas textures to fit the desired outline width. In order to enable outline rendering at a skeleton, it is recommended to first prepare an additional outline material copy and then switch the material of the target skeleton to this material. This prevents unnecessary additional runtime material copies and drawcalls. Material switching can be prepared via a SkeletonRendererCustomMaterials component and then enabled or disabled at runtime. Alternatively, you can also directly modify the SkeletonRenderer.CustomMaterialOverride
property.
Outline rendering is fully supported on SkeletonGraphic
shaders as well.SkeletonRenderer.EditorSkipSkinSync
scripting API property to be able to set custom skins in editor scripts. Enable this property when overwriting the Skeleton's skin from an editor script. Without setting this parameter, changes will be overwritten by the next inspector update. Only affects Inspector synchronisation of skin with initialSkinName
, not startup initialization.Spine/SkeletonGraphic
shaders now provide a parameter CanvasGroup Compatible
which can be enabled to support CanvasGroup
alpha blending. For correct results, you should then disable Pma Vertex Colors
in the SkeletonGraphic
Inspector, in section Advanced
(otherwise Slot alpha will be applied twice).Now supporting Universal Render Pipeline (URP), including the 2D Renderer pipeline, through an additional UPM package.
Installation: You can download the Unity Package Manager (UPM) package via the download page or find it in the spine-runtimes/spine-unity/Modules subdirectory on the git repository. You can then either unzip (copy if using git) the package to
Packages
directory in your project where it will automatically be loaded, or+
icon, choose Add package from disk..
and point it to the package.json file.The Project panel should now show an entry Spine Universal RP Shaders
under Packages
. If the directory is not yet listed, you will need to close and re-open Unity to have it display the directory and its contents.
Usage: The package provides two shaders specifically built for the universal render pipeline:
Universal Render Pipeline/Spine/Skeleton
, as a universal variant of the Spine/Skeleton
shader,Universal Render Pipeline/Spine/Skeleton Lit
, as a universal variant of the Spine/Skeleton Lit
shader,Universal Render Pipeline/Spine/Sprite
, as a universal variant of the Spine/Sprite/Vertex Lit
and Pixel Lit
shaders, which were not functioning in the universal render pipeline,Universal Render Pipeline/2D/Spine/Skeleton Lit
, as a universal 2D Renderer variant of the Spine/Skeleton Lit
shader, andUniversal Render Pipeline/2D/Spine/Sprite
, as a universal 2D Renderer variant of the Spine/Sprite/Vertex Lit
and Pixel Lit
shaders.
The shaders can be assigned to materials as usual and will respect your settings of the assigned UniversalRenderPipelineAsset
under Project Settings - Graphics
.Premultiply alpha
(PMA) atlas textures in Linear color space. Please export your atlas textures as straight alpha
textures with disabled Premultiply alpha
setting when using Linear color space. You can check the current color space via Project Settings - Player - Other Settings - Color Space.
.com.esotericsoftware.spine.urp-shaders-3.8/Examples/URP Shaders.unity
that demonstrates usage of the URP shaders.Spine Preferences now provide an Atlas Texture Settings
parameter for applying customizable texture import settings at all newly imported Spine atlas textures.
When exporting atlas textures from Spine with Premultiply alpha
enabled (the default), you can leave it at PMATexturePreset
. If you have disabled Premultiply alpha
, set it to the included StraightAlphaTexturePreset
asset. You can also create your own TextureImporter
Preset
asset and assign it here (include PMA
or Straight
in the name). In Unity versions before 2018.3 you can use Texture2D
template assets instead of the newer Preset
assets. Materials created for imported textures will also have the Straight Alpha Texture
parameter configured accordingly.
Sprite
shaders (including URP and LWRP extension packages) now provide an additional Fixed Normal Space
option World-Space
. PReviously options were limited to View-Space
and Model-Space
.SkeletonGraphic
now fully supports SkeletonUtility
for generating a hierarchy of SkeletonUtilityBones
in both modes Follow
and Override
. This also enables creating hinge chain physics rigs and using SkeletonUtilityConstraints
such as SkeletonUtilityGroundConstraint
and SkeletonUtilityEyeConstraint
on SkeletonGraphic
.OnMeshAndMaterialsUpdated
callback event to SkeletonRenderer
and SkeletonGraphic
. It is issued at the end of LateUpdate
, before rendering.Skeleton-OutlineOnly
single pass shader to LWRP and URP extension modules. It can be assigned to materials as Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly
. This allows for separate outline child GameObjects that reference the existing Mesh of their parent, and re-draw the mesh using this outline shader.RenderExistingMesh
to render a mesh again with different materials, as required by the new Skeleton-OutlineOnly
shaders.
In URP the outline has to be rendered via a separate GameObject as URP does not allow multiple render passes. To add an outline to your SkeletenRenderer:RenderExistingMesh
component, provided in the Spine Examples/Scripts/Sample Components
directory.Universal Render Pipeline/Spine/Outline/Skeleton-OutlineOnly
.RenderExistingMesh
component under Replacement Materials.Outline Shaders URP
example scene to URP extension module to demonstrate the above additions.SpriteAtlas
as atlas provider (as an alternative to .atlas.txt
and .png
files) alongside a skeleton data file. There is now an additional Spine SpriteAtlas Import
tool window accessible via Window - Spine - SpriteAtlas Import
. Additional information can be found in a new section on the spine-unity documentation page.SkeletonGraphic
. You can enable this feature by enabling the parameter Multiple CanvasRenders
in the Advanced
section of the SkeletonGraphic
Inspector. This automatically creates the required number of child CanvasRenderer
GameObjects for each required draw call (submesh).SkeletonGraphic
. Render separation can be enabled directly in the Advanced
section of the SkeletonGraphic
Inspector, it does not require any additional components (like SkeletonRenderSeparator
or SkeletonPartsRenderer
for SkeletonRenderer
components). When enabled, additional separator GameObjects will be created automatically for each separation part, and CanvasRenderer
GameObjects re-parented to them accordingly. The separator GameObjects can be moved around and re-parented in the hierarchy according to your requirements to achieve the desired draw order within your Canvas
. A usage example can be found in the updated Spine Examples/Other Examples/SkeletonRenderSeparator
scene.SkeletonGraphicCustomMaterials
component, providing functionality to override materials and textures of a SkeletonGraphic
, similar to SkeletonRendererCustomMaterials
. Note: overriding materials or textures per slot is not provided due to structural limitations.SkeletonAnimation
, SkeletonMecanim
and SkeletonGraphic
via new components SkeletonRootMotion
and SkeletonMecanimRootMotion
. The SkeletonAnimation
and SkeletonGraphic
component Inspector now provides a line Root Motion
with Add Component
and Remove Component
buttons to add/remove the new SkeletonRootMotion
component to your GameObject. The SkeletonMecanim
Inspector detects whether root motion is enabled at the Animator
component and adds a SkeletonMecanimRootMotion
component automatically.SkeletonMecanim
now provides an additional Custom MixMode
parameter under Mecanim Translator
. It is enabled by default in version 3.8 to maintain current behaviour, using the set Mix Mode
for each Mecanim layer. When disabled, SkeletonMecanim
will use the recommended MixMode
according to the layer blend mode. Additional information can be found in the Mecanim Translator section on the spine-unity documentation pages.SkeletonLit
shaders (including URP and LWRP packages).Update When Invisible
(Inspector parameter) and UpdateMode
(available via code) to all Skeleton components. This provides a simple way to disable certain updates when the Renderer
is no longer visible (outside all cameras, culled in frustum culling). The new UpdateMode
property allows disabling updates at a finer granularity level than disabling the whole component. Available modes are: Nothing
, OnlyAnimationStatus
, EverythingExceptMesh
and FullUpdate
.Spine/Outline/OutlineOnly-ZWrite
shader to provide correct outline-only rendering. Note: the shader requires two render passes and is therefore not compatible with URP. The Spine Examples/Other Examples/Outline Shaders
example scene has been updated to demonstrate the new shader.OnMeshAndMaterialsUpdated
callback event to SkeletonRenderSeparator
and SkeletonPartsRenderer
. It is issued at the end of LateUpdate
, before rendering.Root Motion Scale X/Y
parameters to SkeletonRootMotionBase
subclasses (SkeletonRootMotion
and SkeletonMecanimRootMotion
). Also providing AdjustRootMotionToDistance()
and other methods to allow for easy delta compensation. Delta compensation can be used to e.g. stretch a jump to a given distance. Root motion can be adjusted at the start of an animation or every frame via skeletonRootMotion.AdjustRootMotionToDistance(targetPosition - transform.position, trackIndex);
.Canvas Group Tint Black
parameter at the SkeletonGraphic
Inspector in the Advanced
section. When using the Spine/SkeletonGraphic Tint Black
shader you can enable this parameter to receive proper blending results when using Additive
blend mode under a CanvasGroup
. Be sure to also have the parameter CanvasGroup Compatible
enabled at the shader. Note that the normal Spine/SkeletonGraphic
does not support Additive
blend mode at a CanvasGroup
, as it requires additional shader channels to work.Mix and Match Skins
example scene to demonstrate how the 3.8 Skin API and combining skins can be used for a wardrobe and equipment use case.Hold Previous
parameter at SpineAnimationStateClip
.Edit - Preferences - Spine
.BeforeApply
update callbacks at all skeleton animation components (SkeletonAnimation
, SkeletonMecanim
and SkeletonGraphic
).BoundingBoxFollowerGraphic
component. This class is a counterpart of BoundingBoxFollower
that can be used with SkeletonGraphic
.SkeletonRenderer - Add all BoundingBoxFollower GameObjects
and SkeletonGraphic - Add all BoundingBoxFollowerGraphic GameObjects
that automatically generate bounding box follower GameObjects for every BoundingBoxAttachment
for all skins of a skeleton.GetRemappedClone()
now provides an additional parameter pivotShiftsMeshUVCoords
for MeshAttachment
to prevent uv shifts at a non-central Sprite pivot. This parameter defaults to true
to maintain previous behaviour.SkeletonRenderer
components now provide an additional update mode Only Event Timelines
at the Update When Invisible
property. This mode saves additional timeline updates compared to update mode Everything Except Mesh
.Diffuse Ramp
modes as an Inspector Material parameter: Hard
, Soft
, Old Hard
and Old Soft
. In spine-unity 3.8 it defaults to Old Hard
to keep the behaviour of existing projects unchanged. From 4.0 on it defaults to Hard
for newly created materials while existing ones remain unchanged. Note that Old Hard
and Old Soft
ramp versions were using only the right half of the ramp texture, and additionally multiplying the light intensity by 2, both leading to brighter lighting than without a ramp texture active. The new ramp modes Hard
and Soft
use the full ramp texture and do not modify light intensity, being consistent with lighting without a ramp texture active.Additive
, Multiply
and Screen
with automatic assignment at newly imported skeleton assets. BlendModeMaterialAssets
are now obsolete and replaced by the native properties at SkeletonDataAsset
. The SkeletonDataAsset
Inspector provides a new Blend Modes - Upgrade
button to upgrade an obsolete BlendModeMaterialAsset
to the native blend modes properties. This upgrade will be performed automatically on imported and re-imported assets in Unity 2020.1 and newer to prevent reported BlendModeMaterialAsset
issues in these Unity versions. spine-unity 4.0 and newer will automatically perform this upgrade regardless of the Unity version.BoneFollower
and BoneFollowerGraphic
components now provide better support for following bones when the skeleton's Transform is not the parent of the follower's Transform. Previously e.g. rotating a common parent Transform did not lead to the desired result, as well as negatively scaling a skeleton's Transform when it is not a parent of the follower's Transform.Sprite
and SkeletonLit
shaders no longer require Advanced - Add Normals
enabled to properly cast and receive shadows. It is recommended to disable Add Normals
if normals are otherwise not needed.RootMotionDeltaCompensation
located in Spine Examples/Scripts/Sample Components
which can be used for applying simple delta compensation. You can enable and disable the component to toggle delta compensation of the currently playing animation on and off.SkeletonRootMotionBase.AdjustRootMotionToDistance()
which default to adjusting both X and Y as before. The RootMotionDeltaCompensation
example component exposes these parameters as public attributes.Attachment.GetRemappedClone(Sprite)
method now provides an additional optional parameter useOriginalRegionScale
. When set to true
, the replaced attachment's scale is used instead of the Sprite's Pixel per Unity
setting, allowing for more consistent scaling. Note: When remapping Sprites, be sure to set the Sprite's Mesh Type
to Full Rect
and not Tight
, otherwise the scale will be wrong.Changes of default values
SkeletonMecanim
's Layer Mix Mode
now defaults to MixMode.MixNext
instead of MixMode.MixAlways
.BlendModeMaterialAsset
and it's instance Default BlendModeMaterials.asset
now have Apply Additive Material
set to true
by default in order to apply all blend modes by default.Deprecated
Modules/SlotBlendModes/SlotBlendModes
component. Changed namespace from Spine.Unity.Modules
to Spine.Unity.Deprecated
. Moved to Deprecated/SlotBlendModes
.Restructuring (Non-Breaking)
Note: The following changes will most likely not affect users of the Spine-Unity runtime as the API remains unchanged and no references are invalidated.
.cginc
files in Modules/Shaders/Sprite
that were also present in the Modules/Shaders/Sprite/CGIncludes
directory.Modules/Shaders
to Shaders
directory.Modules/SkeletonGraphic/Shaders
to Shaders/SkeletonGraphic
.Shaders/Spine-SkeletonLit.shader
to Shaders/Spine-Skeleton-Lit.shader
.SkeletonGraphic
to Components
and Components/Following
except for SkeletonGraphicMirror
which was moved to Spine Examples/Scripts/Sample Components
.BoneFollower
, BoneFollowerGraphic
and PointFollower
from Components
directory to Components/Following
.BoundingBoxFollower
component from Modules/BoundingBoxFollower
to Components/Following
.Modules/SkeletonRenderSeparator
directory to Components/SkeletonRenderSeparator
.Modules/CustomMaterials
directory to Components/SkeletonRendererCustomMaterials
.Asset Types/BlendModeMaterialsAsset.cs
class, Shaders/BlendModes/Default BlendModeMaterials.asset
and materials from Shaders/BlendModes
to SkeletonDataModifierAssets/BlendModeMaterials
directory.Modules/Ghost
directory to Spine Examples/Scripts/Sample Components/Ghost
.Modules/SkeletonUtility Modules
directory to Spine Examples/Scripts/Sample Components/SkeletonUtility Modules
.Modules/AnimationMatchModifier
directory to Spine Examples/Scripts/MecanimAnimationMatchModifier
.SkeletonRagdoll
and SkeletonRagdoll2D
components from Modules/Ragdoll
directory to Spine Examples/Scripts/Sample Components/SkeletonUtility Modules
.AttachmentTools.cs
to Utility
directory.AttachmentTools
into 5 separate files for each contained class. No namespace or other API changes performed.Mesh Generation/SpineMesh
into 4 separate files for each contained class. No namespace or other API changes performed.SkeletonExtensions.cs
to Utility
directory.Modules/YieldInstructions
directory to Utility/YieldInstructions
.PointFollowerEditor
to PointFollowerInspector
for consistency reasons.SpineEffectNormalmap
and support for loading multiple texture layers following a suffix-pattern. Please see the example code on how to use them.Breaking changes
Slot#getAttachmentVertices()
to Slot#getDeform()
..json
curve format and added more assumptions for omitted values, reducing the average size of JSON exports.Skin#addAttachment()
to Skin#setAttachment()
.VertexAttachment#applyDeform()
and replaced it with VertexAttachment#deformAttachment
. The attachment set on this field is used to decide if a DeformTimeline
should be applied to the attachment active on the slot to which the timeline is applied.inheritDeform
field, getter, and setter from MeshAttachment
..skel
binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably.JsonRollback
tool now converts from 3.8 JSON to 3.7..json
and .skel
file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.Additions
x
and y
coordinates for setup pose AABB in SkeletonData
.Skin#getAttachments()
. Returns all attachments in the skin.Skin#getAttachments(int slotIndex)
. Returns all attachements in the skin for the given slot index.Skin#addSkin(Skin skin)
. Adds all attachments, bones, and skins from the specified skin to this skin.Skin#copySkin(Skin skin)
. Adds all attachments, bones, and skins from the specified skin to this skin. VertexAttachment
are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.Attachment#copy()
to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.MeshAttachment#newLinkedMesh()
, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.SkeletonViewer
can load a skeleton by specifying it as the first argument on the command line.Breaking changes
Slot:getAttachmentVertices()
to Slot#deform
..json
curve format and added more assumptions for omitted values, reducing the average size of JSON exports.Skin:addAttachment()
to Skin#setAttachment()
.VertexAttachment:applyDeform()
and replaced it with VertexAttachment#deformAttachment
. The attachment set on this field is used to decide if a DeformTimeline
should be applied to the attachment active on the slot to which the timeline is applied.inheritDeform
field, getter, and setter from MeshAttachment
..json
file format to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.Additions
x
and y
coordinates for setup pose AABB in SkeletonData
.Skin:getAttachments()
. Returns all attachments in the skin.Skin:getAttachments(slotIndex)
. Returns all attachements in the skin for the given slot index.Skin:addSkin(Skin skin)
. Adds all attachments, bones, and skins from the specified skin to this skin.Skin:copySkin(Skin skin)
. Adds all attachments, bones, and skins from the specified skin to this skin. VertexAttachment
are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.Attachment:copy()
to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.MeshAttachment:newLinkedMesh()
, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.Breaking changes
MixDirection.in/out
to MixDirection.mixIn/mixOut
as it was crashing a JS compressor.Slot#getAttachmentVertices()
to Slot#getDeform()
..json
curve format and added more assumptions for omitted values, reducing the average size of JSON exports.Skin#addAttachment()
to Skin#setAttachment()
.VertexAttachment#applyDeform()
and replaced it with VertexAttachment#deformAttachment
. The attachment set on this field is used to decide if a DeformTimeline
should be applied to the attachment active on the slot to which the timeline is applied.inheritDeform
field, getter, and setter from MeshAttachment
..skel
binary format, added a string table. References to strings in the data resolve to this string table, reducing storage size of binary files considerably..json
and .skel
file formats to accomodate the new feature and file size optimiations. Old projects must be exported with Spine 3.8.20+ to be compatible with the 3.8 Spine runtimes.Additions
AssetManager#loadBinary()
. AssetManager#get()
will return a Uint8Array
for such assets.SkeletonBinary
. Parses a Uint8Array
.x
and y
coordinates for setup pose AABB in SkeletonData
.Skin#getAttachments()
. Returns all attachments in the skin.Skin#getAttachments(slotIndex: number)
. Returns all attachements in the skin for the given slot index.Skin#addSkin(skin: Skin)
. Adds all attachments, bones, and skins from the specified skin to this skin.Skin#copySkin(skin: Skin)
. Adds all attachments, bones, and skins from the specified skin to this skin. VertexAttachment
are shallowly copied and will retain any parent mesh relationship. All other attachment types are deep copied.Attachment#copy()
to all attachment type implementations. This lets you deep copy an attachment to modify it independently from the original, i.e. when programmatically changing texture coordinates or mesh vertices.MeshAttachment#newLinkedMesh()
, creates a linked mesh linkted to either the original mesh, or the parent of the original mesh.AssetManager.setRawDataURI(path, data)
. Allows to embed data URIs for skeletons, atlases and atlas page images directly in the HTML/JS without needing to load it from a separate file.AssetManager.loadAll()
to allow Promise/async/await based waiting for completion of asset load. See the spine-canvas
examples.Skeleton.getBoundRect()
helper method to calculate the bouding rectangle of the current pose, returning the result as { x, y, width, height }
. Note that this method will create temporary objects which can add to garbage collection pressure.Input
can now take a partially defined implementation of InputListener
.SkeletonMesh
now takes an optional SkeletonMeshMaterialParametersCustomizer
function that allows you to modify the ShaderMaterialParameters
before the material is finalized. Use it to modify things like THREEJS' Material.depthTest
etc. See #1590.SpinePlayer#setAnimation()
can now be called directly to set the animation being displayed..skel
binary skeleton files by setting the SpinePlayerConfig#skelUrl
field instead of SpinePlayerConfig#jsonUrl
.SpinePlayerConfig#rawDataURIs
. Allows to embed data URIs for skeletons, atlases and atlas page images directly in the HTML/JS without needing to load it from a separate file. See the example for a demonstration.MixPose
is now called MixBlend
flipX/flipY
has been replaced with scaleX/scaleY
. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritanceTrackEntry#timeScale
. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194TrackEntry#setMixBlend(MixBlend.add)
on each track. To specify the blend percentage, set TrackEntry#alpha
. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.audioPath
, volume
and balance
fields on event (data).TrackEntry
has an additional field called holdPrevious
. It can be used to counter act a limitation of AnimationState
resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this forum thread.RaptorExample.as
SkeletonSprite.twoColorTint = true
. In this case the skeleton will use the TwoColorMeshStyle
, which internally uses a different vertex layout and shader. This means that skeletons with two color tinting enabled will break batching and hence increase the number of draw calls in your app.VertexEffect
and implementations JitterEffect
and SwirlEffect
. Allows you to modify vertices before they are submitted for drawing. See Starling changes.StarlingAtlasAttachmentLoader#getTexture()
, see https://github.com/EsotericSoftware/spine-runtimes/commit/ea7dbecb98edc74e439aa9ef90dcf6eed865f718Starling#newRegionAttachment
and Starling#newMeshAttachment
but delegated to the atlas.spAnimationState
and spTrackEntry
will now also be called if a track entry gets disposed as part of disposing an animation state.flipX/flipY
has been replaced with scaleX/scaleY
. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritanceTrackEntry#timeScale
. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194spMeshAttachment
has two new fields regionTextureWith
and regionTextureHeight
. These must be set in custom attachment loader. See AtlasAttachmentLoader
.spTransformConstraintData
.Animation#apply
and Timeline#apply`
now take enums MixPose
andMixDirection
instead of booleansspVertexEffect
and corresponding implementations spJitterVertexEffect
and spSwirlVertexEffect
. Create/dispose through the corresponding spXXXVertexEffect_create()/dispose()
functions. Set on framework/engine specific renderer.extension.h
are not prefixed with _sp
instead of just _
to avoid interference with other libraries.SP_API
macro. Every spine-c function is prefixed with this macro. By default, it is an empty string. Can be used to markup spine-c functions with e.g.
__declspec` when compiling to a dll or linking to that dll.void *userData
to spAnimationState
to be consumed in callbacks.spTrackEntry->mixBlend = SP_MIXBLEND_ADD)
on each track. To specify the blend percentage, set spTrackEntry->alpha
. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.audioPath
, volume
and balance
fields on event (data).spTrackEntry
has an additional field called holdPrevious
. It can be used to counter act a limitation of AnimationState
resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this forum thread.RaptorExample.m
.::update()
method of SkeletonRenderer
is now called, see https://github.com/EsotericSoftware/spine-runtimes/commit/f7bb98185236a6d8f35bfefc70afe4f31e9ec9d2spine-sfml.h
no longer defines SPINE_SHORT_NAMES
to avoid collisions with other APIs. See #1058.SkeletonDrawable
. Use SkeletonDrawable::setUsePremultipliedAlpha()
, see https://github.com/EsotericSoftware/spine-runtimes/commit/34086c1f41415309b2ecce86055f6656fcba2950.json
/.skel
parsers.spAtlasPage_setCustomTextureLoader()
which let's you do texture loading manually. Thanks @jareguo.SkeletonRenderer:setSlotsRange()
and SkeletonRenderer::createWithSkeleton()
. This allows you to split rendering of a skeleton up into multiple parts, and render other nodes in between. See SkeletonRendererSeparatorExample.cpp
for an example.Cocos2dAttachmentLoader
to be used when constructing an Atlas
. Used by default by SkeletonAnimation
and SkeletonRenderer
when creating instances via the createXXX
methods.spXXX
have been replaced with their C++ equivalents spine::XXX
in all public interfaces.new
of C++ classes from spine-cpp should contain (__FILE__, __LINE__)
. This allows the tracking of instantations and detection of memory leaks via the spine::DebugExtension
.SkeletonDrawable
. Use SkeletonDrawable::setUsePremultipliedAlpha()
, see https://github.com/EsotericSoftware/spine-runtimes/commit/34086c1f41415309b2ecce86055f6656fcba2950SkeletonRendererComponent
generates collision meshes by default.SkeletonRendererComponent
. Both ProceduralMeshComponent
and RuntimeMeshComponent
have a bug that generates a new PhysiX file every frame per component. Users are advised to add a separate collision shape to the root scene component of an actor instead.FMemory
allocator by default. This should fix issues on some consoles.RuntimeMeshComponent
, as its maintainance has seized, back to ProceduralMeshComponent
. Existing projects should just work. However, if you run into issues, you may have to remove the old SpineSkeletonRendererComponent
and add a new one to your existing actors.RuntimeMeshComponent
and reversal to ProceduralMeshComponent
, two color tinting is currently not supported. ProceduralMeshComponent
does not support enough vertex attributes for us to encode the second color in the vertex stream. You can remove the RuntimeMeshComponent/
directory from your plugins directory and remove the component from any build.cs
files that may reference it.spXXX
have been replaced with their C++ equivalents spine::XXX
in all public interfaces.new
of C++ classes from spine-cpp should contain (__FILE__, __LINE__)
. This allows the tracking of instantations and detection of memory leaks via the spine::DebugExtension
.spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/SpinePlugin.build.cs
file on how to compile in 4.20 with the latest UBT API changes.UBoneDriverComponent
and UBoneFollowerComponent
are now USceneComponent
instead of UActorComponent
. They either update only themselves, or also the owning UActor
, depending on whether the new flag UseComponentTransform
is set. See https://github.com/EsotericSoftware/spine-runtimes/pull/1175SpineSkeletonComponent
and UTrackEntry
. These allow you to query these objects by name in both C++ and blueprints.Preview Animation
and Preview Skin
properties to SpineSkeletonAnimationComponent
. Enter an animation or skin name to live-preview it in the editor. Enter an empty string to reset the animation or skin.flipX/flipY
has been replaced with scaleX/scaleY
. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritanceTrackEntry#timeScale
. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194TrackEntry#MixBlend = MixBlend.add
on each track. To specify the blend percentage, set TrackEntry#Alpha
. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.audioPath
, volume
and balance
fields on event (data).TrackEntry
has an additional field called holdPrevious
. It can be used to counter act a limitation of AnimationState
resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this forum thread..asmdef
file that defines these separately as their own assembly in Unity (Note: Spine .asmdef
files are currently deactivated to .txt
extension, see below). For projects not using assembly definition, you may delete the .asmdef
files. These assembly definitions will be ignored by older versions of Unity that don't support it..asmdef
files are now deactivated (using .txt
extension) by default This prevents problems when updating Spine through unitypackages, overwriting the Timeline reference entry in spine-unity.asmdef
(added automatically when enabling Unity 2019 Timeline support, see Timeline Support for Unity 2019
), causing compile errors. In case you want to enable the .asmdef
files, rename the files:
Spine/Runtime/spine-unity.txt
to Spine/Runtime/spine-unity.asmdef
and
Spine/Editor/spine-unity-editor.txt
to Spine/Editor/spine-unity-editor.asmdef
.SkeletonAnimator
has been renamed SkeletonMecanim
to make it more autocomplete-friendly and more obvious at human-glance. The .meta files and guids should remain intact so existing projects and prefabs should not break. However, user code needs to be updated to use SkeletonMecanim
.AtlasAsset
type has been renamed to SpineAtlasAsset
to signify that it specifically uses a Spine/libGDX atlas as its source. Serialization should be intact but user code will need to be updated to refer to existing atlases as SpineAtlasAsset
.SpineAtlasAsset
now has an abstract base class called SpineAtlasAsset
. This is the base class to derive when using alternate atlas sources. Existing SkeletonDataAsset field "atlasAssets" now have the "AtlasAssetBase" type. Serialization should be intact, but user code will need to be updated to refer to the atlas assets accordingly._STRAIGHT_ALPHA_INPUT
shader_feature, toggled as a checkbox in the Material's inspector. This allows the Material to use a non-premultiplied alpha/straight alpha input texture.Spine/Skeleton
Spine/Skeleton Tint Black
Spine/Skeleton Lit
Spine/Skeleton Tint
Spine/Skeleton Fill
Spine/SkeletonGraphic (Premultiply Alpha)
was renamed to Spine/SkeletonGraphic
Spine/SkeletonGraphic Tint Black (Premultiply Alpha)
was renamed to Spine/SkeletonGraphic Tint Black
Spine/Skeleton PMA Multiply
Spine/Skeleton PMA Screen
Spine/Straight Alpha/Skeleton Fill
Spine/Straight Alpha/Skeleton Tint
Premultiply alpha
enabled, it is important to configure Unity's texture import settings correctly. By default, you will now receive warnings where texture settings are expected to cause incorrect rendering.sRGB (Color Texture)
shall be disabled when Generate Mip Maps
is enabled, otherwise you will receive white border outlines.Alpha Is Transparency
shall be disabled on Premultiply alpha
textures, otherwise you will receive light ghosting artifacts in transparent areas.Edit - Preferences - Spine
.Skeleton Animation
and Skeleton Mecanim
components now provide an additional Mask Interaction
field in the Inspector, covering identical functionality as Unity's built in Sprite Renderer
component:Mask Interaction
modes:None
- The sprite will not interact with the masking system. Default behavior.Visible Inside Mask
- The sprite will be visible only in areas where a mask is present.Visible Outside Mask
- The sprite will be visible only in areas where no mask is present.Automatically Generated Materials
When switching Mask Interaction
modes in the Inspector outside of Play mode, the required additional material assets are generated for the respective Stencil Compare
parameters - with file suffixes '_InsideMask'
and '_OutsideMask'
, placed in the same folder as the original materials. By default all generated materials are kept as references by the Skeleton Animation
component for switching at runtime.
These materials can be managed and optimized via the SkeletonAnimation
's Advanced
section:Clear
button you can clear the reference to unneeded materials,Delete
button the respective assets are deleted as well as references cleared. Note that other Skeleton Animation
GameObjects might still reference the materials, so use with caution!Set
button you can again assign a link to the respective materials to prepare them for runtime use. If the materials were not present or have been deleted, they are generated again based on the default materials.Mask Interaction
mode at runtime, the previously prepared materials are switched active automatically. When the respective materials have not been prepared, material copies of the default materials are created on the fly. Note that these materials are not shared between similar Skeleton Animation
GameObjects, so it is recommended to use the generated material assets where possible.Stencil Compare
parameter for further customization. This way you have maximum flexibility to use custom mechanisms to switch materials at runtime if you should ever need more than the three materials generated by Skeleton Animation
's Mask Interaction
parameter. Reference Stencil Compare
values are:CompareFunction.Disabled
for Mask Interaction - None
CompareFunction.LessEqual
for Mask Interaction - Visible Inside Mask
CompareFunction.Greater
for Mask Interaction - Visible Outside Mask
SkeletonGraphic
shaders 'Spine/SkeletonGraphic
' and 'Spine/SkeletonGraphic Tint Black
' now respect masking areas defined via Unity's RectMask2D
component.Edit - Preferences - Spine
and at Timeline Package Support
hit Enable
to automatically perform all necessary steps to activate the Timeline components.
This will automatically:SPINE_TIMELINE_PACKAGE_DOWNLOADED
for all platformsspine-unity.asmdef
file by adding the reference to the Unity Timeline library.Create 2D Hinge Chain
functionality at SkeletonUtilityBone
inspector, previously only Create 3D Hinge Chain
was available.Effect
to be used by SkeletonRenderer
IVertexEffect
to modify vertices of skeletons on the CPU. IVertexEffect
instances can be set on the SkeletonRenderer
. See example project.SkeletonDebugRenderer
MeshBatcher
of SkeletonRenderer accessible via a getter. Allows user to batch their own geometry together with skeleton meshes for maximum batching instead of using XNA SpriteBatcher.SkeletonRenderer
, added overloaded method Skeleton#updateWorldTransform(Bone)
, used for SkeletonAttachment
. You now MUST call this new method with the bone of the parent skeleton to which the child skeleton is attached. See SkeletonAttachmentTest
for and example.MixPose
is now called MixBlend
.flipX/flipY
has been replaced with scaleX/scaleY
. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritanceTrackEntry#timeScale
. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194EventData#audioPath
field. This field contains the file name of the audio file used for the event.TrackEntry#setMixBlend(MixBlend.add)
on each track. To specify the blend percentage, set TrackEntry#alpha
. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.audioPath
, volume
and balance
fields on event (data).TrackEntry
has an additional field called holdPrevious
. It can be used to counter act a limitation of AnimationState
resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this forum thread.VertexEffect
interface, instances of which can be set on SkeletonRenderer
. Allows to modify vertices before submitting them to GPU. See SwirlEffect
, JitterEffect
and VertexEffectTest
.TwoColorPolygonBatch
implements the Batch
interface, allowing to the be used with other libGDX classes that require a batcher for drawing, potentially improving performance. See https://github.com/EsotericSoftware/spine-runtimes/commit/a46b3d1d0c135d51f9bef9ca17a5f8e5dda69927SkeletonDrawable
to render skeletons in scene2d UI https://github.com/EsotericSoftware/spine-runtimes/commit/b93686c185e2c9d5466969a8e07eee573ebe4b97flipX/flipY
has been replaced with scaleX/scaleY
. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritanceTrackEntry#timeScale
. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194JitterEffect
and SwirlEffect
and support for vertex effects in Corona and LoveTrackEntry:setMixBlend(MixBlend.add)
on each track. To specify the blend percentage, set TrackEntry.alpha
. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion.audioPath
, volume
and balance
fields on event (data).TrackEntry
has an additional field called holdPrevious
. It can be used to counter act a limitation of AnimationState
resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this forum thread.Skeleton.vertexEffect
. See main.lua
for an example.SkeletonRenderer.vertexEffect
. See main.lua
for an exampleflipX/flipY
has been replaced with scaleX/scaleY
. This cleans up applying transforms and is more powerful. Allows scaling a whole skeleton which has bones that disallow scale inheritanceTrackEntry#timeScale
. See https://github.com/EsotericSoftware/spine-runtimes/issues/1194AssetManager.loadTextureAtlas
. Instead of loading the .atlas
and corresponding image files manually, you can simply specify the location of the .atlas
file and AssetManager will load the atlas and all its images automatically. AssetManager.get("atlasname.atlas")
will then return an instance of spine.TextureAtlas
.TrackEntry#setMixBlend(MixBlend.add)
on each track. To specify the blend percentage, set TrackEntry#alpha
. See http://esotericsoftware.com/forum/morph-target-track-animation-mix-mode-9459 for a discussion. See https://github.com/EsotericSoftware/spine-runtimes/blob/f045d221836fa56191ccda73dd42ae884d4731b8/spine-ts/webgl/tests/test-additive-animation-blending.html for an example.audioPath
, volume
and balance
fields on event (data).TrackEntry
has an additional field called holdPrevious
. It can be used to counter act a limitation of AnimationState
resulting in "dipping" of parts of the animation. For a full discussion of the problem and the solution we've implemented, see this forum thread.AssetManager#setRawDataURI(path, data)
. Allows to set raw data URIs for a specific path, which in turn enables embedding assets into JavaScript/HTML.PolygonBatcher
will now disable CULL_FACE
and restore the state as it was before rendering.VertexEffect
interface, instances of which can be set on SkeletonRenderer
. Allows to modify vertices before submitting them to GPU. See SwirlEffect
, JitterEffect
, and the example which allows to set effects.slotRangeStart
and slotRangeEnd
parameters to SkeletonRenderer#draw
and SceneRenderer#drawSkeleton
. This allows you to render only a range of slots in the draw order. See spine-ts/webgl/tests/test-slot-range.html
for an example.SceneRenderer#drawTextureUV()
, allowing to draw a texture with manually specified texture coordinates.SceneRenderer
.VertexEffect
interface, instances of which can be set on SkeletonMesh
. Allows to modify vertices before submitting them to GPU. See SwirlEffect
, JitterEffect
.atlasContent
, atlasPagesContent
, and jsonContent
to WidgetConfiguration
allowing you to directly pass the contents of the .atlas
, atlas page .png
files, and the .json
file without having to do a request. See README.md
and the example for details.SpineWidget.setAnimation()
now takes an additional optional parameter for callbacks when animations are completed/interrupted/etc.Breaking changes
Bone.worldToLocalRotationX
and Bone.worldToLocalRotationY
. Replaced by Bone.worldToLocalRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).Bone
fields _a
, _b
, _c
, _d
, _worldX
and _worldY
public, removed underscore prefix.VertexAttachment.computeWorldVertices
overload, changed VertexAttachment.computeWorldVertices2
to VertexAttachment.computeWorldVertices
, added stride
parameter.RegionAttachment.vertices
field. The vertices array is provided to RegionAttachment.computeWorldVertices
by the API user now.RegionAttachment.updateWorldVertices
, added RegionAttachment.computeWorldVertices
. The new method now computes the x/y positions of the 4 vertices of the corner and places them in the provided worldVertices
array, starting at offset
, then moving by stride
array elements when advancing to the next vertex. This allows to directly compose the vertex buffer and avoids a copy. The computation of the full vertices, including vertex colors and texture coordinates, is now done by the backend's respective renderer.r
, g
, b
, a
fields with instances of new Color
class in RegionAttachment
, MeshAttachment
, Skeleton
, SkeletonData
, Slot
and SlotData
.Additions
Skeleton.getBounds
from reference implementation.TransformConstraintData
Bone.localToWorldRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).TwoColorTimeline
and additional fields on Slot
and SlotData
.PointAttachment
, additional method newPointAttachment
in AttachmentLoader
interface.ClippingAttachment
, additional method newClippingAttachment
in AttachmentLoader
interface.AnimationState#apply
returns boolean indicating if any timeline was applied or not.Animation#apply
and Timeline#apply`
now take enums MixPose
andMixDirection
instead of booleansVertexEffect
and implementations JitterEffect
and SwirlEffect
. Allows you to modify vertices before they are submitted for drawing. See Starling changes.RaptorExample.as
SkeletonSprite.twoColorTint = true
. In this case the skeleton will use the TwoColorMeshStyle
, which internally uses a different vertex layout and shader. This means that skeletons with two color tinting enabled will break batching and hence increase the number of draw calls in your app.spVertexAttachment_computeWorldVertices
and spRegionAttachment_computeWorldVerticeS
now take new parameters to make it possible to directly output the calculated vertex positions to a vertex buffer. Removes the need for additional copies in the backends' respective renderers.spBoundingBoxAttachment_computeWorldVertices
, superseded by spVertexAttachment_computeWorldVertices
.spPathAttachment_computeWorldVertices
and spPathAttachment_computeWorldVertices1
, superseded by spVertexAttachment_computeWorldVertices
.sp_MeshAttachment_computeWorldVertices
, superseded by spVertexAttachment_computeWorldVertices
.spBone_worldToLocalRotationX
and spBone_worldToLocalRotationY
. Replaced by spBone_worldToLocalRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).r
, g
, b
, a
fields with instances of new spColor
struct in spRegionAttachment
, spMeshAttachment
, spSkeleton
, spSkeletonData
, spSlot
and spSlotData
.spVertexIndex
from public API.spAnimationState
or spTrackEntry
will now be also called in case a track entry is disposed as part of dispoing the spAnimationState
.spTransformConstraintData
.spPointAttachment
, additional method spAtlasAttachmentLoadeR_newPointAttachment
.TransformConstraintData
spBone_localToWorldRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).spTwoColorTimeline
and additional fields on spSlot
and spSlotData
.userData
field to spTrackEntry
, so users can expose data in spAnimationState
callbacks.Array.h/.c
spClippingAttachment
and respective enum.spSkeletonClipper
and spTriangulator
, used to implement software clipping of attachments.AnimationState#apply
returns boolean indicating if any timeline was applied or not.Animation#apply
and Timeline#apply`
now take enums MixPose
andMixDirection
instead of booleansspVertexEffect
and corresponding implementations spJitterVertexEffect
and spSwirlVertexEffect
. Create/dispose through the corresponding spXXXVertexEffect_create()/dispose()
functions. Set on framework/engine specific renderer. See changes for spine-c based frameworks/engines below.extension.h
are not prefixed with _sp
instead of just _
to avoid interference with other libraries.SP_API
macro. Every spine-c function is prefixed with this macro. By default, it is an empty string. Can be used to markup spine-c functions with e.g.
__declspec` when compiling to a dll or linking to that dll.SkeletonRenderer
, resulting in 15% performance increase for large numbers of skeletons being rendered per frame.SkeletonRenderer
/SkeletonAnimation
instance. Use SkeletonRenderer::setTwoColorTint()
. Note that two color tinting requires the use of a non-standard shader and vertex format. This means that skeletons rendered with two color tinting will break batching. However, skeletons with two color tinting enabled and rendered after each other will be batched.SkeletonRenderer::setDebugMeshesEnabled()
.RaptorExample.cpp
.spAtlasPage_setCustomTextureLoader()
which let's you do texture loading manually. Thanks @jareguo.SkeletonRenderer:setSlotsRange()
and SkeletonRenderer::createWithSkeleton()
. This allows you to split rendering of a skeleton up into multiple parts, and render other nodes in between. See SkeletonRendererSeparatorExample.cpp
for an example.SkeletonRenderer/SkeletonAnimation.twoColorTint = true
. Note that two color tinted skeletons do not batch with other nodes.SkeletonDrawable
.Color
. This allows to set the tint color of the skeleton in the editor, C++ and Blueprints. Under the hood, the spSkeleton->color
will be set on every tick of the renderer component.spine-ue4\Plugins\
to your project as well!Breaking changes
MeshAttachment.parentMesh
is now a private field to enforce using the .ParentMesh
setter property in external code. The MeshAttachment.ParentMesh
property is an appropriate replacement wherever .parentMesh
was used.Skeleton.GetBounds
takes a scratch array as input so it doesn't have to allocate a new array on each invocation itself. Reduces GC activity.Bone.WorldToLocalRotationX
and Bone.WorldToLocalRotationY
. Replaced by Bone.WorldToLocalRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).stride
parameter to VertexAttachment.ComputeWorldVertices
.RegionAttachment.Vertices
field. The vertices array is provided to RegionAttachment.ComputeWorldVertices
by the API user now.RegionAttachment.UpdateWorldVertices
, added RegionAttachment.ComputeWorldVertices
. The new method now computes the x/y positions of the 4 vertices of the corner and places them in the provided worldVertices
array, starting at offset
, then moving by stride
array elements when advancing to the next vertex. This allows to directly compose the vertex buffer and avoids a copy. The computation of the full vertices, including vertex colors and texture coordinates, is now done by the backend's respective renderer.Additions
TransformConstraintData
Bone.localToWorldRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).TwoColorTimeline
and additional fields on Slot
and SlotData
.PointAttachment
, additional method NewPointAttachment
in AttachmentLoader
interface.ClippingAttachment
, additional method NewClippingAttachment
in AttachmentLoader
interface.SkeletonClipper
and Triangulator
, used to implement software clipping of attachments.AnimationState.Apply
returns a bool indicating if any timeline was applied or not.Animation.Apply
and Timeline.Apply`
now take enums MixPose
andMixDirection
instead of bools.Spine/Skeleton Tint Black
shader, or your own shader that treats the UV2 and UV3 streams similarly.Spine/SkeletonGraphic Tint Black
(or the bundled SkeletonGraphicTintBlack material) or your own shader that uses UV2 and UV3 streams similarly. Additional Shader Channels TexCoord1 and TexCoord2 will need to be enabled from the Canvas component's inspector. These correspond to UV2 and UV3.ClippingAttachment
s when using on large numbers of skeletons.initialFlipX
and initialFlipY
fields which are also visible in the inspector under "Advanced...". It will allow you to set and preview a starting flip value for your skeleton component. This is applied immediately when the internal skeleton object is instantiated.[SpineIkConstraint]
[SpineTransformConstraint]
[SpinePathConstraint]
includeNone
optional parameter to specify if you want to include or exclude a none ("") value option in the dropdown menu. Default is includeNone:true
.Advanced...
foldout in the SkeletonAnimation inspector, or in SkeletonAnimation's right-click/context menu.AttachmentTools
methods can now accept a sourceMaterial
argument to copy material properties from.Append(Skin)
, RemoveAttachment
and Clear
have been added.Rigidbody
or Rigidbody2D
if it detects a collider of the appropriate type. Having a rigidbody on a moving transform with a collider fits better with the Unity physics systems and prevents excess calculations. It will not detect colliders on child objects so you have to add Rigidbody components manually accordingly.meshGenerator.VertexBuffer
or meshGenerator.ColorBuffer
to modify these before they get pushed into the UnityEngine.Mesh for rendering. This can be useful for non-shader vertex effects.AtasRegionAttacher
and SpriteAttacher
are now part of Sample Components
, to reflect that they are meant to be used as sample code rather than production. A few other sample components have also been added. New imports of the unitypackage Examples folder will see a "Legacy" folder comprised of old sample components that no longer contain the most up-to-date and recommended workflows, but are kept in case old setups used them for production.Spine/Skeleton Lit
shader was switched over to non-fixed-function code. It now no longer requires mesh normals and has fixed normals at the shader level.Spine.Unity.MeshGeneration
are now deprecated. All mesh-generating components now share the class Spine.Unity.MeshGenerator
defined in SpineMesh.cs
. MeshGenerator is a serializable class.SkeletonRenderer.renderMeshes
optimization is currently non-functional.SkeletonRenderer
. Please use shaders that have backface culling off.SkeletonGraphic
can now be accessed under SkeletonGraphic.MeshGenerator.settings
. This is visible in the SkeletonGraphic inspector as Advanced...
SkeletonAnimator
now uses a SkeletonAnimator.MecanimTranslator
class to translate an Animator's Mecanim State Machine into skeleton poses. This makes code reuse possible for a Mecanim version of SkeletonGraphic.SkeletonAnimator
autoreset
and the mixModes
array are now a part of SkeletonAnimator's MecanimTranslator .Translator
. autoReset
is set to true
by default. Old prefabs and scene objects with Skeleton Animator may no longer have correct values set.RegionBatcher
and SkeletonRegionRenderer
, renamed SkeletonMeshRenderer
to SkeletonRenderer
SpineEffect.fx
file to your content project, then load it via var effect = Content.Load<Effect>("SpineEffect");
, and set it on the SkeletonRenderer
. See the example project for code.Effect
to be used by SkeletonRenderer
IVertexEffect
to modify vertices of skeletons on the CPU. IVertexEffect
instances can be set on the SkeletonRenderer
. See example project.SkeletonDebugRenderer
MeshBatcher
of SkeletonRenderer accessible via a getter. Allows user to batch their own geometry together with skeleton meshes for maximum batching instead of using XNA SpriteBatcher.Breaking changes
Skeleton.getBounds
takes a scratch array as input so it doesn't have to allocate a new array on each invocation itself. Reduces GC activity.Bone.worldToLocalRotationX
and Bone.worldToLocalRotationY
. Replaced by Bone.worldToLocalRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).stride
parameter to VertexAttachment.computeWorldVertices
.RegionAttachment.vertices
field. The vertices array is provided to RegionAttachment.computeWorldVertices
by the API user now.RegionAttachment.updateWorldVertices
, added RegionAttachment.computeWorldVertices
. The new method now computes the x/y positions of the 4 vertices of the corner and places them in the provided worldVertices
array, starting at offset
, then moving by stride
array elements when advancing to the next vertex. This allows to directly compose the vertex buffer and avoids a copy. The computation of the full vertices, including vertex colors and texture coordinates, is now done by the backend's respective renderer.SkeletonRenderer
, added overloaded method Skeleton#updateWorldTransform(Bone), used for
SkeletonAttachment. You now MUST call this new method
with the bone of the parent skeleton to which the child skeleton is attached. See
SkeletonAttachmentTest` for and example.Additions
TransformConstraintData
Bone.localToWorldRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).TwoColorTimeline
and additional fields on Slot
and SlotData
.PointAttachment
, additional method newPointAttachment
in AttachmentLoader
interface.ClippingAttachment
, additional method newClippingAttachment
in AttachmentLoader
interface.SkeletonClipper
and Triangulator
, used to implement software clipping of attachments.AnimationState#apply
returns boolean indicating if any timeline was applied or not.Animation#apply
and Timeline#apply`
now take enums MixPose
andMixDirection
instead of booleansTwoColorPolygonBatch
together with SkeletonRenderer
SkeletonClipper
. Used automatically by SkeletonRenderer
. Does not work when using a SpriteBatch
with SkeletonRenderer
. Use PolygonSpriteBatch
or TwoColorPolygonBatch
instead.VertexEffect
interface, instances of which can be set on SkeletonRenderer
. Allows to modify vertices before submitting them to GPU. See SwirlEffect
, JitterEffect
and VertexEffectTest
.Bone:worldToLocalRotationX
and Bone:worldToLocalRotationY
. Replaced by Bone:worldToLocalRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).VertexAttachment:computeWorldVertices
now takes offsets and stride to allow compositing vertices directly in a vertex buffer to be send to the GPU. The compositing is now performed in the backends' respective renderers. This also affects the subclasses MeshAttachment
, BoundingBoxAttachment
and PathAttachment
.RegionAttachment:updateWorldVertices
, added RegionAttachment:computeWorldVertices
, which takes offsets and stride to allow compositing vertices directly in a vertex buffer to be send to the GPU. The compositing is now performed in the backends' respective renderers.MeshAttachment.worldVertices
field. Computation is now performed in each backends' respective renderer. The uv
coordinates are now stored in MeshAttachment.uvs
.RegionAttachment.vertices
field. Computation is now performed in each backends respective renderer. The uv
coordinates for each vertex are now stored in the RegionAttachment.uvs
field.Bone:localToWorldRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).TwoColorTimeline
and additional fields on Slot
and SlotData
.PointAttachment
, additional method newPointAttachment
in AttachmentLoader
interface.TransformConstraintData
ClippingAttachment
, additional method newClippingAttachment
in AttachmentLoader
interface.SkeletonClipper
and Triangulator
, used to implement software clipping of attachments.AnimationState#apply
returns boolean indicating if any timeline was applied or not.Animation#apply
and Timeline#apply`
now take enums MixPose
andMixDirection
instead of booleansJitterEffect
and SwirlEffect
and support for vertex effects in Corona and LoveSkeletonRenderer.new(true)
.Skeleton.vertexEffect
. See main.lua
for an example.SkeletonRenderer.vertexEffect
. See main.lua
for an exampleBreaking changes
Skeleton.getBounds
takes a scratch array as input so it doesn't have to allocate a new array on each invocation itself. Reduces GC activity.Bone.worldToLocalRotationX
and Bone.worldToLocalRotationY
. Replaced by Bone.worldToLocalRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).VertexAttachment.computeWorldVertices
overload, changed VertexAttachment.computeWorldVerticesWith
to VertexAttachment.computeWorldVertices
, added stride
parameter.RegionAttachment.vertices
field. The vertices array is provided to RegionAttachment.computeWorldVertices
by the API user now.RegionAttachment.updateWorldVertices
, added RegionAttachment.computeWorldVertices
. The new method now computes the x/y positions of the 4 vertices of the corner and places them in the provided worldVertices
array, starting at offset
, then moving by stride
array elements when advancing to the next vertex. This allows to directly compose the vertex buffer and avoids a copy. The computation of the full vertices, including vertex colors and texture coordinates, is now done by the backend's respective renderer.Additions
TransformConstraintData
Bone.localToWorldRotation
(rotation given relative to x-axis, counter-clockwise, in degrees).TwoColorTimeline
and additional fields on Slot
and SlotData
.PointAttachment
, additional method newPointAttachment
in AttachmentLoader
interface.ClippingAttachment
, additional method newClippingAttachment
in AttachmentLoader
interface.SkeletonClipper
and Triangulator
, used to implement software clipping of attachments.AnimationState#apply
returns boolean indicating if any timeline was applied or not.Animation#apply
and Timeline#apply`
now take enums MixPose
andMixDirection
instead of booleansAssetManager.loadTextureAtlas
. Instead of loading the .atlas
and corresponding image files manually, you can simply specify the location of the .atlas
file and AssetManager will load the atlas and all its images automatically. AssetManager.get("atlasname.atlas")
will then return an instance of spine.TextureAtlas
.Restorable
interface, implemented by any WebGL resource that needs restoration after a context loss. All WebGL resource classes (Shader
, Mesh
, GLTexture
) implement this interface.ManagedWebGLRenderingContext
. Handles setup of a WebGLRenderingContext
given a canvas element and restoration of WebGL resources (Shader
, Mesh
, GLTexture
) on WebGL context loss. WebGL resources register themselves with the ManagedWebGLRenderingContext
. If the context is informed of a context loss and restoration, the registered WebGL resources' restore()
method is called. The restore()
method implementation on each resource type will recreate the GPU side objects.WebGLRenderingContext
in the constructor now also allow a ManagedWebGLRenderingContext
. This ensures existing applications do not break.ManagedWebGLRenderingContext
, passing the canvas to the constructor. This will setup a WebGLRenderingContext
internally and manage context loss/restoration.ManagedWebGLRenderingContext
to the constructors of classes that you previously passed a WebGLRenderingContext
to (AssetManager
, GLTexture
, Mesh
, Shader
, PolygonBatcher
, SceneRenderer
, ShapeRenderer
, SkeletonRenderer
, SkeletonDebugRenderer
).DYNAMIC_DRAW
for vertex buffer objects and fixing bug that copied to much data to the GPU each frame in PolygonBatcher
/Mesh
.SceneRenderer
, SkeletonRenderer
and PolygonBatcher
. Note that you will need to use a shader created via Shader.newTwoColoredTexturedShader
shader with SkeletonRenderer
and PolygonBatcher
if two color tinting is enabled.VertexEffect
interface, instances of which can be set on SkeletonRenderer
. Allows to modify vertices before submitting them to GPU. See SwirlEffect
, JitterEffect
, and the example which allows to set effects.slotRangeStart
and slotRangeEnd
parameters to SkeletonRenderer#draw
and SceneRenderer#drawSkeleton
. This allows you to render only a range of slots in the draw order. See spine-ts/webgl/tests/test-slot-range.html
for an example.VertexEffect
interface, instances of which can be set on SkeletonMesh
. Allows to modify vertices before submitting them to GPU. See SwirlEffect
, JitterEffect
.atlasContent
, atlasPagesContent
, and jsonContent
to WidgetConfiguration
allowing you to directly pass the contents of the .atlas
, atlas page .png
files, and the .json
file without having to do a request. See README.md
and the example for details.SpineWidget.setAnimation()
now takes an additional optional parameter for callbacks when animations are completed/interrupted/etc.