- Modifié
Errors on unity package import - Can't import assets either
Hi,
I'm new to Spine and its workflow. When I import the last package http://esotericsoftware.com/spine-unity-download/ I get these errors https://puu.sh/xcsCd/1d27259387.png
I'm using Unity 2017.1.0f3
Those are easy to fix, just comment the line. However, when importing an asset exported by Spine as described in the tutorials I get this.
NullReferenceException: Object reference not set to an instance of an object
Spine.Unity.Editor.SpineEditorUtilities.IngestSpineAtlas (UnityEngine.TextAsset atlasText) (at Assets/Spine/spine-unity/Editor/SpineEditorUtilities.cs:1031)
Spine.Unity.Editor.SpineEditorUtilities.ImportSpineContent (System.String[] imported, Boolean reimport) (at Assets/Spine/spine-unity/Editor/SpineEditorUtilities.cs:627)
Spine.Unity.Editor.SpineEditorUtilities.OnPostprocessAllAssets (System.String[] imported, System.String[] deleted, System.String[] moved, System.String[] movedFromAssetPaths) (at Assets/Spine/spine-unity/Editor/SpineEditorUtilities.cs:589)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:27)
UnityEditorInternal.InternalEditorUtility:ProjectWindowDrag(HierarchyProperty, Boolean)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Now this breaks things.
If I do stuff manually (create the atlas, skeleton data, material) my sprite is pink.
Am I missing something? Tried previous version of Spine Unity but I get the same errors.
Thanks!
What other plugins/packages are you using?
It looks like a namespace/namespace collision and there may be more than just one which can lead to weird cascades and uninitialized stuff.
If it's a new project, try just importing Spine first, and add packages one by one to see which one breaks things.
I created a new project and the compile errors are gone but when importing Spine data (atlas, json, etc) I still get the same errors.
Tested on Unity 5.6 and unity 2017.1 on two different computers.
Any ideas? Maybe the exported data is wrong?
Could you send us your exports so we can try it on our end? That way, we can also debug with the known case if it's a problem.
You can send to unity@esotericsoftware.com
Done.
Thanks!
You seemed to have renamed the files under the atlas.
The atlas says "Todo3.png" but the file included is "FreeButter.png" so the editor couldn't find it.
Whenever you rename atlas files, make sure you edit the .atlas.txt text pointing to that file too. But don't use Windows's Notepad. It can nonsensically strip or add some whitespace. If you have to edit the .atlas.txt, use MonoDevelop, Notepad++ or whatever IDE you are using to program.
To avoid this problem altogether, avoid renaming any of the files after you've exported them from Spine.
We'll include better warning messages in Spine-Unity to be clearer about this error. Thanks for reporting!
Thank you very much, it's working now. It was our fault. It wasn't me who exported the assets so I didn't really pay attention to that. Artist had renamed the exported files.
Awesome support by your side, thanks again.