From d8396435d307837ad2879b06032623497e895459 Mon Sep 17 00:00:00 2001 From: badlogic Date: Mon, 24 Oct 2022 14:31:26 +0200 Subject: [PATCH 1/2] [ue4] Closes #2172, check state before returning Spine::Skeleton --- .../Source/SpinePlugin/Public/SpineSkeletonComponent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonComponent.h b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonComponent.h index 43af74afb..de1294157 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonComponent.h +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Public/SpineSkeletonComponent.h @@ -53,7 +53,7 @@ public: UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Spine) USpineSkeletonDataAsset *SkeletonData; - spine::Skeleton *GetSkeleton() { return skeleton; }; + spine::Skeleton *GetSkeleton() { CheckState(); return skeleton; }; UFUNCTION(BlueprintPure, Category = "Components|Spine|Skeleton") void GetSkins(TArray &Skins); From ace19d93815f482eb3f6b2f009efee332c81d61f Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Thu, 27 Oct 2022 11:05:31 +0200 Subject: [PATCH 2/2] [unity] PMA textures now have sRGB (Color Texture) disabled by default to prevent border artifacts with mipmaps. Closes #2187. --- CHANGELOG.md | 1 + .../Editor/ImporterPresets/PMAPresetTemplate.png.meta | 2 +- .../spine-unity/Editor/ImporterPresets/PMATexturePreset.preset | 2 +- .../Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8dd85bd0..07dfabdf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -91,6 +91,7 @@ * Added Spine Preferences setting `Prefabs` - `Optimize Preview Meshes`. When enabled, Spine prefab preview meshes will be removed in a pre-build step to reduce build size. This increases build time as all prefabs in the project will be processed. Defaults to false to not slow down builds substantially every time. * Added Spine Preferences setting `Reload SkeletonData after Play`. When enabled, the shared `SkeletonData` of all skeletons in the active scene is reloaded (from the `.json` or `.skel.bytes` file) after exiting play-mode. You can disable this setting to avoid the reloading delay if you can ensure that there are no (accidental) modifications to the shared `SkeletonData` during play-mode (otherwise it would carry over its effect into subsequent plays). Defaults to `true` (the safe setting), which maintains existing behaviour. * Added `SkeletonAnimationMulti` sample component methods `SetActiveSkeleton(int index)` and getter property `SkeletonAnimations` to more easily apply changes at all SkeletonAnimation instances instead of only the active one. + * PMA textures now have `sRGB (Color Texture)` disabled by default, the preset template `PMATexturePreset.preset` has been adjusted accordingly. As PMA textures are only allowed with Gamma color space, `sRGB (Color Texture)` shall be disabled to prevent border artifacts when mipmaps are enabled. In Gamma color space having this setting disabled has no drawbacks, only benefits. * **Breaking changes** * Made `SkeletonGraphic.unscaledTime` parameter protected, use the new property `UnscaledTime` instead. diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMAPresetTemplate.png.meta b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMAPresetTemplate.png.meta index 8153700c4..c265f09ae 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMAPresetTemplate.png.meta +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMAPresetTemplate.png.meta @@ -8,7 +8,7 @@ TextureImporter: mipmaps: mipMapMode: 0 enableMipMap: 0 - sRGBTexture: 1 + sRGBTexture: 0 linearTexture: 0 fadeOut: 0 borderMipMap: 0 diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMATexturePreset.preset b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMATexturePreset.preset index f5d5a7333..ed43c6efd 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMATexturePreset.preset +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/ImporterPresets/PMATexturePreset.preset @@ -26,7 +26,7 @@ Preset: objectReference: {fileID: 0} - target: {fileID: 0} propertyPath: m_sRGBTexture - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 0} propertyPath: m_LinearTexture diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs index a79e861fd..7145e5f18 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs @@ -884,6 +884,7 @@ namespace Spine.Unity.Editor { return false; } + texImporter.sRGBTexture = false; // as PMA is the default, prevent any border issues that may arise when enabling mipmaps later. texImporter.textureCompression = TextureImporterCompression.Uncompressed; texImporter.alphaSource = TextureImporterAlphaSource.FromInput; texImporter.mipmapEnabled = false;