- Edited
How to export .spine that does not have any textures?
We have quite many .spine files that don't have any textures (they are used to animate positions, scales etc. ). How would I export these from Spine and import them to Unity?
If I go with normal flow and try export from Spine with atlas, then I get following error when I import them to Unity
Materials not set for atlas asset: ItemEffectAnimation_Atlas
UnityEngine.Debug:LogError(Object, Object)
Spine.Unity.SpineAtlasAsset:GetAtlas() (at Assets/Spine/Runtime/spine-unity/Asset Types/SpineAtlasAsset.cs:135)
Spine.Unity.Editor.AssetUtility:IngestSpineAtlas(TextAsset) (at Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs:834)
.
.
.
If I export with no atlas ("packAtlas": null) then I get following error when I drag the skeletonData to scene
NullReferenceException: Object reference not set to an instance of an object
Spine.Unity.Editor.SkeletonGraphicInspector.InstantiateSkeletonGraphic (Spine.Unity.SkeletonDataAsset skeletonDataAsset, Spine.Skin skin) (at Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/SkeletonGraphicInspector.cs:200)
Spine.Unity.Editor.SkeletonGraphicInspector.SpawnSkeletonGraphicFromDrop (Spine.Unity.SkeletonDataAsset data) (at Assets/Spine/Editor/spine-unity/Modules/SkeletonGraphic/Editor/SkeletonGraphicInspector.cs:171)
.
.
.
workaround is to add invisible texture to .spine that causes the atlas to be created, but if there is a proper way for this, I would like to hear it.
I did not receive the error you are describing.
I removed all attachments at the Spine example project "goblins", removed all images and exported it.
I have to click "Import without atlases"
in the dialog window Atlas asset for <assetname>
once.
The I get only this warning message: "Imported with missing atlases. Skeleton will not render: goblins-pro.json"
.
The SkeletonData asset shows an empty atlas list:
All bones show up at the proper positions, and they are animated correctly in play mode.
Could you please provide some more context about how you exported and imported everything?
It would also help if you could send us your Spine project file (contact@esotericsoftware), or post it here in the forum, so that we can test with the exactly same data that you are using.
Email sent.
Received everything, thanks.
Now I can see that you have an attachment with a Missing Image
, which will then show up with the error message:
You can fix this problem by simply setting the Atlas Assets
Size
to 0 as shown here:
Then everything will import correctly and you can drag the skeleton into your scene and use it as usual.
Thanks. But when I do that modification (1 -> 0) and drag it to scene and start playback the log shows multiple errors
IndexOutOfRangeException: Index was outside the bounds of the array.
Spine.Unity.SkeletonGraphic.get_mainTexture () (at Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphic.cs:144)
UnityEngine.UI.Graphic.UpdateMaterial () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:562)
UnityEngine.UI.Graphic.Rebuild (UnityEngine.UI.CanvasUpdate update) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:539)
Spine.Unity.SkeletonGraphic.Rebuild (UnityEngine.UI.CanvasUpdate update) (at Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphic.cs:157)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:198)
UnityEngine.Canvas:SendWillRenderCanvases()
and
IndexOutOfRangeException: Index was outside the bounds of the array.
Spine.Unity.SkeletonGraphic.get_mainTexture () (at Assets/Spine/Runtime/spine-unity/Modules/SkeletonGraphic/SkeletonGraphic.cs:144)
Spine.Unity.Editor.SpineEditorUtilities+DataReloadHandler.ReloadAllActiveSkeletonsEditMode () (at Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs:408)
Spine.Unity.Editor.SpineEditorUtilities+DataReloadHandler.OnPlaymodeStateChanged (UnityEditor.PlayModeStateChange stateChange) (at Assets/Spine/Editor/spine-unity/Editor/SpineEditorUtilities.cs:368)
UnityEditor.EditorApplication.Internal_PlayModeStateChanged (UnityEditor.PlayModeStateChange state) (at /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:302)
I do not receive any of the errors you described above.
You could try deleting the assets generated upon import (in your case only the SkeletonData file, since your have no atlas) and reimport the parent directory, maybe there are some problematic leftover modifications stored in the assets.
If the problem persists, which version of the Spine-Unity runtime are you using?
If you are not on the latest version, you can download it here:
Spine Unity Download