Hey everyone
I'm trying to make a tool that automatically creates the actor type I need and populates it with the spine atlas and skeleton data that is selected in the content browser. I have to do this over and over so making it faster would be really nice.
I set up an editor utility widget to run my script, which seems to work, but I can't save the object it creates:
I also get a crash if I try to open the object.
I guess I'll start pasting code in the hope that someone spots what the problem is.
I have SpinePlugin and SpineEditorPlugin in my module dependencies.
This is how I attach the spine components:
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Spine")
USpineSkeletonDataAsset * SpineSkeleton;
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Spine")
USpineAtlasAsset * SpineAtlas;
ASpineActor::ASpineActor(const class FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
PrimaryActorTick.bCanEverTick = true;
SpineSkeletonRenderer = NewObject<USpineSkeletonRendererComponent>(this, FName(TEXT("SpineSkeletonRenderer")));
SpineSkeletonAnimation = NewObject<USpineSkeletonAnimationComponent>(this, FName(TEXT("SpineSkeletonAnimation")));
SpineSkeletonAnimation->SkeletonData = SpineSkeleton;
SpineSkeletonAnimation->Atlas = SpineAtlas;
}
And this is the script I wrote to create and save the actor: https://pastebin.com/0nkkY0Bn