Sergey

  • 12 ноя 2024
  • Регистрация: 3 апр 2024

    This is what I was talking about:
    https://forum.unity.com/threads/cal...-during-asset-importing.1517806/#post-9488617

    As I understand it, yes, this is a problem with Unity. And it is likely to affect the capture of multiple additions of SkeletonData.

    I have already solved the problem bypassing it. And I found the information incidentally. But I will be happy if this helps you improve the product.

    Harald

    No, I have not received any warnings.
    I thought that it might not be displayed, as AssetDatabase.CreateAsset() is called through your handler.
    I did not continue investigating the problem. I implemented a workaround using a preprocessor.

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

      Sergey
      The photo I promised

      I think for now I will use a workaround with OnWillCreateAsset(string assetName). All created objects come there, without exceptions.

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

        Harald
        Yes, the issue persists. It seems like these are unrelated cases.
        We've opted out of Parallel Importing in our project in favor of working presets.

        Regarding adding multiple animations simultaneously. SkeletonData is created from OnPostprocessAllAssets using the AssetDatabase.CreateAsset method. This method CreateAsset in the code has an attribute with a comment:
        "[PreventExecutionInState(AssetDatabasePreventExecution.kImportingAsset, PreventExecutionSeverity.PreventExecution_Warning, "AssetDatabase.CreateAsset() was called as part of running an import. Please make sure this function is not called from ScriptedImporters or PostProcessors, as it is a source of non-determinism and will be disallowed in a forthcoming release.")]"

        I believe this is exactly what prevents my code from executing when adding each animation. I attach a photo of my code.

        • Sergey ответили на это сообщение.
          • Изменено

          Harald
          I have a problem with this approach when I transfer two or more animation folders into the project. OnPostprocessAllAssets catches only the last created _SkeletonData.asset. The rest of the created _SkeletonData.asset files do not trigger this callback.

          Unity version 2022.3.22f1

          When enabling the setting in Unity Project Settings>Editor>Parallel Import,
          Animation import presets stop working. Apply Atlas Texture Settings toggle becomes useless.