Search Unity

TextMesh Pro Why does TextMeshPro update causes reimport of all textures?

Discussion in 'UGUI & TextMesh Pro' started by Peter77, Feb 27, 2021.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    I updated TextMeshPro from 3.0.1 to 3.0.4 (Unity 2020.2.0f1, Windows Editor, Android Target), which then caused a reimport of all textures in the project.

    Why is that?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I had an earlier report of this but was not able to reproduce it.

    I cannot think of anything in this latest release that would cause this. There is an AssetPostprocessor which has been in the package since many releases ago, but it uses OnPostprocessAllAssets which would only get called if either font assets or textures have been modified.

    Did you upgrade Unity at the same time? Perhaps this re-import is related to some other changes in Unity?

    EDIT:
    Just tested upgrading a project from Unity 2020.1.17f1 using version 3.0.1 with Android as platform to Unity 2020.2.5f1 still using version 3.0.1 and all textures were reimported.

    Doing the same process with PC, Mac & Linux Standalone as platform and upgrading to Unity 2020.2.5f1 did not reimport the textures. Seems like some Android change perhaps related to texture compression might be the culprit.
     
    Last edited: Feb 27, 2021
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    Yes, actually I did. I upgraded from 2019.4.20f1 to 2020.2.0f1. After the editor opened, I updated TMP from 3.0.1 to 3.0.4 and then the editor started to reimport all textures (which it did just a minute earlier due to the Unity update).
     
  4. bstockwell

    bstockwell

    Joined:
    Apr 6, 2018
    Posts:
    7
    Can confirm that have run into the same issue. But this was some time after updating the project to 2020.3.6f

    Last week we updated our project to 2020.3.6f - Unity finished its initial reimport on Thursday I would say.

    Today I was checking for packages that need to be updated, and I decided to update TextMeshPro from 3.0.1 to 3.0.6

    After clicking update it ended up doing what looked like a full reimport of Textures and FBX files - took about 40 minutes for a project with around 4k FBX files and 5k different textrues.

    Hoping that when I commit this to the repo it doesn't cause the same re-import for everyone else but will find out soon.

    EDIT:
    One thing to note is that after the re-import, nothing was marked as Modified in my Source Control, so its not clear why it needed the re-import. (manifest.json and packages-lock.json were modified by that is normal for packages updating)

    EDIT 2:
    Our platform is PC, Mac & Linux Standalone (since the post above mentioned it only happened for them on android)
     
    Last edited: May 3, 2021
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The reason for the re-import is related to how Unity handles changes to Asset Importers where when changes to an Asset Importer are detected (addition or removal) it triggers a re-import. In this particular case, I removed OnPostprocessTexture which although I removed it is resulting in this re-import.

    Migrating to new major release of Unity also trigger a re-import. I did upgrade the default TMP package to 3.0.5 when migrating from 2019.4 to a newer version of 2020 would trigger the re-import but since the newer version of 2020 would include TMP 3.0.5 instead of 3.0.1, only one re-import would occur.

    The challenge now is that if I revert the changes, then those who have already upgraded would go through the re-import so we are kind of stuck there. If I had known about the Asset Importer behavior, I would have most certainly handled it differently.