From ba02df87bda315f4706faff42e2e65485da8d7f0 Mon Sep 17 00:00:00 2001 From: pharan Date: Mon, 16 Oct 2017 21:42:39 +0800 Subject: [PATCH 1/3] [unity] GetRepackedAttachments --- .../AttachmentTools/AttachmentTools.cs | 112 +++++++++++++++--- 1 file changed, 97 insertions(+), 15 deletions(-) diff --git a/spine-unity/Assets/spine-unity/Modules/AttachmentTools/AttachmentTools.cs b/spine-unity/Assets/spine-unity/Modules/AttachmentTools/AttachmentTools.cs index ab5d73d0b..cc92143e1 100644 --- a/spine-unity/Assets/spine-unity/Modules/AttachmentTools/AttachmentTools.cs +++ b/spine-unity/Assets/spine-unity/Modules/AttachmentTools/AttachmentTools.cs @@ -129,7 +129,7 @@ namespace Spine.Unity.Modules.AttachmentTools { /// /// Creates a Spine.AtlasRegion that uses a premultiplied alpha duplicate texture of the Sprite's texture data. Returns a RegionAttachment that uses it. Use this if you plan to use a premultiply alpha shader such as "Spine/Skeleton" - public static RegionAttachment ToRegionAttachmentPMAClone (this Sprite sprite, Shader shader, TextureFormat textureFormat = SpriteAtlasRegionExtensions.SpineTextureFormat, bool mipmaps = SpriteAtlasRegionExtensions.UseMipMaps, Material materialPropertySource = null) { + public static RegionAttachment ToRegionAttachmentPMAClone (this Sprite sprite, Shader shader, TextureFormat textureFormat = AtlasUtilities.SpineTextureFormat, bool mipmaps = AtlasUtilities.UseMipMaps, Material materialPropertySource = null) { if (sprite == null) throw new System.ArgumentNullException("sprite"); if (shader == null) throw new System.ArgumentNullException("shader"); var region = sprite.ToAtlasRegionPMAClone(shader, textureFormat, mipmaps, materialPropertySource); @@ -137,7 +137,7 @@ namespace Spine.Unity.Modules.AttachmentTools { return region.ToRegionAttachment(sprite.name, unitsPerPixel); } - public static RegionAttachment ToRegionAttachmentPMAClone (this Sprite sprite, Material materialPropertySource, TextureFormat textureFormat = SpriteAtlasRegionExtensions.SpineTextureFormat, bool mipmaps = SpriteAtlasRegionExtensions.UseMipMaps) { + public static RegionAttachment ToRegionAttachmentPMAClone (this Sprite sprite, Material materialPropertySource, TextureFormat textureFormat = AtlasUtilities.SpineTextureFormat, bool mipmaps = AtlasUtilities.UseMipMaps) { return sprite.ToRegionAttachmentPMAClone(materialPropertySource.shader, textureFormat, mipmaps, materialPropertySource); } @@ -210,7 +210,7 @@ namespace Spine.Unity.Modules.AttachmentTools { #endregion } - public static class SpriteAtlasRegionExtensions { + public static class AtlasUtilities { internal const TextureFormat SpineTextureFormat = TextureFormat.RGBA32; internal const float DefaultMipmapBias = -0.5f; internal const bool UseMipMaps = false; @@ -395,16 +395,98 @@ namespace Spine.Unity.Modules.AttachmentTools { #region Runtime Repacking /// - /// Creates and populates a duplicate skin with cloned attachments that are backed by a new packed texture atlas comprised of all the regions from the original skin. - /// No Spine.Atlas object is created so there is no way to find AtlasRegions except through the Attachments using them. - public static Skin GetRepackedSkin (this Skin o, string newName, Material materialPropertySource, out Material m, out Texture2D t, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps) { - return GetRepackedSkin(o, newName, materialPropertySource.shader, out m, out t, maxAtlasSize, padding, textureFormat, mipmaps, materialPropertySource); + /// Fills the outputAttachments list with new attachment objects based on the attachments in sourceAttachments, but mapped to a new single texture using the same material. + /// The list of attachments to be repacked. + /// The List(Attachment) to populate with the newly created Attachment objects. + /// + /// May be null. If no Material property source is provided, no special + public static void GetRepackedAttachments (List sourceAttachments, List outputAttachments, Material materialPropertySource, out Material outputMaterial, out Texture2D outputTexture, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, string newAssetName = "Repacked Attachments") { + if (sourceAttachments == null) throw new System.ArgumentNullException("sourceAttachments"); + if (outputAttachments == null) throw new System.ArgumentNullException("outputAttachments"); + + // Use these to detect and use shared regions. + var existingRegions = new Dictionary(); + var regionIndexes = new List(); + var texturesToPack = new List(); + var originalRegions = new List(); + + outputAttachments.Clear(); + outputAttachments.AddRange(sourceAttachments); + + int newRegionIndex = 0; + for (int i = 0, n = sourceAttachments.Count; i < n; i++) { + var originalAttachment = sourceAttachments[i]; + var newAttachment = originalAttachment.GetClone(true); + if (IsRenderable(newAttachment)) { + + var region = newAttachment.GetAtlasRegion(); + int existingIndex; + if (existingRegions.TryGetValue(region, out existingIndex)) { + regionIndexes.Add(existingIndex); // Store the region index for the eventual new attachment. + } else { + originalRegions.Add(region); + texturesToPack.Add(region.ToTexture()); // Add the texture to the PackTextures argument + existingRegions.Add(region, newRegionIndex); // Add the region to the dictionary of known regions + regionIndexes.Add(newRegionIndex); // Store the region index for the eventual new attachment. + newRegionIndex++; + } + + outputAttachments[i] = newAttachment; + } + } + + // Fill a new texture with the collected attachment textures. + var newTexture = new Texture2D(maxAtlasSize, maxAtlasSize, textureFormat, mipmaps); + newTexture.mipMapBias = AtlasUtilities.DefaultMipmapBias; + newTexture.anisoLevel = texturesToPack[0].anisoLevel; + newTexture.name = newAssetName; + var rects = newTexture.PackTextures(texturesToPack.ToArray(), padding, maxAtlasSize); + + // Rehydrate the repacked textures as a Material, Spine atlas and Spine.AtlasAttachments + Shader shader = materialPropertySource == null ? Shader.Find("Spine/Skeleton") : materialPropertySource.shader; + var newMaterial = new Material(shader); + if (materialPropertySource != null) { + newMaterial.CopyPropertiesFromMaterial(materialPropertySource); + newMaterial.shaderKeywords = materialPropertySource.shaderKeywords; + } + + newMaterial.name = newAssetName; + newMaterial.mainTexture = newTexture; + var page = newMaterial.ToSpineAtlasPage(); + page.name = newAssetName; + + var repackedRegions = new List(); + for (int i = 0, n = originalRegions.Count; i < n; i++) { + var oldRegion = originalRegions[i]; + var newRegion = UVRectToAtlasRegion(rects[i], oldRegion.name, page, oldRegion.offsetX, oldRegion.offsetY, oldRegion.rotate); + repackedRegions.Add(newRegion); + } + + // Map the cloned attachments to the repacked atlas. + for (int i = 0, n = outputAttachments.Count; i < n; i++) { + var a = outputAttachments[i]; + a.SetRegion(repackedRegions[regionIndexes[i]]); + } + + // Clean up. + foreach (var ttp in texturesToPack) + UnityEngine.Object.Destroy(ttp); + + outputTexture = newTexture; + outputMaterial = newMaterial; } /// /// Creates and populates a duplicate skin with cloned attachments that are backed by a new packed texture atlas comprised of all the regions from the original skin. /// No Spine.Atlas object is created so there is no way to find AtlasRegions except through the Attachments using them. - public static Skin GetRepackedSkin (this Skin o, string newName, Shader shader, out Material m, out Texture2D t, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, Material materialPropertySource = null) { + public static Skin GetRepackedSkin (this Skin o, string newName, Material materialPropertySource, out Material outputMaterial, out Texture2D outputTexture, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps) { + return GetRepackedSkin(o, newName, materialPropertySource.shader, out outputMaterial, out outputTexture, maxAtlasSize, padding, textureFormat, mipmaps, materialPropertySource); + } + + /// + /// Creates and populates a duplicate skin with cloned attachments that are backed by a new packed texture atlas comprised of all the regions from the original skin. + /// No Spine.Atlas object is created so there is no way to find AtlasRegions except through the Attachments using them. + public static Skin GetRepackedSkin (this Skin o, string newName, Shader shader, out Material outputMaterial, out Texture2D outputTexture, int maxAtlasSize = 1024, int padding = 2, TextureFormat textureFormat = SpineTextureFormat, bool mipmaps = UseMipMaps, Material materialPropertySource = null) { var skinAttachments = o.Attachments; var newSkin = new Skin(newName); @@ -441,7 +523,7 @@ namespace Spine.Unity.Modules.AttachmentTools { // Fill a new texture with the collected attachment textures. var newTexture = new Texture2D(maxAtlasSize, maxAtlasSize, textureFormat, mipmaps); - newTexture.mipMapBias = SpriteAtlasRegionExtensions.DefaultMipmapBias; + newTexture.mipMapBias = AtlasUtilities.DefaultMipmapBias; newTexture.anisoLevel = texturesToPack[0].anisoLevel; newTexture.name = newName; var rects = newTexture.PackTextures(texturesToPack.ToArray(), padding, maxAtlasSize); @@ -471,12 +553,12 @@ namespace Spine.Unity.Modules.AttachmentTools { a.SetRegion(repackedRegions[regionIndexes[i]]); } -// // Clean up -// foreach (var ttp in texturesToPack) -// UnityEngine.Object.Destroy(ttp); + // Clean up. + foreach (var ttp in texturesToPack) + UnityEngine.Object.Destroy(ttp); - t = newTexture; - m = newMaterial; + outputTexture = newTexture; + outputMaterial = newMaterial; return newSkin; } @@ -679,7 +761,7 @@ namespace Spine.Unity.Modules.AttachmentTools { } } - public static class SkinExtensions { + public static class SkinUtilities { #region Skeleton Skin Extensions /// From 4f119dbdc664e14ac6b95c64a8febd2472adcdf9 Mon Sep 17 00:00:00 2001 From: pharan Date: Mon, 16 Oct 2017 23:14:39 +0800 Subject: [PATCH 2/3] [unity] New Asset Icons. --- .../Assets/Gizmos/SkeletonDataAsset Icon.png | Bin 4424 -> 0 bytes .../Asset Types/AtlasAsset.cs.meta | 2 +- .../Asset Types/SkeletonDataAsset.cs.meta | 2 +- .../Editor/GUI/AtlasAsset Icon.png | Bin 0 -> 591 bytes .../Editor/GUI/AtlasAsset Icon.png.meta | 92 ++++++++++++++++++ .../Editor/GUI/SkeletonDataAsset Icon.png | Bin 0 -> 563 bytes .../GUI}/SkeletonDataAsset Icon.png.meta | 0 7 files changed, 94 insertions(+), 2 deletions(-) delete mode 100644 spine-unity/Assets/Gizmos/SkeletonDataAsset Icon.png create mode 100644 spine-unity/Assets/spine-unity/Editor/GUI/AtlasAsset Icon.png create mode 100644 spine-unity/Assets/spine-unity/Editor/GUI/AtlasAsset Icon.png.meta create mode 100644 spine-unity/Assets/spine-unity/Editor/GUI/SkeletonDataAsset Icon.png rename spine-unity/Assets/{Gizmos => spine-unity/Editor/GUI}/SkeletonDataAsset Icon.png.meta (100%) diff --git a/spine-unity/Assets/Gizmos/SkeletonDataAsset Icon.png b/spine-unity/Assets/Gizmos/SkeletonDataAsset Icon.png deleted file mode 100644 index 7fd5473c1474be392c6ddff639c8817ec49e2860..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4424 zcmY+GXHe5^v&R1kfzV6nBE1@Vl@eM)3DT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.meta index 079bc6a59..e6a492056 100644 --- a/spine-unity/Assets/spine-unity/Asset Types/AtlasAsset.cs.meta +++ b/spine-unity/Assets/spine-unity/Asset Types/AtlasAsset.cs.meta @@ -4,7 +4,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 3fc714a0dc1cf6b4b959e073fff2844e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/spine-unity/Assets/spine-unity/Asset Types/SkeletonDataAsset.cs.meta b/spine-unity/Assets/spine-unity/Asset Types/SkeletonDataAsset.cs.meta index 6c5a6e2fe..b5162ad53 100644 --- a/spine-unity/Assets/spine-unity/Asset Types/SkeletonDataAsset.cs.meta +++ b/spine-unity/Assets/spine-unity/Asset Types/SkeletonDataAsset.cs.meta @@ -4,7 +4,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 68defdbc95b30a74a9ad396bfc9a2277, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/spine-unity/Assets/spine-unity/Editor/GUI/AtlasAsset Icon.png b/spine-unity/Assets/spine-unity/Editor/GUI/AtlasAsset Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..47921306edaf93edd62efaa72259ea68a0f6bfe2 GIT binary patch literal 591 zcmV-V01=z9XQ4|785@T2hiwOw{-Y{NZ%rrDT-BYK^Q)i|} zWo9u6om9F`UB3Fyf2x%C9!jaJ0BYPK4EGVY&)k}(J5YPQvbs|qA0KLW9G_wN)yuow z-7Nr7vvG`8a?*)BH}%i|+?S>ng<8|oWG&n!gTtkDXs2;>^8|O+p5w>jCdgPcuAkxF z#tR|ldESHRqGN3v&UxuOO{jjq4DYBT&l=3s7vRYAm_wGedVs$Q$ngS;E8pgj-1vym zxC-LMQ#+3(4K^C2oSax3bPhngflxY}Md|A-r|;QnLUOB)R`nOAx1TVCN0nxP>j(G% zu!Q)*JIT3O=F+@h#vs30u z;`}WuXn$BhxLjSV*{ z2BQa>7|P>V!9-(1uE=j|I}<-EywQQ0V=_;sQ_6l1cruCzjjd~Nk^pY(9 zO+p)%PD+&a0kSNEF-GJCmqQsjdoG(7Pka=~6H;tuJ8$;^C~c)UO-_e;Ogb7ZUL@2- dpYtC91^@=(7Y@WPhkgJ6002ovPDHLkV1hZ_2u=V1 literal 0 HcmV?d00001 diff --git a/spine-unity/Assets/spine-unity/Editor/GUI/AtlasAsset Icon.png.meta b/spine-unity/Assets/spine-unity/Editor/GUI/AtlasAsset Icon.png.meta new file mode 100644 index 000000000..ef7eb691b --- /dev/null +++ b/spine-unity/Assets/spine-unity/Editor/GUI/AtlasAsset Icon.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 3fc714a0dc1cf6b4b959e073fff2844e +timeCreated: 1508165143 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + filterMode: -1 + aniso: 1 + mipBias: -1 + wrapMode: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 2 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: WebGL + maxTextureSize: 1024 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/spine-unity/Assets/spine-unity/Editor/GUI/SkeletonDataAsset Icon.png b/spine-unity/Assets/spine-unity/Editor/GUI/SkeletonDataAsset Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..61c0f18af2b46711609d9d0efdfc49a4239ea633 GIT binary patch literal 563 zcmV-30?hr1P)tDhHW zdejFb&D$HKoxk~8q)`7opNwwTp|92ynw&$Zn8#C;Ox-~%o+@e+5=_jptT(JI%HGB3TWmL$pb|faR#A~q+MuwR>oR|eNF zUO`cTgnJ{`*pHHlOmz$qBR#jh*^D zB?ejZCd%0X{{cx%yeJU>jZ;&{w>QfeRSyOmCMZ!^0$6Kdj1hV4a?Jlfr1TXsU4iDl zJ%1FBUe+rCd^hc)-DwYXnRHU^-$ Date: Wed, 18 Oct 2017 01:38:48 -0200 Subject: [PATCH 3/3] [unity] Fix SpineAttachment skinField param. * Fixed: skinField property from SpineAttachment attribute * [unity] Fix SpineAttachment skinField param. --- .../Assets/spine-unity/Editor/SpineAttributeDrawers.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spine-unity/Assets/spine-unity/Editor/SpineAttributeDrawers.cs b/spine-unity/Assets/spine-unity/Editor/SpineAttributeDrawers.cs index 505a31ae0..fd8c13d94 100644 --- a/spine-unity/Assets/spine-unity/Editor/SpineAttributeDrawers.cs +++ b/spine-unity/Assets/spine-unity/Editor/SpineAttributeDrawers.cs @@ -375,12 +375,10 @@ namespace Spine.Unity.Editor { ISkeletonComponent skeletonComponent = GetTargetSkeletonComponent(property); var validSkins = new List(); - - if (skeletonComponent != null && targetAttribute.currentSkinOnly) { Skin currentSkin = null; - var skinProperty = property.FindPropertyRelative(targetAttribute.skinField); + var skinProperty = property.FindBaseOrSiblingProperty(targetAttribute.skinField); if (skinProperty != null) currentSkin = skeletonComponent.Skeleton.Data.FindSkin(skinProperty.stringValue); currentSkin = currentSkin ?? skeletonComponent.Skeleton.Skin;