Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

What is the purpose of the '/Library/Occlusion' folder?

Discussion in 'Editor & General Support' started by SilverFoxGames, Jul 22, 2014.

  1. SilverFoxGames

    SilverFoxGames

    Joined:
    Jun 21, 2014
    Posts:
    3
    As the title implies, I'm curious as to what the exact nature of this folder and its contents is. I've recently been transferring a few of my Unity project folders to my new iMac using an external hard drive, and the file copying process to the iMac from the external hard drive kept getting stuck when 'preparing files to be copied'. I ended up tracking the issue to the '/Library/Occlusion' folder by copying each individual file from one of the projects to a new folder on the iMac, and when it came to copying the '/Library/Occlusion' folder across it became stuck while preparing to copy the file, forcing me to cancel the transfer and force quit/relaunch the finder.

    I know there's generally a 'Don't ever touch the Library folder or the very fabric of reality will collapse in upon itself' rule, but I launched the copied project in Unity on the iMac without the Occlusion folder present and everything seems to run fine, which leads me to wonder what Umbra is doing with a folder filled with several million .umbracache files?

    So if someone can provide a definitive answer explaining the folder's purpose and what Umbra is planning to do with all of those .umbracache files, it'd do a great deal to satiate my curiosity and quell my concerns that I may have just been forced to remove something important from the project.

    Cheers!
     
  2. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Umbra stores temporary data generated during a bake in that folder. You can safely delete it.

    BTW, if you have .meta files enabled (and since Unity 4.<don't remember> we enable them automatically but hide them by default), you can always delete the Library/ folder without any ill-effects. Basically, your source assets in combination with the .meta files are all the data Unity needs to recreate the data in the Library folder.
     
  3. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    958
    Depends on whether you count "waiting a long time while textures and models reimport" as an ill-effect, of course... ;-)
     
  4. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Ha, true :) Cache server is a "nerve-saver" in that case :)
     
  5. SilverFoxGames

    SilverFoxGames

    Joined:
    Jun 21, 2014
    Posts:
    3
    Ah okay, that's good to know, thanks for the information.
     
  6. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Hey Rene, this documentation needs some love: http://docs.unity3d.com/Manual/BehindtheScenes.html

    It claims: "All metadata for assets is stored in the Library folder. As as user, you should never have to alter the Library folder manually and attempting to do so may corrupt the project."

    Which I think is somewhat misleading these days since it's perfectly safe (and sometimes recommended) to delete the Library folder if you have .meta files enabled.
     
  7. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Indeed, the page is not very current anymore. Rewrote the second half to read like this:

     
  8. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Excellent, thanks Rene!

    Small typo in last para: 'Assetsand'

    Should this be qualified with 'since version X.X where we introduced forced .meta files' or similar? (just thinking that some poor 3.x user may read this and cause themselves some severe pain :) )
     
  9. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Nice catch :) Turns out this was just a copypaste problem after snipping things out of the doc preview.

    Good point. Added

     
    larku likes this.
  10. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Great stuff!

    Thanks.
     
  11. Teo

    Teo

    Joined:
    Oct 31, 2009
    Posts:
    564
    Out of curiosity, wasn't any way to put all that cache into a zip archive.. having zillions of under 1k files in a directory isn't a good idea.
     
  12. Dirrogate

    Dirrogate

    Joined:
    Feb 18, 2014
    Posts:
    157
    >>Out of curiosity, wasn't any way to put all that cache into a zip archive.. having zillions of under 1k files in a directory isn't a good idea.

    1 year later, we still have those zillion 1kb files. This is doing wonders for de-fragging drives and lifecycles of SSDs. ;)
     
    scarletsnake and ArachnidAnimal like this.
  13. scarletsnake

    scarletsnake

    Joined:
    Nov 27, 2009
    Posts:
    101
    This is such a pain in the @$$... Not only is occlusion not working properly, but its now made it near impossible for me to make backup copies of my project folder without having to go through minutes upon minutes of deleting files...
     
  14. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    128
    I just ran into this devil of a problem. What a pain! This could definitely be managed better then it's current design. 90k files regardless of file size take an enormous amount of time to do anything with.
     
  15. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    204
    I have 2M files in occlusion folder !
     
  16. GameRickster

    GameRickster

    Joined:
    Apr 28, 2018
    Posts:
    14
    files are still there.. 945,293 of them.
    :)
     
  17. Ruuds

    Ruuds

    Joined:
    Dec 3, 2017
    Posts:
    16
    Is there any fix for this? It is litteraly faster for me to wipe my hard drive and reinstall windows than deleting my Unity Project. what is this madness?
     
  18. frankadimcosta

    frankadimcosta

    Joined:
    Jan 14, 2015
    Posts:
    204
    Use DOS prompt commands to delete folders


    rmdir /s PATH\TO\FOLDER-NAME

    without confirmation:
    rmdir /s /q PATH\TO\FOLDER-NAME