Search Unity

Question 2020.3.15f2 'importing' at every editor launch

Discussion in 'Editor & General Support' started by Flavelius, Aug 9, 2021.

  1. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Hi,
    I'm not sure if it started there, but since 2020.3.15f2 it seems the editor is importing something (doesn't tell what) at every launch (opening the editor), even though no files changed since the last time it has been opened.
    This importing usually takes ~1:30 - 2 minutes on my laptop which seems quite unnecessary.
    Is this only happening for me, is this a known issue or a newer feature?
     
  2. aybe

    aybe

    Joined:
    Feb 20, 2019
    Posts:
    55
    • in the console top-right icon, Open Editor Log
    • then close Unity
    • clear the log, save
    • open Unity
    • wait for it load and import
    • check the log and see if you can find anything
     
  3. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Good idea; i did that. After restarting the editor this way it loaded noticeably faster, so the results likely have less informative value.
    But i found these entries that seemed somewhat interesting (//=my comment):

    Shader import version has changed; will reimport all shaders... //makes no sense to me, as nothing has changed inbetween
    ReloadAssembly (6356ms) //acceptable time?
    RefreshProfiler: Total: 11938.194ms //not sure what that means
    ImportAndPostprocessOutOfDateAssets: 10960.169ms (10826.687ms without children) //that's probably what took a lot longer earlier, but when do assets get 'out of date', just by resting on disk?
    RefreshProfiler: Total: 2300.819ms //again
    ImportAndPostprocessOutOfDateAssets: 2088.746ms (5.496ms without children) //also again
    [Project] Loading completed in 36.870 seconds //approximately how long it took this time
     
  4. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    These lines seems to take the longest according to the logs whenever i start the editor after a reboot:
    ImportAndPostprocessOutOfDateAssets: 53168.224ms (53030.811ms without children)
    In my project i have a few custom scriptableobjects with subassets (located in Resource folders), very few art assets (still prototyping stage) and some thirdparty assets, mainly Amplify shader editor, Odin inspector, Animancer, UltEvents & TextMesh pro.

    What does ~out of date asset~ mean to the importer?
     
    Last edited: Aug 11, 2021
  5. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Can i somehow enable the progressbar to display what the importing currently processes? So i atleast know what to look out for.

    Edit: i updated to .16f1 and it seems to be around 30s faster, but that could also be due to deleting library and trying other things in the meantime
     
  6. gonen_unity

    gonen_unity

    Joined:
    Nov 29, 2020
    Posts:
    5
    You can use the example code here to find what files are imported, maybe that will help a little:
    https://docs.unity3d.com/ScriptReference/AssetPostprocessor.OnPostprocessAllAssets.html
     
  7. Desoxi

    Desoxi

    Joined:
    Apr 12, 2015
    Posts:
    195
    I have the same issue, and I know from my colleagues that they are experiencing very long "import" times when opening a unity project.

    Sometimes, when it is somehow frozen, I kill the task with the task manager and re-open the project, which leads to nearly no loading time at all.

    I will try to capture this the next time it happens (every day).
     
    chelnok likes this.
  8. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    I used OnPostProcessAllAssets to log imported assets and it's just two prefabs, one for UI (single script, references one other prefab) and one with 5 scripts that mainly reference each other via a single serialized field, with one that has 5 serialized properties.
    This shouldn't take ~1 minute to import in my opinion, and shouldn't even import at each startup.
     
  9. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    It would be helpful if anyone from unity could explain why the editor needs to import things at every launch
     
  10. altepTest

    altepTest

    Joined:
    Jul 5, 2012
    Posts:
    1,119
  11. Andrew900460

    Andrew900460

    Joined:
    Aug 9, 2017
    Posts:
    40
    For whatever reason, the issue has gone away for my now, so many things have changed since then, so Idk what it was.
    This is a thread I posted a while back, I'll just connect it back here again
    https://forum.unity.com/threads/lau...mporting-busy-for-xx-xx.1166429/#post-7501084

    It may be fixed in 2021.1.27f
    Or it may be fixed due to a temp/cache file I had that got deleted.

    You can read the new post I made at that thread link ^^^
     
  12. Andrew900460

    Andrew900460

    Joined:
    Aug 9, 2017
    Posts:
    40
    The issue has came back.

    I have a feeling it may be caused by a specific package. Im not sure.

    So if anyone else is having the same issue, if we can share the list of packages we are using with unity, we can possibly figure out which package might be causing the issue.
    I know it can't be URP, because I've tested a blank project with URP, and all of it's "sibling" packages.
     
  13. gonen_unity

    gonen_unity

    Joined:
    Nov 29, 2020
    Posts:
    5
    Are you using substance?
     
  14. Andrew900460

    Andrew900460

    Joined:
    Aug 9, 2017
    Posts:
    40
    nope

    The only "odd" packages I'm using are
    Text Mesh Pro
    Unity Recorder
    Cinemachine
    Animation Rigging

    ... To be honest, I'm not using some of these packages, maybe I should remove them.
    Either way. This isn't all of them. Im just trying to think which one might be causing an issue.

    I will say that I think in 2021.2 they are adding diagnostic features to help figure out what might be causing the issue.
    So you can also try one of their latest releases of that and see if you can figure anything out. Or maybe the hanging won't even happen in that version. idk

    Also, another suggestion would be to basically create a new blank Unity Project (same version as your current). And copy all your most important files from your current project folder, over to the new one.
    So: Code, Art, Audio, Assets, etc.
    Don't copy things over that you don't need. Also, make sure to copy the .meta files for respective files, or all your inspector references will be broken. But copy anything over, not including external plugins (at first).

    Then, try to open that "dummy project", if you get any errors, try to resolve those errors by installing any packages that shoudn't cause issues. Until you've resolved any console errors, and the game can run.

    Lastly, close that dummy project, restart your computer. And re-open the dummy project, and see if it opens without freezing.
    If it succeeds, then anything that is different between the dummy and your main project is what is causing the issue.
    If it fails, it's probably somthing that is important to your project running, which sucks. But that means it's a Unity issue and they have to fix it.

    But the dummy project is now your "version" that runs, which is also good. And you can consider treating that as your main project, or, copying the files back to the main project folder, and removing the existing ones. So you woud've essentially "stripped" your project of any stuff that you never really needed to begin with. And will probably even improve loading times, maybe.
     
  15. Andrew900460

    Andrew900460

    Joined:
    Aug 9, 2017
    Posts:
    40
    Another thing I should point out..

    In the bottom right corner of the editor, there will be a blue progress bar that shows if something is happening in the background. And many times it will show "Updating Asset Search Index". Which I believe is connected to the new search tool they added.

    The weird thing is that originally the tool was a separate plugin (if I'm correct) that you had to install. But right now I don't see anything in the package manager for uninstalling it. Like I can't even remove the search tool to see if that's what's causing the issue. Because in the past I've been in situations where the Background Tasks would show "Updating Asset Seach Index", but never finish.
    So maybe it's connected to that? Idk.
     
  16. Andrew900460

    Andrew900460

    Joined:
    Aug 9, 2017
    Posts:
    40
    I decided to take my own suggestion, and "trial and error" my project by copying the files to a blank project. And trying to see which STUFF was the root cause of the issue. It turns out that it doesn't seem to be any of my files. (like no infinite loops that I may have produced)

    But it was 2 packages I use from the asset store.

    Odin Inspector
    and
    Behavior Designer

    Both are very popular packages, but for some reason they seem to be causing Unity to hang on startup. I first Removed Behavior Designer from the "dummy project". And that seemed to work.
    But I also made an additional blank project, only added Behavior Designer, and it opened fine. But then after adding Odin Inspector to this newest blank project. It now does the hanging as before.
    But in this case, the project is BASICALLY BLANK. Nothing in it.
    So something is happening inside unity and when it tries to import something, it gets stuck in a loop.

    I will also try and update this dummy project to 2021.2 and see if that changes anything because I have a good feeling it might. And when I do that, I'll update here.
     
  17. altepTest

    altepTest

    Joined:
    Jul 5, 2012
    Posts:
    1,119
    if this odin inspector is something that adds or is related to custom interface then it may be related with random issues I've had with assets that have custom editors interface included.

    So unity changed something related with the custom interface and some assets had been broken and may create strange issues.
     
  18. Andrew900460

    Andrew900460

    Joined:
    Aug 9, 2017
    Posts:
    40
    I updated my project to 2021.2.7f1
    And I don't get the hanging anymore, thankfully!

    To say once more, for the sake of testing/verification.
    • I made a blank project in 2021.1.27f1 (the version where I had the issue).
    • I imported those 2 packages (which I determined were causing the hanging) into the blank project. [Odin and Behaviour]
    • After that, the blank project would hang as expected. Proving the issue was partly caused by those packages.
    • Lastly, I took that blank project and updated it to 2021.2.7f1
    • After doing that, the project opened with no issues. There were some API changes that happened for URP, but that was because a lot of URP stuff was still in an experimental phase. So it got automatically updated.

    So I did this isolated experiment to verify for myself that updating to 2021.2.7f1 would actually fix the issue for other people, along with myself.
    And it appears that the issue is simply gone, so they must've fixed it. I kinda doubted it would've been fixed, but it is!
     
  19. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    680
    Whow! This actually worked. It was not frozen, unity just wanted for no reason to reimport everything (again) when opening project. I force quit unity (when importing) and reopened the project. Had to do it couple times but it worked. And i tried to quit and open again and no reimport.

    This was second time now when unity randomly wants to reimport everything when opening project. Kinda annoying when project is like 100 GB.

    edit: everything seems to be working just fine
     
    Last edited: Jun 6, 2023
    known2204 likes this.