Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by _____nakj · Sep 10, 2017 at 12:43 AM · sprite packer

.spriteatlas hash is recalculate to another value very often.

I am using new sprite atlas feature that is built in since Unity2017.

It will works almost fine. But there contains hash numbers are recalculate very often. It represented when even i didn't modified anything. I just played the editor.

 %YAML 1.1
 %TAG !u! tag:unity3d.com,2011:
 --- !u!687078895 &4343727234628468602
 SpriteAtlas:
   m_ObjectHideFlags: 0
   .... lines ....
     packedHash:
       serializedVersion: 2
       Hash: f2629172dcecfa8f7bdf787bd034f4df
   .... lines ....
     hashString: f2629172dcecfa8f7bdf787bd034f4df
   .... lines ....

This is part of .spriteatlas asset file contents. You could see two lines of hash number that issues.

I have a question. When does Unity modifies that hash numbers? And what are these hashes generated based on?

Best Regards.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by okuligowski_huuuge · Oct 09, 2017 at 07:24 AM

I have the same issue.

I think hash is based on a target platform. This could mean that if 1 dev is working on Android and other on iOS, then both programmers will override each others hashes on a repository. But thats just my theory.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by Benzor · Nov 06, 2017 at 08:07 PM

Unity regenerates the hash every time the sprite atlases are repacked. Presumably the packing process is non-deterministic, meaning every time it repacks, you'll get a slightly different atlas and with a different hash.

Check your project editor settings (Edit > Project Settings > Editor), and under Sprite Packer > Mode you most likely have the setting Always Enabled . This is fine if you want to test your sprite atlas packing in the editor so you can debug sprite batching issues or similar, but it's not necessary to permanently work this way. Change it to Enabled For Builds and it will only repack the sprite atlases when you perform a build. This will minimize changes for your version control.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image gfaraj · Jan 10, 2018 at 06:06 PM 0
Share

This doesn't help much since every time a build is done, the file will be marked as changed in source control. Any other ideas?

avatar image Benzor gfaraj · Jan 10, 2018 at 07:51 PM 0
Share

I agree, it's annoying and it's something Unity should fix. As a workaround though, you can write a batch script which runs your build using Unity's command line client, then clears out any uncommitted changes. Just make sure to commit any important changes before running it!

avatar image SweatyChair · Apr 11, 2018 at 12:18 AM 0
Share

A Unity guy said it's fixed, but I still got it in 2017.3.1f1....

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

74 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Sprite Atlas split into 2 by Unity, why? 0 Answers

SpriteAtlas Compression 0 Answers

how to use tk2d Sprite with NGUI Camera? 1 Answer

Sprites are stretched after packing with sprite packer 1 Answer

Sprite Atlas not working 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges