Unreal Engine 4 quality of life improvements

March 7th, 2019

We've added some small but useful improvements to our spine-ue4 runtime. Let's have a look!

Skeleton data asset details in the viewport

When you import a Spine skeleton into your Unreal Engine 4 project, three types of assets are generated for you automatically: a skeleton data asset, a skeleton atlas asset, and one texture asset for each atlas page.

The skeleton data asset contains all the information for the bone hierarchy, slots, animations, and all other data making up skeleton. When you open a skeleton data asset in the Unreal Engine editor, you now get a list of all the bones, slots, animations, skins, and events.

This makes it easy to quickly see the names of all the parts of a skeleton you might want to interact with from inside blueprints or your C++ code. We've also made sure the string handling uses UTF-8 throughout, so Chinese, Japanese, or Korean text gets displayed properly.

Previewing animations and skins

While the details view of a skeleton data asset gives you an in-depth overview of a skeleton's components, previewing animations and skins directly in the viewport can make life even simpler!

The SpineSkeletonAnimationComponent has two additional properties called Preview Animation and Preview Skin. Enter the name of an animation or skin and the actor will preview the change.

If you want the animation to stop or you want to set the default skin, just clear the content in the respective property.

For the preview to work, you also need to make sure to enable the Realtime setting for the viewport.

The preview animation and skin do not affect the actor components when you run the level, they only work in the viewport while in editing mode.

You can find this additions in our latest 3.7 and 3.8-beta branches of the Spine Runtimes. See our guide on updating the spine-ue4 runtime in your project.

We hope that these additions to our spine-ue4 runtime will make your work in Unreal Engine easier!

Spine 3.8-beta released

February 27th, 2019

We are happy to announce the availability of Spine 3.8-beta! To start, the beta contains all the latest fixes from Spine 3.7, plus application-wide performance enhancements, font improvements, some small fixes, and a new welcome screen. Let's dive right into it!

Welcome screen

Until now, we've informed you about new features, bug fixes, and general Spine news via our blog, Twitter, and occasionally by email. This has been OK, but we want to do better! Our new welcome screen greets you at start-up and serves as your one-stop shop for all the latest Spine news.

welcome screen

The welcome screen is split into a few sections:

  • New Project and Open Project for quickly creating a new project or opening an existing one.
  • Recent is a shortcut to your recent and favorite project files and folders.
  • Examples shows the list of Spine example projects. Click one to open the project or go to the example page that describes how it was built in detail. This is a great way to improve your rigging!
  • News shows the latest blog posts and other news.
  • Tips gives you a short and sweet tip to help improve your Spine rigging and workflows. Keep your eye on this section because we'll be adding a lot more tips as time goes on!
  • Learn provides quick access to our user guides, forums, and other learning materials.
  • Changelog keeps you up to date with the fixes, changes, and additions to the very latest Spine version.

You can open and close the welcome screen at any time via the mail icon in Spine's title bar.

mail icon

When there's news, the icon will notify you!

mail icon new

If you just want to get to work, press the escape key or click the gray X in the upper right. This will close the welcome screen and load the last project you had open. If you want to skip showing the welcome screen at start-up, head over to the general settings:

We hope the welcome screen will make it easier for you to stay up to date with the latest Spine developments!

How to try the beta

Want to try out the latest beta? Easy!

beta version

  1. Open the Spine settings.
  2. Check the Beta updates checkbox.
  3. Make sure to set the Spine version to Latest.
  4. Restart Spine!

While we haven't made breaking runtime changes in the 3.8 Spine Ruintimes yet, you may not want to save your projects with the beta version -- read here for more information. Changing back to the non-beta version of Spine is as simple as unchecking the Beta updates checkbox and restarting Spine.

Up next

With the 3.7 release done and our new welcome screen released through our beta channel, we are now focusing our efforts on the oft requested curve editor. As usual, you will be able to try early versions of the curve editor in our beta releases.

Discuss this post on the Spine forum.

Unity SpriteMask and RectMask2D support

February 22nd, 2019

Animated Sprite Mask Demo

We are happy to announce support for Unity sprite masks and Unity UI rect masks in our spine-unity runtime!

A sprite mask can be used to either hide or reveal parts of a skeleton or group of skeletons based on a masking image. This feature is implemented for both the SkeletonAnimation and SkeletonMecanim components. It supports all shaders shipped with the spine-unity runtime out of the box.

A rect mask is a masking control similar to the sprite mask control. It can be used to restrict Unity UI SkeletonGraphic objects to a rectangular area with better performance versus using a masking image.

Sprite masks and Spine skeletons

The SkeletonAnimation and SkeletonMecanim components now provide an additional Mask Interaction field in the inspector, mirroring the same mask interaction modes available in Unity's built-in SpriteRenderer component:

Mask Interaction

The following mask interaction modes are supported:

  • 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 a mask is not present.

Automatically generated materials

When switching mask interaction modes in the inspector outside of Play mode, additional material assets are generated for the respective Stencil Compare parameters. These additional material assets use the file suffixes _InsideMask and _OutsideMask, and are placed in the same folder as the original materials.

Mask Interaction Generated Materials

By default, a Skeleton Animation component keeps references to all generated materials. This allows sharing the materials between many component instances and reduces overhead from generating materials on-the-fly at runtime. You can manage and optimize the generated materials via the Advanced section of the SkeletonAnimation component:

Mask Interaction Advanced Section

  • The Clear button lets you clear references to unneeded materials.
  • The Delete button lets you clear the reference to the material and delete the underlying asset. Note that other SkeletonAnimation components on other game objects might still reference the materials. Use with caution!
  • The Set button lets you reassign a link to the respective material to prepare them for runtime use. If the material is not present or has been deleted, it is generated again based on the default material.

When changing the Mask Interaction mode at runtime, the component will use the pregenerated materials if available. When these pregenerated materials can not be found, for example because they were deleted via the Advanced section, copies of the default materials are created on-the-fly. These materials are not shared between Skeleton Animation components and can incur overhead when generated frequently on-the-fly at runtime. Prefer to use the pregenerated masking materials when possible!

Stencil Compare shader parameters

Every shader shipped with our spine-unity runtime now exposes the Stencil Compare parameter for further customization. This gives maximum flexibility to customize material management at runtime and lets you create more material variations than the three variations the runtime itself supports.

Shader Stencil Parameter

The available 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.

Unity UI - Rect masks and SkeletonGraphic

The shaders used by SkeletonGraphic now support Unity's RectMask2D component. A rect mask can be used to restrict SkeletonGraphic child elements to the rectangle of the parent element.

Mask Interaction

In the example above, each of the three SkeletonGraphic objects has a parent with a RectMask2D component to constrain it to a rectangular area. RectMask2D is more limited than the standard mask control, but gives better performance.

We hope that these additions to our spine-unity runtime let you create even more visually impressive games and apps. Share your thoughts on the Spine forum.