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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

SpriteAtlases keep changing their hash without sprites changing, polluting source control

Discussion in '2D' started by mh114, Oct 3, 2019.

  1. PedroSchabib

    PedroSchabib

    Joined:
    Oct 2, 2015
    Posts:
    10
    I have the same problem in Unity 2019.3.0f6. Every time I play the project, a new atlas is created for my sprites. And I noticed that this problem also generated a size of 3.6 GB of the "AtlasCache" folder. I was able to reduce this size to 6Mb by deleting the "Library" folder and re-porting the project. But that did not stop Unity from generating new Atlas each time it was played in the Editor.
    I use Anima2D in my project, I don't know if it can be related.
     
  2. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    618
    Hi @PedroSchabib
    Once the sprites are packed into a SpriteAtlas and there are no changes to both the Sprites and SpriteAtlas settings, it should never pack again as long AtlasCache folder remains. Also please ensure that there are no tools/plugins that could modify Sprite data. If its not the case, kindly submit a bug report with a simple repro project..
     
  3. PedroSchabib

    PedroSchabib

    Joined:
    Oct 2, 2015
    Posts:
    10

    I'm not sure but is possible Anima2D is responsible for this behaviour. I think Anima2D modify Sprite data everytime at I press play or in Editor.
    whatever, this problem don't happen in version 2019.2.8f1
    Thankyou
     
  4. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    618
    Please post/submit a simple repro project. We will take a look.
     
  5. PedroSchabib

    PedroSchabib

    Joined:
    Oct 2, 2015
    Posts:
    10
    Hi Venkify, I found the problem in my project. Is a conflict from Anima2D and 2D Animations plugins. I was creating a Sprite Mesh from Anima2D and a Skin in Skinning Editor from same Sprite. It´s forced the Editor to create a new Sprite Atlas everytime.
    Sorry, It´s my fault.
    Very Thankyou for atenction.
     
  6. a3dline

    a3dline

    Joined:
    Dec 28, 2013
    Posts:
    17
    Hi, in Unity 2018.4.16 SpriteAtlas got rid of the Hash record and now when we build on different machines, our AssetBundle has a different name in the texture of the atlas, which leads to a change in its MD5 Hash. How should I be in this case?
     
  7. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,449
    I'm using Unity 2018.4.22f1 and Unity keeps changing the "totalSpriteSurfaceArea" when I switch between different build targets.

    upload_2020-7-6_11-58-31.png

    Could you please fix that changing the build target does not modify the .spriteatlas asset in the "Asset" directory, but its data in the "Library" directory only?

    This is a problem when you work in a team and not everybody is on the same build target. Then the .spriteatlas assets appear changed in version control and everybody commits the changes over and over again, basically overwriting each other every single commit. Very uncool.

    Please fix. Thank you!
     
    mh114, DarekRusin and henriqueranj like this.
  8. Venkify

    Venkify

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    618
    Will take a look asap. Could you please post a simple repro project ? Thanks for posting.

    As long as the given sprites are the same, the area value should remain the same too. Will take a look asap. Please submit a bug report with a simple repro project and we will take a look asap.
     
  9. IOU_RAY

    IOU_RAY

    Joined:
    Jul 25, 2017
    Posts:
    119
    Necro time.
    I don't have time to jump on setting up a repro in trying to setup a specific state for an issue that is still happening halfway through 2021, but I would like to mention it still appears to be happening.

    v2020.3.2f1
    PlasticSCM
    keeps catching the changes....we did away with Collab, but it too used to catch this frequently.

    Changing platforms is probably the best bet for repro this. I understand it repacks the atlases on platform switches, or seems to, but only some of the files (not all atlases) seem to run into this issue.

    No override settings on the current selected platform (or ones switched from: win32/64) either. WebGL has an override but we don't platform switch to that; related?

    To be clear, this doesn't only happen on platform switches. It happens hitting play randomly, and then suddenly pending changes in commit, when absolutely nothing asset-related other than CS code has been changed.

    Anyways, we're used to this by now for years so I just wanted to chime in on this one that it still appears to happen if anyone ends up looking further into it.
     

    Attached Files:

    DarekRusin likes this.