From ccc67ceed22b3b373bab150865b8e1c9d7e81c0b Mon Sep 17 00:00:00 2001 From: Jakub Lisinski Date: Fri, 22 Aug 2014 00:48:03 +0200 Subject: [PATCH 1/5] draw order aniamtion, slot color animation, event support --- .../Spine/Data/Animation/SpineAnimation.cs | 9 +- .../Data/Animation/SpineAnimationEvent.cs | 16 +- .../Editor/Model/Spine/Data/SpineData.cs | 1 + .../Scripts/Editor/SpineImporterWizard.cs | 9 +- .../Scripts/Editor/Util/SpineUtil.cs | 207 +++++++++++++++++- .../SharedScripts/Skin/SkinSlotAttachment.cs | 2 + 6 files changed, 213 insertions(+), 31 deletions(-) diff --git a/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/Animation/SpineAnimation.cs b/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/Animation/SpineAnimation.cs index 886d82e..0d66742 100644 --- a/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/Animation/SpineAnimation.cs +++ b/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/Animation/SpineAnimation.cs @@ -1,10 +1,11 @@ using System.Collections.Generic; +using LitJson; namespace UnitySpineImporter{ public class SpineAnimation { - public Dictionary bones; - public Dictionary slots; - public List draworder; - + public Dictionary< string, SpineBoneAnimation > bones; + public Dictionary< string, SpineSlotAnimation > slots; + public List< SpineDrawOrderAnimation > draworder; + public List< JsonData > events; } } \ No newline at end of file diff --git a/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/Animation/SpineAnimationEvent.cs b/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/Animation/SpineAnimationEvent.cs index 369587e..fe29fd6 100644 --- a/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/Animation/SpineAnimationEvent.cs +++ b/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/Animation/SpineAnimationEvent.cs @@ -1,15 +1,9 @@ -using UnityEngine; -using System.Collections; +using LitJson; +namespace UnitySpineImporter { + public class SpineAnimationEvent { + public double time; + public string name; -public class SpineAnimationEvent : MonoBehaviour { - // Use this for initialization - void Start () { - - } - - // Update is called once per frame - void Update () { - } } diff --git a/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/SpineData.cs b/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/SpineData.cs index 35a499a..8b39257 100644 --- a/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/SpineData.cs +++ b/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/SpineData.cs @@ -38,6 +38,7 @@ public static SpineData deserializeFromFile(string spineDataFilePath){ if (!File.Exists(spineDataFilePath)) throw new SpineDatatCreationException("provided file does not exists"); try{ + //KUBA!!!!! data = LitJson.JsonMapper.ToObject(File.ReadAllText(spineDataFilePath)); } catch (LitJson.JsonException e){ throw new SpineDatatCreationException("problem with parse json data \n"+e.Message); diff --git a/Assets/UnitySpineImporter/Scripts/Editor/SpineImporterWizard.cs b/Assets/UnitySpineImporter/Scripts/Editor/SpineImporterWizard.cs index 7ee95f4..bad17f8 100644 --- a/Assets/UnitySpineImporter/Scripts/Editor/SpineImporterWizard.cs +++ b/Assets/UnitySpineImporter/Scripts/Editor/SpineImporterWizard.cs @@ -56,15 +56,16 @@ void OnWizardCreate(){ Dictionary slotByName; List skins; AttachmentGOByNameBySlot attachmentGOByNameBySlot; + if (File.Exists(path)){ try{ SpineMultiatlas spineMultiAtlas = SpineMultiatlas.deserializeFromFile(atlasPath ); SpineData spineData = SpineData .deserializeFromFile(path); SpineUtil.updateImporters(spineMultiAtlas, directory, pixelsPerUnit, out spriteByName); - GameObject rootGO = SpineUtil.buildSceleton(name, spineData, pixelsPerUnit, out boneGOByName, out slotByName); + GameObject rootGO = SpineUtil.buildSceleton(name, spineData, pixelsPerUnit, zStep, out boneGOByName, out slotByName); rootGO.name = name; - SpineUtil.addAllAttahcmentsSlots(spineData, spriteByName, slotByName, zStep, pixelsPerUnit, out skins, out attachmentGOByNameBySlot); + SpineUtil.addAllAttahcmentsSlots(spineData, spriteByName, slotByName, pixelsPerUnit, out skins, out attachmentGOByNameBySlot); SkinController sk = SpineUtil.addSkinController(rootGO, spineData, skins, slotByName); if (animationImportType == AnimationImportType.MECANIM){ Animator animator = SpineUtil.addAnimator(rootGO); @@ -74,8 +75,8 @@ void OnWizardCreate(){ ModelImporterAnimationType modelImporterAnimationType = getModelImporterAnimationType(); if (spineData.animations !=null && spineData.animations.Count > 0) - SpineUtil.addAnimation(rootGO, directory, spineData, boneGOByName, attachmentGOByNameBySlot, - pixelsPerUnit, modelImporterAnimationType, updateResources); + SpineUtil.addAnimation(rootGO, directory, spineData, boneGOByName, slotByName, attachmentGOByNameBySlot, skins, + pixelsPerUnit, zStep, modelImporterAnimationType, updateResources ); sk.showDefaulSlots(); SpineUtil.buildPrefab(rootGO, directory, name); GameObject.DestroyImmediate(rootGO); diff --git a/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs b/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs index 121388e..8defa24 100644 --- a/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs +++ b/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs @@ -47,7 +47,7 @@ public static void buildPrefab(GameObject gameObject, string directory, string n } public static void builAvatarMask(GameObject gameObject, SpineData spineData, Animator animator, string directory, string name){ - Avatar avatar = AvatarBuilder.BuildGenericAvatar(gameObject,""); + UnityEngine.Avatar avatar = AvatarBuilder.BuildGenericAvatar(gameObject,""); animator.avatar = avatar; AvatarMask avatarMask = new AvatarMask(); string[] transofrmPaths = getTransformPaths(gameObject, spineData); @@ -211,7 +211,7 @@ public static void swap2Float(ref float float1, ref float float2){ float2 = tmp; } - public static GameObject buildSceleton(string name, SpineData data, int pixelsPerUnit, out Dictionary boneGOByName, out Dictionary slotByName){ + public static GameObject buildSceleton( string name, SpineData data, int pixelsPerUnit, float zStep, out Dictionary boneGOByName, out Dictionary slotByName ) { float ratio = 1.0f / (float)pixelsPerUnit; boneGOByName = new Dictionary(); slotByName = new Dictionary(); @@ -240,6 +240,8 @@ public static GameObject buildSceleton(string name, SpineData data, int pixelsPe GameObject go = new GameObject(getSlotGOName(spineSlot.name)); go.transform.parent = boneGOByName[spineSlot.bone].transform; resetLocalTRS(go); + int drawOrder = data.slotOrder[ spineSlot.name ]; + go.transform.localPosition = new Vector3( 0, 0, (- drawOrder ) * zStep ); Slot slot = new Slot(); slot.bone = spineSlot.bone; slot.name = spineSlot.name; @@ -261,7 +263,7 @@ public static void resetLocalTRS(GameObject go){ go.transform.localScale = Vector3.one; } - public static void addAllAttahcmentsSlots(SpineData spineData, SpritesByName spriteByName, Dictionary slotByName, float zStep, int pixelsPerUnit, out List skins, out AttachmentGOByNameBySlot attachmentGOByNameBySlot){ + public static void addAllAttahcmentsSlots(SpineData spineData, SpritesByName spriteByName, Dictionary slotByName, int pixelsPerUnit, out List skins, out AttachmentGOByNameBySlot attachmentGOByNameBySlot){ float ratio = 1.0f / (float) pixelsPerUnit; skins = new List(); attachmentGOByNameBySlot= new AttachmentGOByNameBySlot(); @@ -277,7 +279,7 @@ public static void addAllAttahcmentsSlots(SpineData spineData, SpritesByName spr GameObject slotGO = slotByName[slotName].gameObject; Slot slot = slotByName[slotName]; - + string spritePath = spineData.slotPathByName[ slotName ] + "/"; SkinSlot skinSlot = new SkinSlot(); @@ -285,7 +287,7 @@ public static void addAllAttahcmentsSlots(SpineData spineData, SpritesByName spr skinSlot.gameObject = slotGO; List attachmentList = new List(); foreach(KeyValuePair kvp3 in spineData.skins[skinName][slotName]){ - string attachmenName = kvp3.Key; + string attachmenName = kvp3.Key; SkinSlotAttachment attachment = new SkinSlotAttachment(); attachment.name = attachmenName; @@ -302,6 +304,7 @@ public static void addAllAttahcmentsSlots(SpineData spineData, SpritesByName spr if (isDefault){ parentGO = slotGO; spriteGO = new GameObject(fixedName); + spritePath += fixedName; Attachment a = new Attachment(attachmenName, AttachmentType.SINGLE_SPRITE, spriteGO); slot.addAttachment(a); } else { @@ -315,19 +318,21 @@ public static void addAllAttahcmentsSlots(SpineData spineData, SpritesByName spr a = new Attachment(attachmenName, AttachmentType.SKINED_SPRITE, attachmentGO); slot.addAttachment(a); } - + spritePath += fixedName + "/" + skinName; parentGO = a.gameObject; } attachment.gameObject = spriteGO; + attachment.ObPath = spritePath; spriteGO.transform.parent = parentGO.gameObject.transform; // - if (spineAttachment.type.Equals("region")){ SpriteRenderer sr = spriteGO.AddComponent(); sr.sprite = sprite; - spriteGO.transform.localPosition = getAttachmentPosition(spineAttachment, ratio,-( drawOrder * zStep)); + spriteGO.transform.localPosition = getAttachmentPosition(spineAttachment, ratio, 0); spriteGO.transform.localRotation = getAttachmentRotation(spineAttachment, spriteByName.rotatedSprites.Contains(sprite)); spriteGO.transform.localScale = getAttachmentScale(spineAttachment); + attachment.sprite = sr; } else if (spineAttachment.type.Equals("boundingbox")) { PolygonCollider2D collider = spriteGO.AddComponent(); resetLocalTRS(spriteGO); @@ -384,8 +389,11 @@ public static void addAnimation(GameObject rootGO, string rootDirectory, SpineData spineData, Dictionary boneGOByName, + Dictionary slotByName, AttachmentGOByNameBySlot attachmentGOByNameBySlot, + List skinList, int pixelsPerUnit, + float zStep, ModelImporterAnimationType modelImporterAnimationType, bool updateResources) { @@ -411,10 +419,12 @@ public static void addAnimation(GameObject rootGO, if (spineAnimation.bones!=null) addBoneAnimationToClip(animationClip,spineAnimation.bones, spineData, boneGOByName, ratio); if (spineAnimation.slots!=null) - addSlotAnimationToClip(animationClip, spineAnimation.slots, spineData, attachmentGOByNameBySlot); - if (spineAnimation.draworder!=null) - Debug.LogWarning("draworder animation implemented yet"); + addSlotAnimationToClip(animationClip, spineAnimation.slots, spineData, skinList, attachmentGOByNameBySlot); + if ( spineAnimation.events != null ) + AddEvents( animationClip, spineAnimation.events, animationName ); + if (spineAnimation.draworder!=null) + addDrawOrderAnimation( animationClip, spineAnimation.draworder, spineData, zStep, animationName, slotByName ); if (updateCurve){ EditorUtility.SetDirty(animationClip); @@ -434,6 +444,61 @@ public static void addAnimation(GameObject rootGO, } } + static void AddEvents( AnimationClip clip, + List< JsonData > events, + string animName ) + { + List< UnityEngine.AnimationEvent > unityEvents = new List( ); + foreach ( JsonData entry in events ) { + if ( !entry.IsObject ) Debug.LogError( "WTF JSON!! Event is not an Object??!!" ); + IDictionary entry_dict = entry as IDictionary; + + UnityEngine.AnimationEvent ev = new UnityEngine.AnimationEvent( ); + + if ( entry_dict.Contains( "name" ) ) ev.functionName = ( ( string ) entry[ "name" ] ); + else Debug.LogError( "WTF JSON!! Missing Name in event data: " + animName ); + + if ( entry_dict.Contains( "time" ) ) ev.time = getNumberData( entry[ "time" ], animName ); + else Debug.LogError( "WTF JSON!! Missing Time in event data: " + animName + " EVENT_NAME: " + ev.functionName ); + + bool ParamAdded = false; + if ( entry_dict.Contains( "int" ) ) { + ev.intParameter = ( int ) entry[ "int" ]; + ParamAdded = true; + } + + if ( entry_dict.Contains( "float" ) ) { + if ( ParamAdded ) Debug.LogError( "WTF JSON!! Unity Supports only one event parameter!!!! CLIP NAME: " + animName + " EVENT_NAME: " + entry.ToJson( ) ); + ev.floatParameter = getNumberData( entry[ "float" ], animName ); + ParamAdded = true; + } + + if ( entry_dict.Contains( "string" ) ) { + if ( ParamAdded ) Debug.LogError( "WTF JSON!! Unity Supports only one event parameter!!!! CLIP NAME: " + animName + " EVENT_NAME: " + entry.ToJson( ) ); + ev.stringParameter = ( string ) entry[ "string" ]; + } + + ev.messageOptions = SendMessageOptions.RequireReceiver; + + unityEvents.Add( ev ); + } + + AnimationUtility.SetAnimationEvents( clip, unityEvents.ToArray( ) ); + } + + static float getNumberData( JsonData data, string animName ) { + + if ( data.IsDouble ) + return ( float )( ( double )data ); + + if ( data.IsInt ) + return ( float )( ( int )data ); + + Debug.LogError( "WTF JSON!! Unrecognizable number format!!!! CLIP NAME: " + animName + " JsonData: " + data.ToJson( ) ); + + return 0.0f; + } + static void AddClipToLegacyAnimationComponent(GameObject rootGO, AnimationClip animationClip){ Animation animation = rootGO.GetComponent(); if (animation == null) @@ -456,9 +521,76 @@ public static string getFirstAttachmentName(SpineSlotAnimation spineSlotAnimatio return ""; } + public static void addDrawOrderAnimation( AnimationClip clip, + List orderAnimation, + SpineData spineData, + float zStep, + string animName, + Dictionary slotNameByName ) + { + string[] BaseSlotOrder = new string[ spineData.slotOrder.Count ]; + + Dictionary< string, AnimationCurve > Curvs = new Dictionary( ); + + foreach ( KeyValuePair p in spineData.slotOrder ) { + BaseSlotOrder[ p.Value ] = p.Key; + AnimationCurve Curv = new AnimationCurve(); + Keyframe keyFrame = new Keyframe( 0.0f, ( - p.Value ) * zStep ); + Curv.AddKey( keyFrame ); + Curvs[ p.Key ] = Curv; + } + + foreach ( SpineDrawOrderAnimation orderAnim in orderAnimation ) { + string[] NewSlotOrder = new string[ BaseSlotOrder.Length ]; + string[] BaseOrder_Copy = BaseSlotOrder.Clone( ) as string[]; + for ( int i = 0; i != orderAnim.offsets.Length; i++ ) { + SpineDrawOrderAnimationSlot slot = orderAnim.offsets[ i ]; + int newIdx = spineData.slotOrder[ slot.slot ] + slot.offset; + NewSlotOrder[ newIdx ] = slot.slot; + int base_idx = Array.IndexOf( BaseOrder_Copy, slot.slot ); + BaseOrder_Copy[ base_idx ] = null; + } + + int pos = 0; + for ( int i = 0; i != NewSlotOrder.Length; i++ ) { + if ( NewSlotOrder[ i ] == null ) { + bool found = false; + for ( ; pos != BaseOrder_Copy.Length; ) { + if ( BaseOrder_Copy[ pos ] != null ) { + found = true; + NewSlotOrder[ i ] = BaseOrder_Copy[ pos ]; + pos++; + break; + } else pos++; + } + + if ( !found ) Debug.LogError( "Can't create new draw order" ); + } + } + + for ( int j = 0; j != NewSlotOrder.Length; j++ ) { + float t = ( float )orderAnim.time; + float val = ( - j ) * zStep; + AnimationCurve curv = Curvs[ NewSlotOrder[ j ] ]; + float priv_val = curv.Evaluate( t ); + Keyframe keyFrameY_help = new Keyframe( t, priv_val ); + Keyframe keyFrameY = new Keyframe( t + 0.00001f, val ); + curv.AddKey( keyFrameY_help ); + curv.AddKey( keyFrameY ); + } + } + + for ( int i = 0; i != BaseSlotOrder.Length; i++ ) { + string slotpath = spineData.slotPathByName[ BaseSlotOrder[ i ] ]; + AnimationCurve curv = Curvs[ BaseSlotOrder[ i ] ]; + AnimationUtility.SetEditorCurve( clip, EditorCurveBinding.FloatCurve( slotpath, typeof( Transform ), "m_LocalPosition.z" ), curv ); + } + } + public static void addSlotAnimationToClip(AnimationClip clip, - Dictionary slotsAnimation, - SpineData spineData, + Dictionary slotsAnimation, + SpineData spineData, + List skinList, AttachmentGOByNameBySlot attachmentGOByNameBySlot) { foreach(KeyValuePair kvp in slotsAnimation){ @@ -529,6 +661,57 @@ public static void addSlotAnimationToClip(AnimationClip } if (slotAnimation.color != null && slotAnimation.color.Count >0){ + AnimationCurve Curv_R = new AnimationCurve( ); + AnimationCurve Curv_G = new AnimationCurve( ); + AnimationCurve Curv_B = new AnimationCurve( ); + AnimationCurve Curv_A = new AnimationCurve( ); + Keyframe startKeyFrame = new Keyframe( 0.0f, 1.0f ); + Curv_R.AddKey( startKeyFrame ); + Curv_G.AddKey( startKeyFrame ); + Curv_B.AddKey( startKeyFrame ); + Curv_A.AddKey( startKeyFrame ); + + JsonData[] curveData = new JsonData[ slotAnimation.color.Count ]; + for( int i = 0 ; i != slotAnimation.color.Count ;i++ ) { + SpineSlotColorAnimation color = slotAnimation.color[ i ]; + uint col = Convert.ToUInt32( color.color, 16 ); + uint r = ( col ) >> 24; + uint g = (col & 0xff0000) >> 16; + uint b = (col & 0xff00) >> 8; + uint a = (col & 0xff); + float t = ( (float) (color.time) ); + Keyframe keyFrame_R = new Keyframe( t, r / 255.0f ); + Keyframe keyFrame_G = new Keyframe( t, g / 255.0f ); + Keyframe keyFrame_B = new Keyframe( t, b / 255.0f ); + Keyframe keyFrame_A = new Keyframe( t, a / 255.0f ); + Curv_R.AddKey( keyFrame_R ); + Curv_G.AddKey( keyFrame_G ); + Curv_B.AddKey( keyFrame_B ); + Curv_A.AddKey( keyFrame_A ); + curveData[ i ] = color.curve; + } + + setTangents( Curv_R, curveData ); + setTangents( Curv_G, curveData ); + setTangents( Curv_B, curveData ); + setTangents( Curv_A, curveData ); + + for ( int i = 0; i != skinList.Count; i++ ) { + if ( skinList[ i ].containsSlot( slotName ) ) { + SkinSlot skinSlot = skinList[ i ][ slotName ]; + for ( int j = 0; j != skinSlot.attachments.Length; j++ ) { + SpriteRenderer sprite = skinSlot.attachments[ j ].sprite; + if ( sprite != null ) { + string spritePath = skinSlot.attachments[ j ].ObPath; + AnimationUtility.SetEditorCurve( clip, EditorCurveBinding.FloatCurve( spritePath, typeof( SpriteRenderer ), "m_Color.r" ), Curv_R ); + AnimationUtility.SetEditorCurve( clip, EditorCurveBinding.FloatCurve( spritePath, typeof( SpriteRenderer ), "m_Color.g" ), Curv_G ); + AnimationUtility.SetEditorCurve( clip, EditorCurveBinding.FloatCurve( spritePath, typeof( SpriteRenderer ), "m_Color.b" ), Curv_B ); + AnimationUtility.SetEditorCurve( clip, EditorCurveBinding.FloatCurve( spritePath, typeof( SpriteRenderer ), "m_Color.a" ), Curv_A ); + } + } + } + } + Debug.LogWarning("slot color animation is not supported yet"); } } diff --git a/Assets/UnitySpineImporter/SharedScripts/Skin/SkinSlotAttachment.cs b/Assets/UnitySpineImporter/SharedScripts/Skin/SkinSlotAttachment.cs index 7c16a67..fd12964 100644 --- a/Assets/UnitySpineImporter/SharedScripts/Skin/SkinSlotAttachment.cs +++ b/Assets/UnitySpineImporter/SharedScripts/Skin/SkinSlotAttachment.cs @@ -7,5 +7,7 @@ namespace UnitySpineImporter{ public class SkinSlotAttachment { public string name; public GameObject gameObject; + public SpriteRenderer sprite; + public string ObPath; } } \ No newline at end of file From c1ef1baaabf617b3fafe85d1321e29ae5b7a2599 Mon Sep 17 00:00:00 2001 From: nicloay Date: Fri, 22 Aug 2014 13:04:50 +0400 Subject: [PATCH 2/5] cosmetic code refactoring --- .../Editor/Model/Spine/Data/SpineData.cs | 1 - .../Scripts/Editor/Util/SpineUtil.cs | 32 +++++++++++-------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/SpineData.cs b/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/SpineData.cs index 8b39257..35a499a 100644 --- a/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/SpineData.cs +++ b/Assets/UnitySpineImporter/Scripts/Editor/Model/Spine/Data/SpineData.cs @@ -38,7 +38,6 @@ public static SpineData deserializeFromFile(string spineDataFilePath){ if (!File.Exists(spineDataFilePath)) throw new SpineDatatCreationException("provided file does not exists"); try{ - //KUBA!!!!! data = LitJson.JsonMapper.ToObject(File.ReadAllText(spineDataFilePath)); } catch (LitJson.JsonException e){ throw new SpineDatatCreationException("problem with parse json data \n"+e.Message); diff --git a/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs b/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs index 8defa24..b331d23 100644 --- a/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs +++ b/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs @@ -47,7 +47,7 @@ public static void buildPrefab(GameObject gameObject, string directory, string n } public static void builAvatarMask(GameObject gameObject, SpineData spineData, Animator animator, string directory, string name){ - UnityEngine.Avatar avatar = AvatarBuilder.BuildGenericAvatar(gameObject,""); + Avatar avatar = AvatarBuilder.BuildGenericAvatar(gameObject,""); animator.avatar = avatar; AvatarMask avatarMask = new AvatarMask(); string[] transofrmPaths = getTransformPaths(gameObject, spineData); @@ -287,7 +287,7 @@ public static void addAllAttahcmentsSlots(SpineData spineData, SpritesByName spr skinSlot.gameObject = slotGO; List attachmentList = new List(); foreach(KeyValuePair kvp3 in spineData.skins[skinName][slotName]){ - string attachmenName = kvp3.Key; + string attachmenName = kvp3.Key; SkinSlotAttachment attachment = new SkinSlotAttachment(); attachment.name = attachmenName; @@ -296,7 +296,6 @@ public static void addAllAttahcmentsSlots(SpineData spineData, SpritesByName spr // - create skined object or direct GO for default skin Sprite sprite; spriteByName.TryGetValue(spineAttachment.name, out sprite); - int drawOrder = spineData.slotOrder[slotName]; GameObject parentGO; GameObject spriteGO; @@ -450,16 +449,21 @@ static void AddEvents( AnimationClip clip, { List< UnityEngine.AnimationEvent > unityEvents = new List( ); foreach ( JsonData entry in events ) { - if ( !entry.IsObject ) Debug.LogError( "WTF JSON!! Event is not an Object??!!" ); + if ( !entry.IsObject ) + Debug.LogError( "JSON data is wrong. Event is not an Object??!!" ); IDictionary entry_dict = entry as IDictionary; UnityEngine.AnimationEvent ev = new UnityEngine.AnimationEvent( ); - if ( entry_dict.Contains( "name" ) ) ev.functionName = ( ( string ) entry[ "name" ] ); - else Debug.LogError( "WTF JSON!! Missing Name in event data: " + animName ); + if ( entry_dict.Contains( "name" ) ) + ev.functionName = ( ( string ) entry[ "name" ] ); + else + Debug.LogError( "JSON data is wrong. Missing Name in event data: " + animName ); - if ( entry_dict.Contains( "time" ) ) ev.time = getNumberData( entry[ "time" ], animName ); - else Debug.LogError( "WTF JSON!! Missing Time in event data: " + animName + " EVENT_NAME: " + ev.functionName ); + if ( entry_dict.Contains( "time" ) ) + ev.time = getNumberData( entry[ "time" ], animName ); + else + Debug.LogError( "JSON data is wrong. Missing Time in event data: " + animName + " EVENT_NAME: " + ev.functionName ); bool ParamAdded = false; if ( entry_dict.Contains( "int" ) ) { @@ -468,13 +472,15 @@ static void AddEvents( AnimationClip clip, } if ( entry_dict.Contains( "float" ) ) { - if ( ParamAdded ) Debug.LogError( "WTF JSON!! Unity Supports only one event parameter!!!! CLIP NAME: " + animName + " EVENT_NAME: " + entry.ToJson( ) ); + if ( ParamAdded ) + Debug.LogError( "JSON data is wrong. Unity Supports only one event parameter!!!! CLIP NAME: " + animName + " EVENT_NAME: " + entry.ToJson( ) ); ev.floatParameter = getNumberData( entry[ "float" ], animName ); ParamAdded = true; } if ( entry_dict.Contains( "string" ) ) { - if ( ParamAdded ) Debug.LogError( "WTF JSON!! Unity Supports only one event parameter!!!! CLIP NAME: " + animName + " EVENT_NAME: " + entry.ToJson( ) ); + if ( ParamAdded ) + Debug.LogError( "JSON data is wrong. Unity Supports only one event parameter!!!! CLIP NAME: " + animName + " EVENT_NAME: " + entry.ToJson( ) ); ev.stringParameter = ( string ) entry[ "string" ]; } @@ -494,7 +500,7 @@ static float getNumberData( JsonData data, string animName ) { if ( data.IsInt ) return ( float )( ( int )data ); - Debug.LogError( "WTF JSON!! Unrecognizable number format!!!! CLIP NAME: " + animName + " JsonData: " + data.ToJson( ) ); + Debug.LogError( "JSON data is wrong. Unrecognizable number format!!!! CLIP NAME: " + animName + " JsonData: " + data.ToJson( ) ); return 0.0f; } @@ -1023,9 +1029,7 @@ public static void addBoneAnimationToClip(AnimationClip clip, Dictionary Date: Fri, 22 Aug 2014 13:27:57 +0400 Subject: [PATCH 3/5] added test project --- Assets/test/DrawOrder/1.png | Bin 0 -> 18332 bytes Assets/test/DrawOrder/1.png.meta | 47 +++++++++ Assets/test/DrawOrder/2.png | Bin 0 -> 18684 bytes Assets/test/DrawOrder/2.png.meta | 47 +++++++++ Assets/test/DrawOrder/3.png | Bin 0 -> 18993 bytes Assets/test/DrawOrder/3.png.meta | 47 +++++++++ Assets/test/DrawOrder/4.png | Bin 0 -> 18653 bytes Assets/test/DrawOrder/4.png.meta | 47 +++++++++ Assets/test/DrawOrder/animation.meta | 5 + .../animation/test_slot_order.anim.asset | Bin 0 -> 15996 bytes .../animation/test_slot_order.anim.asset.meta | 4 + .../animation/test_slot_order.mask.asset | Bin 0 -> 4412 bytes .../animation/test_slot_order.mask.asset.meta | 4 + Assets/test/DrawOrder/spine.spine | Bin 0 -> 461 bytes Assets/test/DrawOrder/spine.spine.meta | 4 + Assets/test/DrawOrder/test_slot_order.atlas | 34 +++++++ .../test/DrawOrder/test_slot_order.atlas.meta | 4 + Assets/test/DrawOrder/test_slot_order.json | 59 ++++++++++++ .../test/DrawOrder/test_slot_order.json.meta | 4 + Assets/test/DrawOrder/test_slot_order.png | Bin 0 -> 3233 bytes .../test/DrawOrder/test_slot_order.png.meta | 91 ++++++++++++++++++ 21 files changed, 397 insertions(+) create mode 100644 Assets/test/DrawOrder/1.png create mode 100644 Assets/test/DrawOrder/1.png.meta create mode 100644 Assets/test/DrawOrder/2.png create mode 100644 Assets/test/DrawOrder/2.png.meta create mode 100644 Assets/test/DrawOrder/3.png create mode 100644 Assets/test/DrawOrder/3.png.meta create mode 100644 Assets/test/DrawOrder/4.png create mode 100644 Assets/test/DrawOrder/4.png.meta create mode 100644 Assets/test/DrawOrder/animation.meta create mode 100644 Assets/test/DrawOrder/animation/test_slot_order.anim.asset create mode 100644 Assets/test/DrawOrder/animation/test_slot_order.anim.asset.meta create mode 100644 Assets/test/DrawOrder/animation/test_slot_order.mask.asset create mode 100644 Assets/test/DrawOrder/animation/test_slot_order.mask.asset.meta create mode 100644 Assets/test/DrawOrder/spine.spine create mode 100644 Assets/test/DrawOrder/spine.spine.meta create mode 100644 Assets/test/DrawOrder/test_slot_order.atlas create mode 100644 Assets/test/DrawOrder/test_slot_order.atlas.meta create mode 100644 Assets/test/DrawOrder/test_slot_order.json create mode 100644 Assets/test/DrawOrder/test_slot_order.json.meta create mode 100644 Assets/test/DrawOrder/test_slot_order.png create mode 100644 Assets/test/DrawOrder/test_slot_order.png.meta diff --git a/Assets/test/DrawOrder/1.png b/Assets/test/DrawOrder/1.png new file mode 100644 index 0000000000000000000000000000000000000000..2c9a7bda06e67b78092a32c4a7d2cda72b53752d GIT binary patch literal 18332 zcmeI4c{r3^|G;nQ$-Y#yNexPpS*;Qr4rtIsBouwpZEH`zdwH0HFI6eeAjc%=X}q(&pp?5&n`C?dnNff z@&EuRIXc*QfbWr_KiNs(f9F-74ufxUJO^I^04Pis{Ye2Shi3tRyeo@HbaV6P3b_J* zE)V8NB*J)nE`t?F2Y}G}G*2ekvtx#N-}4XFPBD=Oowy$A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hp?@1Tiu9A__`na~fzRAq$@|D}7UZ6s?y4<>hI{hx&)ta%P z9TLwJ*-BQDZ)9!VB~PD?U^j#h1oQ`Q>pTa#4+M;b1>sk^<+yfI(|Tp1sy_UZ*P>=x zv3YX5Rl3SgsW)zP6eXQ;G|t;%{cZTmoTT#~#u`69*9h%!Tqdb95(3MSyxcK#sw~A; zYw^Kyf2H35(kF|HEk4KVdNhpN2LfcOqE8v7I($+;xpO?sI4o$b5@226oF#9(1(67x z+jNCY(~W()3?^MwT_^@*1r%-Rj5@Y{ZaAsUNB>RLrrh(5H|e`36TwIQ1sgQ08^lZx zH}txTXcdrkI-|PYkk9scm(5vOHj&r=uzy#Yh?ZWGU1!vBuum_v)U7-_qs+D# zi`UnE&oP%j$-MMv3|T6&GSm1}gWA1j@pAu@)g#Qd*b!vah)7UJpEvN=dpC_s*w6W5~CJf(bmHK*kEh{D{UQ+-xW=h_2CxHx5L@tEHV9WsYoPBjk%w8)G{4o%bz zz0EF|bG7BQ!JNO$B7tYAs4H^-7%x-5d+>jn=-)r?7i<>=F4=Bumf!r00Prpw3kUN& IvmJZ>3*{HjYXATM literal 0 HcmV?d00001 diff --git a/Assets/test/DrawOrder/2.png.meta b/Assets/test/DrawOrder/2.png.meta new file mode 100644 index 0000000..dfd6b38 --- /dev/null +++ b/Assets/test/DrawOrder/2.png.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 0b21b44cbe95d431891bf70b9ebf32b0 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 1024 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/Assets/test/DrawOrder/3.png b/Assets/test/DrawOrder/3.png new file mode 100644 index 0000000000000000000000000000000000000000..8bde30872d6019f50923bbeaa6298c523665c4dd GIT binary patch literal 18993 zcmeI4c{r5o`@mn3eQTAZGiZ^FF=Nn7jAg9ZvV~S-Hj`z>%#`gUk|jDxDn+Cm*(qCR zLe@xyR8-cJCE?(diV}WPjCtQzxm$xm)LJYG!rKV0En!Z{o?`RF0BCoVJiw2yK|>2 zl}Tl|QfUxVEEYneQ%MweA^`ZbCfJhgYzJ0rk9WS+HwzCuYeuzMB?z(6j|^NHy-7(< zNODKG+?D66tSgoo8uH29O$z5dbt>@WDr;rY2;pY}y>eGi1t*6`+?#yipX}CBGXAoD zy6`EcKWi)@zfquEQ1rZsnzeeMXuAITWq$_OR@c1fRnZL+-arE+1@j4Vj41^kU?M<2>ce=xt_#fhz%Bzf=0x09_-Vz=R8% zY=I;`!1+Gjr3csv1)Mh@efby&OqjUn&jai^E4PX#DH?#RAch+NuG@jE#$6GHfTJp~ zl4Mqm0-iwuRZ|C&32^-;P~IRZk_QNi0;<;GAzJ`Gf57>!f`Sil{35W@=#7Kc>#aGG z{Yq?77xT1O8&HNpdjz3g0uBx;>lGVJrM9lrz%9YW>8e!vUX(@zAtnACdjJ4Q(W}_m zj!pSAi03pkXq+k%KL8ypBGqK-07`EPrj_cK$$*>8l$@_+0mk zBpn)$B;`ry76M5Ftqxtu{BXr!Q{biK#r<)=(pJX4)SDU)99FcI7b7#{yvxc`wcdz*xk$5sTBkOgQOs(>v}S8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n)OxzQAnSM-2~S-elKI;<0$GxUD)2yi>q`}XS@>0nmYlzHKE_gzZo>acRv zb#-;Et*wKDgA;d$hlk(2J5=1!lK9GZf9d}IwSPBvZ%Y&%p_Zhdv&k7cI1_0TA@@qg zZ}N#%#8ub#*m6liL1biPe!ki;Z@s~Ty(u=P+v(ok0)eceq9VtLBp7jA-Fe%(oUAOG z*hFEa>ZO1+d_36GtVc*~9i7XVy!`wsg9kfJ&$vdezCD`1nvkX#QIJ1+%X3{V@M*#~ z)}|q+MM%z3Y%2Qqvqxq1gCW=bbeuaoBWaR+#>U1)jdzs!({^P_NJ#Y2Km7go!_MDK zi~D(gGfK8eUm1CalwW85th!|U_3Il?he~hB*=9CdT3HQGDmwZN+w7?Kloik`-*>u+ z_3W?K;Iqqt+k+`Yipsu`rGEE)?4~szlMA3h3?+JzvX33f@N6S&SZ*AO!h7j zAi0mu8VHNYJ-tMCMj%k*mD{)>d${`^Ha9oFjn=;c1hQ0MutEiYe}84eUn#%6z#edU zGA%o#u_+-d;Yh95aY>tdH*c<)oSM$Wmmb=Kf8Hwb>TvO?o`SaF*Dk63z9}|aV((|? z=0?pxOwUv}(-@4$u1M15oU`}($CQna<{>Slq@;AFm?=*xDtK;QxePni6E(e!a!FD? zLSCjZzz9}3I&&<(-&bQ=vFcd!L!?Er;#yJu1k3&pAAAwr#W}@gWn~2g1uPb;wA7;` q{PKVsV78180RFX?ZjqlfuoQjlLAH=I`xl)6z|_#vAV=T%*#7`h`AEJ1 literal 0 HcmV?d00001 diff --git a/Assets/test/DrawOrder/3.png.meta b/Assets/test/DrawOrder/3.png.meta new file mode 100644 index 0000000..3aa402e --- /dev/null +++ b/Assets/test/DrawOrder/3.png.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: f874b442646954af5a8e7981913ce559 +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 1024 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/Assets/test/DrawOrder/4.png b/Assets/test/DrawOrder/4.png new file mode 100644 index 0000000000000000000000000000000000000000..db4c2cf93fb923de8a2a3d332132dece1d609a60 GIT binary patch literal 18653 zcmeI4c{r5o`@mmOwk#E?q%)REGOKmQ7|U3*g%L_+%#1NvhMCD$iOSM)l2o=xbxK)_ zQbJjZN|79uB@&W4bPkFZ{NAC$o95T|`kvn(zw4U!VrK5=e(w8z@6U5T&-*@eUGMB) zZ)+|gwoD8F00~PA69@1;ock{_2Yj`5`*0F`6ZN-nWdnftBJRHckbH6p0EpQ!h{W~l zy_g&(+l%QBvm_E>{w$^^!-oa{!Of|TbdqE5V*TN^A!DnU@MBg?2U!uAgYm&|nYdMI zilWl%ViZp|$=a7MFf|pDzndN-c=&MmAz6F%`3JfzYcr-YvD!PJ5};WCl=CoDAVwZi9LG+wdb#op@MRUKUj!w4}Ie?VHKfU3wIRTcn7 z!tnUDN@c<~0fFEKaS@=*CZ!CuJbGN}jd7BjK=?j^GESVXl}NY@U>JJX_&i`}CJ>&Q zxXKYo7XsXCC?1`_dN|;|diSdaAUt&>X@>x?>6oIdKzbYiTSSX70lf5p?79sHOaT`Z zAmeFu8w)&x11L*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literal 0 HcmV?d00001 diff --git a/Assets/test/DrawOrder/4.png.meta b/Assets/test/DrawOrder/4.png.meta new file mode 100644 index 0000000..bb11246 --- /dev/null +++ b/Assets/test/DrawOrder/4.png.meta @@ -0,0 +1,47 @@ +fileFormatVersion: 2 +guid: 2bf6204690c4f4db5af906e52dc8a11a +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 2 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + linearTexture: 0 + correctGamma: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: .25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 1024 + textureSettings: + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapMode: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: .5, y: .5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaIsTransparency: 0 + textureType: -1 + buildTargetSettings: [] + spriteSheet: + sprites: [] + spritePackingTag: + userData: diff --git a/Assets/test/DrawOrder/animation.meta b/Assets/test/DrawOrder/animation.meta new file mode 100644 index 0000000..1d9c910 --- /dev/null +++ b/Assets/test/DrawOrder/animation.meta @@ -0,0 +1,5 @@ +fileFormatVersion: 2 +guid: d466aea0adaba4fedb50a95b4d2f0cfd +folderAsset: yes +DefaultImporter: + userData: diff --git a/Assets/test/DrawOrder/animation/test_slot_order.anim.asset b/Assets/test/DrawOrder/animation/test_slot_order.anim.asset new file mode 100644 index 0000000000000000000000000000000000000000..ddb210f06e5702b24b6f8d991d01a93b022d52de GIT binary patch literal 15996 zcmeHO33OdW8NRHgDJ@$mOA9TOeQ9W$LZNL)x6nYB&=lxG2)D^i^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1MRfoB6r4w)az&`8Hw_F~GOU7YlYT2)X Q?gLQ{@!oQ;H+!|+U-!iS$N&HU literal 0 HcmV?d00001 diff --git a/Assets/test/DrawOrder/animation/test_slot_order.mask.asset.meta b/Assets/test/DrawOrder/animation/test_slot_order.mask.asset.meta new file mode 100644 index 0000000..4d63d50 --- /dev/null +++ b/Assets/test/DrawOrder/animation/test_slot_order.mask.asset.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 0686a0cee61304427800884f3070daa1 +NativeFormatImporter: + userData: diff --git a/Assets/test/DrawOrder/spine.spine b/Assets/test/DrawOrder/spine.spine new file mode 100644 index 0000000000000000000000000000000000000000..43c7565e8e2d73fab8bee5edb3cc355337e670f2 GIT binary patch literal 461 zcmV;;0W$url*>vZK@^7Tuk=kj-AQy16~@&dh-iBm5d<&Mof`$2*-A!x(WqUat3}*p z<}u7m4C+hx0`6ux+d;&=o|B4`5wb9o6x83VHBPm};3Wg&q)*7>16Rr#UH zj^js(0=`=%SVfEo3&@muqL{D*HJim@aW@-6cq~KwI?Up;6j=hE2w6%fqcVkNv-#Wx zepBgh0(yf4#@7QU-VibDpJ)q*_Hq`XfXnC~i_$B=n!+ao%DZCJ&3r!(#I6 za2}S>tO}eCmCJW6{jT68iuMJ*kzrTxa=+kPS?LP?+&kE%^E^VUh+IpPvs#|0Kaygj z6kCEv!@>tjyaG(pSdNj86|7386?B4lQf=7&gv@5 z<1DIb9p^gYdoenoW4cGzVivVNns2GBKJd;u(-7_qcCPlnZr}Y{GY9o29n=N*;%|Ea D8!Y0W literal 0 HcmV?d00001 diff --git a/Assets/test/DrawOrder/spine.spine.meta b/Assets/test/DrawOrder/spine.spine.meta new file mode 100644 index 0000000..d0fe975 --- /dev/null +++ b/Assets/test/DrawOrder/spine.spine.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: aa45774d4c53d4f4d8b70884ef4137fc +DefaultImporter: + userData: diff --git a/Assets/test/DrawOrder/test_slot_order.atlas b/Assets/test/DrawOrder/test_slot_order.atlas new file mode 100644 index 0000000..5786150 --- /dev/null +++ b/Assets/test/DrawOrder/test_slot_order.atlas @@ -0,0 +1,34 @@ + +test_slot_order.png +size: 520,130 +format: RGBA8888 +filter: Linear,Linear +repeat: none +1 + rotate: false + xy: 2, 2 + size: 128, 128 + orig: 128, 128 + offset: 0, 0 + index: -1 +2 + rotate: false + xy: 132, 2 + size: 128, 128 + orig: 128, 128 + offset: 0, 0 + index: -1 +3 + rotate: false + xy: 262, 2 + size: 128, 128 + orig: 128, 128 + offset: 0, 0 + index: -1 +4 + rotate: false + xy: 392, 2 + size: 128, 128 + orig: 128, 128 + offset: 0, 0 + index: -1 diff --git a/Assets/test/DrawOrder/test_slot_order.atlas.meta b/Assets/test/DrawOrder/test_slot_order.atlas.meta new file mode 100644 index 0000000..df088c6 --- /dev/null +++ b/Assets/test/DrawOrder/test_slot_order.atlas.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 12971e0dab7834041bb110374694b87c +DefaultImporter: + userData: diff --git a/Assets/test/DrawOrder/test_slot_order.json b/Assets/test/DrawOrder/test_slot_order.json new file mode 100644 index 0000000..74a6de0 --- /dev/null +++ b/Assets/test/DrawOrder/test_slot_order.json @@ -0,0 +1,59 @@ +{ +"skeleton": { "spine": "1.9.15", "hash": "HXT4BLqTX7yvfB45ju0PgO/401s", "width": 128, "height": 128 }, +"bones": [ + { "name": "root" }, + { "name": "bone", "parent": "root" }, + { "name": "bone2", "parent": "root" }, + { "name": "bone3", "parent": "bone2" } +], +"ik": [], +"slots": [ + { "name": "1", "bone": "root" }, + { "name": "slot2", "bone": "bone", "attachment": "2" }, + { "name": "slot3", "bone": "bone2", "attachment": "3" }, + { "name": "slot4", "bone": "bone3", "attachment": "4" } +], +"skins": { + "default": { + "1": { + "1": { "width": 128, "height": 128 } + }, + "slot2": { + "2": { "width": 128, "height": 128 } + }, + "slot3": { + "3": { "width": 128, "height": 128 } + }, + "slot4": { + "4": { "width": 128, "height": 128 } + } + } +}, +"animations": { + "animation": { + "draworder": [ + { "time": 0 }, + { + "time": 0.3333, + "offsets": [ + { "slot": "slot4", "offset": -2 } + ] + }, + { + "time": 0.6666, + "offsets": [ + { "slot": "1", "offset": 3 }, + { "slot": "slot4", "offset": -3 } + ] + }, + { + "time": 1, + "offsets": [ + { "slot": "slot2", "offset": 2 }, + { "slot": "slot4", "offset": -3 } + ] + } + ] + } +} +} \ No newline at end of file diff --git a/Assets/test/DrawOrder/test_slot_order.json.meta b/Assets/test/DrawOrder/test_slot_order.json.meta new file mode 100644 index 0000000..15f2ade --- /dev/null +++ b/Assets/test/DrawOrder/test_slot_order.json.meta @@ -0,0 +1,4 @@ +fileFormatVersion: 2 +guid: 1799c10857aa64517b613fc15b0c9187 +TextScriptImporter: + userData: diff --git a/Assets/test/DrawOrder/test_slot_order.png b/Assets/test/DrawOrder/test_slot_order.png new file mode 100644 index 0000000000000000000000000000000000000000..5df8e656db6b87de4688c89685f1b91c0cf1c62f GIT binary patch literal 3233 zcmeHJeN>a@6@QWtVnYnI1(hxc+U|%7#;UI4(KB(4l$ zsNoGSu+W+VUnK*e1}K`%@TUa8zsbNo4dU?#vltl+eTMVC%RvBGWqFmNC%_>8W1Ete zQ0SA>{Ih`jXCeHTH2k!CGgSIhWKP`!)+m&iKq?(FvJ*pKOC6~erZ|uLHB=w10O;UOw#%o%>BiD$sp#{?u6>096_~H4k zntg<*rIbGH117251JRb?&RmxYwe=INi&gNF_U=;M^(R<&M8#C|-05h+_AYAguj#V= z_4R9liI1igp9WOPIh@JP+Xph@(TR=t58539XeR({U-R9bhj}G;PF}5{V1Yx|PSt$5 zXyk0)p4tuD+>A-G(v_9z9f!F%TlCQMQMNIu#?z)822A z1Y?)V$MK4x!y1?ugvcXE`k4|tuXHmjheYNn8NaK<3Tc96{WGQzB8tZ8Z^CzrYP)i2(_Jpq8H0%O1aRg|R#wF# zV)S6pi{3KJt@d;i74jDVW$%vhW4h(VVuB`L9*D)7)1*6m&&t!V1KE{Wun6`59zhKS zzMw6}Ej;KYquNtDdhy8ZLJj?Ttxdc#FY6Pw3sm#lY@lgeQu+?PY$)Q&jToybH^?rY7Ed|}i1SivbtqQJ`!t-M-lujE;d?y&OF0O^Y9rR*x z4@m>8$Fh$qv$#(_m$x6%C1qtD&V*gj3${p7dRCd<@SZflX2k!*(g*ozJ?#fKh`*#p zcoULWhL!gKwozR^&aLlqYQ#a_n;uBuNX#kS{$HGx$DFPoh@U6Czfnzb^^3OCigFVK!&|$PT{sDDOBw7Fj$FoNE$u1(Mv?jVdGbAb z6Q}X;WLK!kyWDPc5RLofvWUOElU#a_@jcsc2e*#pzmPj`Hme5~;MpPmTj;iqtL#5E z?pxfEFYgoES2!xzQC2#M_8ab&ko&%5w8V=aIf(swe?8R~VXnU-+>4WMQ(6vq?VaZ5})>@c1Z<6ppEXaOu zOEp>DC|@#&&NLSgdfth&`LE`QrV*p>V+iPwmKQkr21!?^V+4j>n6%vJyj(UNM|diQ zf@aj=RdKZ4#NAcZvr~mDM(q>&Thr~w@z5*9up`YTn|8z<+s4F_s(OyBwpRMFqH5Zo zOf&G?I@Ru@92GvDA6__Ycr>-^-Zp9aUoP_KPWmAw!i0YOQXL+VW|VaH_V%XP&xv9o zU$fa+1?4VE-tP^{Wr{>wrwxC({tf)X$V-;vYRH3QI>Mmh2>uigW$}}DBOc)oa=Qu3 zcaDp|h8Yn#7+C>BELO%6IX^r$kg#hLHtG653>)5^Z!|=vw5W(r>4CHQ`OVq2Lk(~O zK93phGIW150H49`;WBh*_7}TKL1LltZqH=1aY0Ab2`$bI>hBxRb6gkx-ObCzzkf~a q(=5PEK Date: Fri, 22 Aug 2014 13:36:21 +0400 Subject: [PATCH 4/5] Fixing spine project --- Assets/test/DrawOrder/spine.spine | Bin 461 -> 487 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Assets/test/DrawOrder/spine.spine b/Assets/test/DrawOrder/spine.spine index 43c7565e8e2d73fab8bee5edb3cc355337e670f2..998ed01c5e76e1e173e86c407975b1603d99847c 100644 GIT binary patch literal 487 zcmV z0eFF2cmt%A1LDY$2jC6hSRvGVnei4-XbuE2l0T1UcYkBgtQQDH6R4vlBv7WN+%~(q z+}6d@^t*(EPf(9dS{RjQJG(kLQ2V-gZidNDs$S$-d0=(T46{64%l3x4DAPi18IzVq zF;6`#lKn@7E8HgB29|{j6j~n>UAThGWARyn&5;lxON}3wSn4bdmWT&pmL^(guV6eL zpPT}p===)-!$ktq$-;?;M2!ER=n0={*+(o8F#6RE89H!Ra6;zUn=d%dCH7$Ru-H5- zHqQgj!xGz7(S_es-Ut&}p9x;4=zQQy)8IoH&jjC`8{C@)zmx5m;9GNpRX~5nGOZ$V zl4pBKndu`*v2zq#hhX2R20r)WlK~ z)Nk8t@sqK2@vj+oDg>@UiawmPq&IVtB$GPuEzmm){Pr)vF5EwX)!wApu5b`i5voF< zfrx4ub)s%`CF;lQ_bb2CqVYC>&x<>fR5fW(Y4u?){Hu@-s%6Ix25S0DEC$bvK5~%0 dJRN@ZJex literal 461 zcmV;;0W$url*>vZK@^7Tuk=kj-AQy16~@&dh-iBm5d<&Mof`$2*-A!x(WqUat3}*p z<}u7m4C+hx0`6ux+d;&=o|B4`5wb9o6x83VHBPm};3Wg&q)*7>16Rr#UH zj^js(0=`=%SVfEo3&@muqL{D*HJim@aW@-6cq~KwI?Up;6j=hE2w6%fqcVkNv-#Wx zepBgh0(yf4#@7QU-VibDpJ)q*_Hq`XfXnC~i_$B=n!+ao%DZCJ&3r!(#I6 za2}S>tO}eCmCJW6{jT68iuMJ*kzrTxa=+kPS?LP?+&kE%^E^VUh+IpPvs#|0Kaygj z6kCEv!@>tjyaG(pSdNj86|7386?B4lQf=7&gv@5 z<1DIb9p^gYdoenoW4cGzVivVNns2GBKJd;u(-7_qcCPlnZr}Y{GY9o29n=N*;%|Ea D8!Y0W From d05aea969a8e840fe8ff2392d418bc5f0a3956b9 Mon Sep 17 00:00:00 2001 From: Jakub Lisinski Date: Fri, 22 Aug 2014 15:57:03 +0200 Subject: [PATCH 5/5] draw order NPE bug fixed --- .../Scripts/Editor/Util/SpineUtil.cs | 63 +++++++++++-------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs b/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs index 8defa24..d674cb4 100644 --- a/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs +++ b/Assets/UnitySpineImporter/Scripts/Editor/Util/SpineUtil.cs @@ -541,42 +541,51 @@ public static void addDrawOrderAnimation( AnimationClip clip, } foreach ( SpineDrawOrderAnimation orderAnim in orderAnimation ) { - string[] NewSlotOrder = new string[ BaseSlotOrder.Length ]; - string[] BaseOrder_Copy = BaseSlotOrder.Clone( ) as string[]; - for ( int i = 0; i != orderAnim.offsets.Length; i++ ) { - SpineDrawOrderAnimationSlot slot = orderAnim.offsets[ i ]; - int newIdx = spineData.slotOrder[ slot.slot ] + slot.offset; - NewSlotOrder[ newIdx ] = slot.slot; - int base_idx = Array.IndexOf( BaseOrder_Copy, slot.slot ); - BaseOrder_Copy[ base_idx ] = null; - } + string[] NewSlotOrder = null; + if ( orderAnim.offsets != null ) { + NewSlotOrder = new string[ BaseSlotOrder.Length ]; + string[] BaseOrder_Copy = BaseSlotOrder.Clone( ) as string[]; + + for ( int i = 0; i != orderAnim.offsets.Length; i++ ) { + SpineDrawOrderAnimationSlot slot = orderAnim.offsets[ i ]; + int newIdx = spineData.slotOrder[ slot.slot ] + slot.offset; + NewSlotOrder[ newIdx ] = slot.slot; + int base_idx = Array.IndexOf( BaseOrder_Copy, slot.slot ); + BaseOrder_Copy[ base_idx ] = null; + } - int pos = 0; - for ( int i = 0; i != NewSlotOrder.Length; i++ ) { - if ( NewSlotOrder[ i ] == null ) { - bool found = false; - for ( ; pos != BaseOrder_Copy.Length; ) { - if ( BaseOrder_Copy[ pos ] != null ) { - found = true; - NewSlotOrder[ i ] = BaseOrder_Copy[ pos ]; - pos++; - break; - } else pos++; - } + int pos = 0; + for ( int i = 0; i != NewSlotOrder.Length; i++ ) { + if ( NewSlotOrder[ i ] == null ) { + bool found = false; + for ( ; pos != BaseOrder_Copy.Length; ) { + if ( BaseOrder_Copy[ pos ] != null ) { + found = true; + NewSlotOrder[ i ] = BaseOrder_Copy[ pos ]; + pos++; + break; + } else pos++; + } - if ( !found ) Debug.LogError( "Can't create new draw order" ); + if ( !found ) Debug.LogError( "Can't create new draw order" ); + } } - } + } else NewSlotOrder = BaseSlotOrder; for ( int j = 0; j != NewSlotOrder.Length; j++ ) { float t = ( float )orderAnim.time; float val = ( - j ) * zStep; AnimationCurve curv = Curvs[ NewSlotOrder[ j ] ]; float priv_val = curv.Evaluate( t ); - Keyframe keyFrameY_help = new Keyframe( t, priv_val ); - Keyframe keyFrameY = new Keyframe( t + 0.00001f, val ); - curv.AddKey( keyFrameY_help ); - curv.AddKey( keyFrameY ); + if ( t > 0.0f ) { + Keyframe keyFrameY_help = new Keyframe( t - 0.00001f, priv_val ); + Keyframe keyFrameY = new Keyframe( t, val ); + curv.AddKey( keyFrameY_help ); + curv.AddKey( keyFrameY ); + } else { + Keyframe keyFrameY = new Keyframe( t, val ); + curv.AddKey( keyFrameY ); + } } }