• EditorBugs
  • 我最近为这个资产增加了皮肤,但是在导入unity时,报错了

我在导入资产时报错了,这个资产是我以前一直用的,我最近为这个资产增加了皮肤,但是在导入unity时,报了一下错误:

Exception: Parent mesh not found: face_back_01
Spine.SkeletonBinary.ReadSkeletonData (System.IO.Stream file) (at Assets/Spine/Runtime/spine-csharp/SkeletonBinary.cs:354)
Spine.Unity.Editor.AssetUtility.AddRequiredAtlasRegionsFromBinary (System.String skeletonDataPath, System.Collections.Generic.List`1[T] requiredPaths) (at Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs:223)
Spine.Unity.Editor.AssetUtility.GetRequiredAtlasRegions (System.String skeletonDataPath) (at Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs:140)
Spine.Unity.Editor.AssetUtility.ImportSpineContent (System.String[] imported, System.Collections.Generic.List`1[T] texturesWithoutMetaFile, System.Boolean reimport) (at Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs:437)
Spine.Unity.Editor.AssetUtility.HandleOnPostprocessAllAssets (System.String[] imported, System.Collections.Generic.List`1[T] texturesWithoutMetaFile) (at Assets/Spine/Editor/spine-unity/Editor/Utility/AssetUtility.cs:117)
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:102)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <6aa56e57ab504395b555cf3ed50fa53d>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <6aa56e57ab504395b555cf3ed50fa53d>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <6aa56e57ab504395b555cf3ed50fa53d>:0)
UnityEditor.AssetPostprocessingInternal.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) (at <505360e321ae48e3804e227a34262e1e>:0)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets, System.Boolean didDomainReload) (at <505360e321ae48e3804e227a34262e1e>:0)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[], Boolean)

皮肤结构如下:

导出版本:4.2.20,导出参数:

  • Misaki ответили на это сообщение.
    Related Discussions
    ...

    根据你提供的信息和相关的论坛讨论,导入Unity时出现的错误可能是由于附件命名或版本不匹配的问题。

    1. 附件命名问题:在某些情况下,附件名称中包含特定字符(如“.png”)可能会导致导入错误。请检查你的附件名称,确保它们没有包含不必要的字符,并且与导出的纹理名称一致。例如,如果你的附件名称是face_back_01.png,请确保在导出时它被正确命名为face_back_01

    2. 版本不匹配:确保你使用的Spine-Unity运行时版本与Spine编辑器版本匹配。例如,如果你使用的是Spine 4.2.20版本导出的文件,请确保你的Spine-Unity运行时也是4.2版本。版本不匹配会导致导入失败。

    3. 导出设置:检查你的导出设置,确保它们符合Unity的要求。例如,确保“Pre-multiplied alpha”和“Bleed”选项设置正确。

    4. 重建项目:有时,重新打包和重建项目可以解决一些导入问题。确保你已经为正确的平台重建了资源包,并且所有修改都已更新。

    以下是一些具体的步骤来解决问题:

    • 检查并修改附件名称,确保它们与导出的纹理名称一致。
    • 确认Spine-Unity运行时版本与Spine编辑器版本匹配。
    • 检查并调整导出设置。
    • 重新打包和重建项目,确保所有修改都已生效。

    如果问题仍然存在,请提供一个最小的Unity项目示例,以便进一步分析和解决问题。

    tianlluo I'm not sure of the exact cause of the problem, but at least 4.2.20 is a bit old, and there have been quite a few bug fixes between it and the latest version 4.2.32, so I think it would be a good idea to try exporting from the latest version 4.2.32 and see if that solves the problem. If that doesn't solve the problem, could you send us the spine project files via email so we can reproduce the problem?: contact@esotericsoftware.com

    Please include the URL of this forum thread in the email so we know the context. Then we can take a look at what's wrong.

    • tianlluo ответили на это сообщение.

      Misaki 是导出后的文件,还是 spine 源文件?

      Misaki 我升级到4.2.32 导出后正常了,新版本确实解决了这个问题

      • Misaki ответили на это сообщение.

        tianlluo I'm glad to hear that the upgrade solved the problem! If you encounter any problems again, please send us the Spine project instead of the exported files, and we'll check it right away.

        @tianlluo Glad to hear the issue could be resolved. In general also always be sure to test with the latest version of the spine-unity 4.2 runtime, not just any version of the 4.2 spine-unity runtime, as we might have released bugfixes to the runtime as well.