From 6d9dcaeb928c5b36d044688b07e4eee92d166954 Mon Sep 17 00:00:00 2001 From: badlogic Date: Wed, 15 Mar 2017 12:59:35 +0100 Subject: [PATCH] [ue4] Added Color property to SkeletonRendererComponent. The value of that property will be set on the underlying spSkeleton->color and allows tinting of the skeleton instance. --- .../SpinePlugin/Private/SpineSkeletonRendererComponent.cpp | 2 ++ .../Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp index 181cdab6d..4bc5bc5f5 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp @@ -71,6 +71,8 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick USpineSkeletonComponent* skeleton = Cast(owner->GetComponentByClass(skeletonClass)); if (skeleton && !skeleton->IsBeingDestroyed() && skeleton->GetSkeleton() && skeleton->Atlas) { + spColor_setFromFloats(&skeleton->GetSkeleton()->color, Color.R, Color.G, Color.B, Color.A); + if (atlasNormalBlendMaterials.Num() != skeleton->Atlas->atlasPages.Num()) { atlasNormalBlendMaterials.SetNum(0); pageToNormalBlendMaterial.Empty(); diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h index fbe631885..53ab642e9 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h @@ -64,6 +64,9 @@ public: UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite) FName TextureParameterName; + + UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite) + FLinearColor Color = FLinearColor(1, 1, 1, 1); protected: void UpdateMesh (spSkeleton* Skeleton);