From 651416c620f13beb4ecf98de0a62c1466bc2afaf Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Sat, 15 Dec 2018 22:02:18 +0100 Subject: [PATCH 1/2] [csharp] Added missing default initialization of scaleX and scaleY parameters which caused incorrectly placed bones with PathConstraints in some cases. Fixes #1222 --- spine-csharp/src/Skeleton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-csharp/src/Skeleton.cs b/spine-csharp/src/Skeleton.cs index 70f776c39..601fb71ff 100644 --- a/spine-csharp/src/Skeleton.cs +++ b/spine-csharp/src/Skeleton.cs @@ -45,7 +45,7 @@ namespace Spine { internal Skin skin; internal float r = 1, g = 1, b = 1, a = 1; internal float time; - internal float scaleX, scaleY; + internal float scaleX = 1, scaleY = 1; internal float x, y; public SkeletonData Data { get { return data; } } From 6bea3e8e8fdaefbac440a1dee05e3a788b3c19d4 Mon Sep 17 00:00:00 2001 From: soctty Date: Mon, 17 Dec 2018 08:05:53 -0600 Subject: [PATCH 2/2] Expose Dynamic Material Instances (#1225) Moved atlasXBlendMaterials arrays to public namespace for accessibility at runtime. See also: https://github.com/EsotericSoftware/spine-runtimes/issues/1210 --- .../Public/SpineSkeletonRendererComponent.h | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h index 6b5698084..f32f49c2a 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonRendererComponent.h @@ -47,6 +47,7 @@ public: virtual void TickComponent (float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; + // Material Instance parents UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadOnly) UMaterialInterface* NormalBlendMaterial; @@ -59,6 +60,23 @@ public: UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadOnly) UMaterialInterface* ScreenBlendMaterial; + // Need to hold on to the dynamic instances, or the GC will kill us while updating them + UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite) + TArray atlasNormalBlendMaterials; + TMap pageToNormalBlendMaterial; + + UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite) + TArray atlasAdditiveBlendMaterials; + TMap pageToAdditiveBlendMaterial; + + UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite) + TArray atlasMultiplyBlendMaterials; + TMap pageToMultiplyBlendMaterial; + + UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite) + TArray atlasScreenBlendMaterials; + TMap pageToScreenBlendMaterial; + UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite) float DepthOffset = 0.1f; @@ -68,9 +86,9 @@ public: UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite) FLinearColor Color = FLinearColor(1, 1, 1, 1); - /** Whether to generate collision geometry for the skeleton, or not. */ - UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite) - bool bCreateCollision; + /** Whether to generate collision geometry for the skeleton, or not. */ + UPROPERTY(Category = Spine, EditAnywhere, BlueprintReadWrite) + bool bCreateCollision; virtual void FinishDestroy() override; @@ -79,23 +97,6 @@ protected: void Flush (int &Idx, TArray &Vertices, TArray &Indices, TArray &Uvs, TArray &Colors, TArray &Colors2, UMaterialInstanceDynamic* Material); - // Need to hold on to the dynamic instances, or the GC will kill us while updating them - UPROPERTY() - TArray atlasNormalBlendMaterials; - TMap pageToNormalBlendMaterial; - - UPROPERTY() - TArray atlasAdditiveBlendMaterials; - TMap pageToAdditiveBlendMaterial; - - UPROPERTY() - TArray atlasMultiplyBlendMaterials; - TMap pageToMultiplyBlendMaterial; - - UPROPERTY() - TArray atlasScreenBlendMaterials; - TMap pageToScreenBlendMaterial; - spine::Vector worldVertices; spine::SkeletonClipping clipper; };