Search Unity

Asset importers are treating meshes as read only in batch mode (IN-22969)

Discussion in 'Editor Workflows' started by KAJed, Dec 2, 2022.

  1. KAJed

    KAJed

    Joined:
    Mar 15, 2013
    Posts:
    122
    There is an issue with mesh importers during batch mode, specifically having to do with not using -quit and having the editor persist past a single frame.

    The bug as reported (with the bug number listed in the thread title)

    ========================
    1. What Happened

    "Not allowed to access uv on mesh 'xxxxxx' (isReadable is false; Read/Write must be enabled in import settings)"

    When running in batch mode Unity is not allowing meshes to be read during the import process through a processor.

    More specifically: if -quit is false, and we use a Task to delay past the first frame. If -quit if present or the import action happens before the task delay (usually I use UniTask for this) then Unity will produce the error.
    ========================

    The mesh in question is being modified inside OnPostprocessModel of an AssetPostprocessor.

    All of this works correctly while the editor is open, as well as when the editor is running in -quit mode (it actually works outside -quit mode as well as long as it's done within the first frame)

    The bug has been closed by whomever is assigned to it due to not understanding the mesh import process. Some help would be appreciated.
     
    mattst_bbb likes this.