Unity 2021.3.6f1 importation issue
Hello,
I'm trying to import a spine skeleton into Unity and I am running into some issues. I am using Unity 2021.3.6f1 on a empty 3D projet where I imported spine package spine-unity-4.1-2022-07-18.unitypackage. I rigged, animated and exported from Spine 4.1.06 (see export settings attached)
When importing into my project. I first run into these errors in the console : (see attached image error-import-01.PNG)
- Materials not set for atlas asset: skeleton_Atlas
- NullReferenceException: Object reference not set to an instance of an object
Spine.Unity.Editor.AssetUtility.GetMatchingAtlas (System.Collections.Generic.List1[T] requiredPaths, System.Collections.Generic.List
1[T] atlasAssets) (at Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs:231)
Spine.Unity.Editor.AssetUtility.GetMatchingAtlas (System.Collections.Generic.List1[T] requiredPaths, System.String skeletonName, System.Collections.Generic.List
1[T] atlasAssets) (at Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs:221)
Spine.Unity.Editor.AssetUtility.ImportSpineContent (System.String[] imported, System.Collections.Generic.List1[T] texturesWithoutMetaFile, System.Boolean reimport) (at Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs:404)
1[T] texturesWithoutMetaFile) (at Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs:113)
Spine.Unity.Editor.AssetUtility.HandleOnPostprocessAllAssets (System.String[] imported, System.Collections.Generic.List
Spine.Unity.Editor.SpineEditorUtilities.OnPostprocessAllAssets (System.String[] imported, System.String[] deleted, System.String[] moved, System.String[] movedFromAssetPaths) (at Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs:98) - An infinite loop has been detected when processing post process all assets callbacks.
In the folder nothing shows up. (see attached image project-panel-error01.PNG)
I then tried to drag and drop the spine files again and this time no additional error appeared but the files appeared duplicated in the folder and despite the skeleton_Atlas beeing crated, the material and skeleton data were not created.
For further information I also attached the skeleton data asset I tried to create then manually and the issue with the skeleton_Atlas material
I tried importing from Spine 4.0 and also tried importing in Unity 2020.3.10 and could only make work a project with Spine 4.0 Unity 2020.3.10 and Spine 4.0.64 package edit when reopening the project UNity 2020.3 and Spine package 4.0.64 I ran in this known error Assets\Spine\Editor\spine-unity\Editor\Utility\SpineBuildProcessor.cs(164,20): error CS0117: 'AssetDatabase' does not contain a definition for 'SaveAssetIfDirty'
Am I missing something or the current package is broken spine-unity-4.1-2022-07-18?
martindnastudios wroteWhen importing into my project. I first run into these errors in the console : (see attached image error-import-01.PNG)
- Materials not set for atlas asset: skeleton_Atlas
Unfortunately we could not reproduce the problem you are facing, import works as desired on our end. Are you sure that you copied all files exported by the Spine Editor (usually 3 files) to the same folder in your Unity project? If so, could you please share your problematic assets with us? You can either attach them to a forum posting here, or send us a zip package to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context.
martindnastudios wroteI rigged, animated and exported from Spine 4.1.06 (see export settings attached)
Please note that you might want to disable Animation cleanup
to avoid some problems as described here (unless you are sure that you want to remove keys identical to the setup pose).
martindnastudios wroteI tried importing from Spine 4.0 and also tried importing in Unity 2020.3.10 and could only make work a project with Spine 4.0 Unity 2020.3.10 and Spine 4.0.64 package edit when reopening the project UNity 2020.3 and Spine package 4.0.64 I ran in this known error Assets\Spine\Editor\spine-unity\Editor\Utility\SpineBuildProcessor.cs(164,20): error CS0117: 'AssetDatabase' does not contain a definition for 'SaveAssetIfDirty'
Thanks for reporting and sorry for the troubles! There was indeed one fix missing in 4.0 which required backporting from 4.1. The fix is integrated now and a new 4.0 unitypackage is available for download here as usual:
spine-unity Download: spine unity unitypackages
Thanks for your answer, Yes I am 100% sure I drag and dropped all the files in the same folder at the same time. I have another rig made with spine 3.9 and I have no problem importing it with the corresponding package.
I just tried importing a simpler rig I just created and didn't have the infinite loop issue but still had no material created nor skeleton data when importing it.
I just sent the files to the email adress you mentionnned
Thanks for sending the reproduction assets. The problem seems to be that your atlas is missing a region named images/mouche
, which leads to the failing import. We could not reproduce any infinite loop as seen in your above screenshots.
I am suspecting that maybe the attachment image images/mouche
is completely transparent, and with Texture Packer Settings
Ignore blank images
enabled it might have been excluded from the atlas completely. Could you please check if that is the case and if so, disable Ignore blank images
?
Hello,
I tested the above suggestion. I deleted the file, exported with "ignore blank images" unchecked and had no warning when exporting from Spine.
I tried creating a new project again, and also installed the spine 4.1 package using the package manager in Unity instead of manually. I also ask a friend to try to import my files, and another rig's files on another computer and he had the same infinite loop issue with both rigs. (see attached screenshot import-infinite-loop.PNG)
The weird thing is that I can see the file in the folder but not in the Unity project window (see attached image infinite-loop-import-folder.PNG)
Do you have any idea? I can send the Unity project if it helps.
Update,
I was able to have my rig appear in Unity by doing everything manually. I did the following steps :
- Import the skeleton files in the folder
- Ignore the infinite loop error
- Import the skeleton files again in the same folder
- skeletons files appears twice with half beeing renamed ***_1
- delete the duplicated files
- create a new material and assign the skeleton texture
- create a new Spine Atlas and assign the material
- create a new Spine skeleton data and assign the .json and Atlas
- drag the skeleton on the scene.
Sorry to hear that your problem persists.
martindnastudios wroteI can send the Unity project if it helps.
Yes, please do send us a reproduction Unity project.