• Runtimes
  • [ue4] Include SpineSkeletonComponent.h in Custom class

Hi everyone,

As it says in the subject, I would like to know how to include SpineSkeletonComponent.h into my custom class.

First, I tried to add

#include "SpineSkeletonComponent.h"

in my header file but when I compile in ue, I got this message :

MyFileName.h/i : fatal error C1083: cannot open include file?: 'SpineSkeletonComponent.h'?: No such file or directory

.
Then, I tried to add this

#include "../../../Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonComponent.h"

and I had this error

SpineSkeletonDataAsset.h(34) : fatal error C1083: cannot open include file?: 'spine/spine.h'?: No such file or directory

Does anyone know how to include the file?

Thanks in advance,
YohDono

Related Discussions
...
  • تم التحرير

Did you copy spine-c to the SpinePlugin folder as per the instructions? Could you show me the Build.cs file of your project?

Yes, I followed the steps given in the instructions. Everything else works.
Here is my Build.cs :

using UnrealBuildTool;

public class P1Client : ModuleRules
{
   public P1Client(TargetInfo Target)
   {
      PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });

  PrivateDependencyModuleNames.AddRange(new string[] {  });

  // Uncomment if you are using Slate UI
  // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
  
  // Uncomment if you are using online features
  // PrivateDependencyModuleNames.Add("OnlineSubsystem");

  // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
   }
}

Please add "SpinePlugin" to the PublicDependencyModuleNames.

I added and tried again to add my include, it still doesn't work but I have a new error message :

Error LINK : fatal error LNK1181: cannot open input file 'E:\P1Client\Plugins\SpinePlugin\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-SpinePlugin.lib'


Actually, soon as I add "SpinePlugin" into the Build.cs file, with or without my include, I got the same message

Error LINK : fatal error LNK1181: cannot open input file 'E:\P1Client\Plugins\SpinePlugin\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-SpinePlugin.lib'

6 أيام لاحقا

Terribly sorry for the late reply, I've missed your reply :/

I've added a quick Cpp example to the spine-ue4 runtime example. Here's what's required:

  1. In your project's Build.cs[/url|, make sure to add "SpinePlugin" to PublicDependencyModuleNames, and "SpinePlugin/Public" and "SpinePlugin/Classes" to PublicIncludePaths

  2. In the UE4 Editor, create a new C++ class, e.g. a Pawn.

  3. In your pawn's .h or .cpp include whatever Spine headers you need.

I've added a very simple pawn implementation that sets an animation on the USpineSkeletonAnimationComponent once the pawn comes to life. The new map Getting Started/06-cpp uses this pawn.

No problem, it's okay. Thanks for the answer.
I tried and it works now, thank you.

If I may, you should had this to your documentation for the beginners like me.

You are absolutely correct, I've added it to the documentation! Sorry for the troubles.