• Runtimes
  • Setting up Spine in Unreal Engine

Related Discussions
...

Hey all,
Unfortunately, I am having trouble setting up Spine-Unreal Engine integration with Spine Trial for the first time.
I would appreciate it if someone could help me set this up. Thank you!
Problem: My Unreal Engine looks as if Spine was never installed (or maybe I am unfamiliar with how to open Spine in Unreal Engine once it is installed)

Here is what I have done so far:
—I have downloaded the “spine-runtimes-3.8” folder from Github
—I have copied “Plugins” from the “spine-ue4” folder into “[MyProjectName]” folder
—I have copied the “/spine-cpp/spine-cpp” folder into “[MyProjectName/]Plugins/SpinePlugin/Source/SpinePlugin/Public”
—In “[MyProjectName]/Source/[MyProjectName]/[MyProjectName].Build.cs”, I added the following lines of code:

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "SpinePlugin", "ProceduralMeshComponent" });
PrivateDependencyModuleNames.AddRange(new string[] {  });

—I deleted the “Binaries” folder in “[MyProjectName]”, and then opened my project in Xcode and then clicked “Build”, which threw no errors.
—Then, I opened my Unreal Engine project in Unreal Engine, and my project just looked like it did before. There was no sign that Spine was integrated.

Thank you for your help!

EDIT: I want to set this up for testing with Blueprints and C++. Thanks!
EDIT: If it is relevant, I am using a Mac.

When you try to add the spine-ue4 runtime to an existing UE4 project, you need to make sure the Xcode project file is regenerated. You can do this by:

  1. Locating your project's .uproject file in the macOS Finder.
  2. Right click it
  3. Choose "Generate Xcode project"

Then just re-open the Xcode project and you should be good! To verify things worked, make sure the source files of the spine-ue4 runtimes you copied to your project show up in the file explorer in Xcode.

Hi badlogic,
Thanks for the reply/help! I did click "Generate Xcode Project".
You mention that the source files of the spine-ue4 need to show up in the file explorer in Xcode. Where should they up in the xcode project? Should they show up in Engine/UE4/Plugins? Should they show up in the Games folder? I am having trouble finding the runtimes in XCode and would like to know where to look. Thank you for your help!


Hi badlogic,
Also, I tried importing the hero-ess file into Unreal. I clicked "Import" in Unreal Engine and imported the .json object, but only the "hero-ess-data" asset was created, not .atlas file, not any .png files (which the link spine-ue4 Runtime Documentation: Importing into Unreal Engine says should occur.). Thus, I feel that I did not set this up correctly. Should I have put the Plugins folder inside the Content folder (or someplace else)?
Thanks for your help!

If you got the hero-ess-data asset, then you have installed the plugin correctly! Can you try to drag the .atlas file separately into the UE4 editor?

Thank you so much, badlogic!

I got it to work with your suggestion (of importing the .atlas file) and then I followed the Unreal directions (https://docs.unrealengine.com/en-US/Engine/Performance/Scalability/ScalabilityReference/index.html) and it worked well!
I have 2 more questions:

1) What is the URL for #include the SpineSkeletonAnimationComponent in C++? I tried the following, which did not work.
#include “[MyProjectName]/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonAnimationComponent.h”
2) I was able to get the character to show up in its blueprint window. I was also able to get the character to show up in the level’s viewport but only after pressing Play. Without pressing Play, you instead see the actor’s placeholder sphere. How do I get the character’s image to show up in the level’s viewport without having to press Play?

Thank you for your help!

Glad it worked!

  1. Our spine-ue4 example comes with an example CPP pawn that includes spine-ue4 headers, e.g. spine-runtimes/SpineboyCppPawn.cpp at 3.8. You need to make sure your project's ProjectName.Build.cs includes the SpinePlugin like here: spine-runtimes/SpineUE4.Build.cs at 3.8
  2. Make sure you have Realtime checked for your viewport. See spine-ue4 Runtime Documentation: Adding a Skeleton to a Level

Thank you, badlogic!
@1: Looks very helpful. It's been a busy week-I'll try implementing this when I have time this week. If I run into any trouble, I might reach out again.
@2: Worked like a charm. And thanks for the helpful link!
Thanks for your help and hope you have a great weekend!

Cool, have a great weekend too!

شهر واحد لاحقا

@1: It worked! Thank you!