DragonBones / DesignPanel

DragonBones DesignPanel
MIT License
163 stars 91 forks source link

Export from Dragon Bones to Spine 3.3 format #37

Open Mihail5412 opened 6 years ago

Mihail5412 commented 6 years ago

Hello! I would like to try to export my character from Dragon Bones to Spine format for using the Spine API. But I ran into a problem:

Error reading skeleton JSON file for SkeletonData asset: Hello_SkeletonData The given key was not present in the dictionary. at System.Collections.Generic.Dictionary`2 [System.String, System. Object].get_Item (System.String key) [0x000a2] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150 at Spine.SkeletonJson.ReadSkeletonData (System.IO.TextReader reader) [0x0006a] in D:\Program Files\Unity\PROJECTS\Testing\Assets\Spine\spine-csharp\SkeletonJson.cs:101 at Spine.Unity. SkeletonDataAsset.ReadSkeletonData (System.String text, AttachmentLoader attachmentLoader, Single scale) [0x0001a] in D:\Program Files\Unity\PROJECTS\Testing\Assets\Spine\spine-unity\Asset Types\SkeletonDataAsset.cs:198 at Spine.Unity.SkeletonDataAsset. GetSkeletonData (Boolean quiet) [0x000b2] in D:\Program Files\Unity\PROJECTS\Testing\Assets\Spine\spine-unity\Asset Types\SkeletonDataAsset.cs:153 UnityEngine.Debug:LogError(Object, Object) Spine.Unity.SkeletonDataAsset:GetSkeletonData(Boolean) (at Assets/Spine/spine-unity/Asset Types/SkeletonDataAsset.cs:157) Spine.Unity.Editor. SkeletonDataAssetInspector:InitializeEditor() (at Assets/Spine/spine-unity/Editor/SkeletonDataAssetInspector.cs:115) Spine.Unity.Editor.SkeletonDataAssetInspector:OnEnable() (at Assets/Spine/spine-unity/Editor/SkeletonDataAssetInspector.cs:75) UnityEditor.AssetDatabase:CreateAsset(Object, String) Spine.Unity.Editor. SpineEditorUtilities:IngestSpineProject(TextAsset, AtlasAsset[]) (at Assets/Spine/spine-unity/Editor/SpineEditorUtilities.cs:1228) Spine.Unity.Editor.SpineEditorUtilities:ImportSpineContent(String[], Boolean) (at Assets/Spine/spine-unity/Editor/SpineEditorUtilities.cs:667) Spine.Unity.Editor.SpineEditorUtilities:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Assets/Spine/spine-unity/Editor/SpineEditorUtilities.cs:608) UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[]) UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean) UnityEditor.DockArea:OnGUI()

I kind of found a problem. In the Spine-Unity API, I came across a function of the SkeletonDataAsset class, whose purpose is to convert from a Json.txt file, into an atlas file needed to work with the Spine-Unity API. But in my Json.txt file, which was given to me by Dragon Bones (of course I indicated that I want to export to Spine format), some data are missing, when Json is deserialized. Look on the screen( https://ibb.co/jVes6m ), the function searches inside my file (Json.txt) for the string [spine], but it is not there.