Search Unity

Updating to 3.0.4 causes entire project to re-import

Discussion in 'UGUI & TextMesh Pro' started by JohnnyFactor, Mar 11, 2021.

  1. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I upgraded a project this morning from 2019.4 to 2020.3. After importing for 2 hours there were no issues, so I checked the Package Manager to update any outdated packages. Updating TextMesh Pro from 3.0.1 to 3.0.4 caused the entire project to re-import and I'm looking at another 2 hours. Is this a known issue? Have I found a bug?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    It is a known issue which appears to be specific to having the Android platform selected. This behavior does not occur if Window, Mac, Linux is the selected platform.

    I believe that when upgrading from 2019.4 to 2020.2 or 2020.3, all textures get re-imported again when Android is the selected platform. Then for some reason when upgrading the TMP package from 3.0.1 to 3.0.4 the same textures all get re-imported again.

    I looked into it last week but was not able to find any specific change in TMP between 3.0.1 and 3.0.4 specific to Android that would cause this issue.

    I'll provide an update when I have more information on this.
     
  3. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    My project is iOS though. Android option is not even installed so maybe it's something related to mobile in general. I hope that provides another clue for tracking this down.
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    It appears I was incorrect about the Android part as I am now seeing this behavior on other platforms as well.

    I still have not idea what possible change between version 3.0.1 & 3.0.3 and 3.0.4 that would cause textures to get re-imported.

    I'll keep investigating.
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Did some additional testing and the behavior is due to the removal of a Texture post processor. Basically the importer mechanism tracks importers and processors and when these change, it triggers a re-import.

    In our case, this processor only tracked changes to textures but never did anything other than issuing a callback to let TMP know that some resource has changes or been modified outside the project, deleted, etc.
     
  6. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    So now that you know what's causing it, is there any way to prevent this from happening? I've seen this already on a couple of test projects after upgrading to Unity 2020.3.3, and updating packages to the latest versions. It wasn't such a big deal for them, since they were all pretty small, but I'm reluctant to do the same with my main project, which is substantially bigger. Considering that I don't really use TMP much, it seems wrong that it takes so much time to update.
     
  7. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Just to re-iterate...
    Upgrading between Major versions of Unity will trigger a re-import.
    Then any changes in a package where an AssetPostProcessor script is added or removed will also trigger a re-import. This is by design as per the team managing this area.

    In regards to TMP, the problem is that if I re-add the post processor in the next release then those who have already upgraded to the latest release of TMP will be forced to go through a re-import of the textures again which would be bad.

    Having said that here is a trick that should work. Assuming your larger project hasn't been upgraded yet, you could edit the "Packages/manifest.json" file to modify the entry for the TMP package to point to the latest release which would be as follows for Unity 2020.x.
    Code (csharp):
    1.  "com.unity.textmeshpro": "3.0.4",
    This edit has to be done outside of Unity just before opening the project in the new version of Unity. As expected because you would be upgrading from 2019.4 to 2020.x, the textures would get re-imported but since this project would already be indicated to use version 3.0.4, the 2nd re-import when going from version 3.0.1 to 3.0.4 would be skipped.

    I just tested this going from 2019.4 to 2020.3.3f1 and it worked as expected.
     
    FargleBargle likes this.
  8. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    That's just what I wanted to hear. I knew I was going to be waiting a long time for the first re-import, but was hoping to avoid doing it twice, especially if the second time wasn't strictly necessary. Your suggestion was a great help.
     
    Stephan_B likes this.