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

Anyone else having Sprite Packer crashing? Known workarounds?

Discussion in 'Editor & General Support' started by Wisteso, Mar 9, 2015.

  1. Wisteso

    Wisteso

    Joined:
    Nov 17, 2013
    Posts:
    50
    Seems that the Sprite Packer in Unity 5.0 has some very crash-prone code (happens about 50-75% of the time when running the game in editor). Curious if anyone knows what is causing this, or if there is a known workaround? (Besides disabling sprite packing)

    Code (csharp):
    1.  
    2. ... snip ...
    3. -     Placed sprite in page (  3) at (   0, 1606). Page is now (1542, 1918). Sprite: "Centrifuge_Tooth08".
    4. -     Placed sprite in page (  3) at (  51,    0). Page is now (1542, 1918). Sprite: "Bio_Switch".
    5.  
    6. Dereferencing NULL PPtr!
    7. UnityEditor.Sprites.Packer:RebuildAtlasCacheIfNeeded(BuildTarget, Boolean, Execution)
    8. UnityEditor.Sprites.Packer:RebuildAtlasCacheIfNeeded(BuildTarget, Boolean) (at C:\buildslave\unity\build\artifacts\generated\common\editor\SpritePackerBindings.gen.cs:64)
    9. UnityEditor.Sprites.PackerWindow:DoToolbarGUI() (at C:\buildslave\unity\build\Editor\Mono\Sprites\SpritePackerWindow.cs:150)
    10. UnityEditor.Sprites.PackerWindow:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\Sprites\SpritePackerWindow.cs:284)
    11. System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
    12. System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    13. System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    14. UnityEditor.HostView:Invoke(String, Object) (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:244)
    15. UnityEditor.HostView:Invoke(String) (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:237)
    16. UnityEditor.DockArea:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:681)
    17.  
    18. [c:\buildslave\unity\build\runtime\baseclasses\BaseObject.h line 988]
    19. (Filename: /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs Line: 222)
    20.  
    Code (csharp):
    1. 0000000140D7468A (Unity) CachedSpriteAtlas::FindSpriteRenderData
    2. 0000000140D74C2F (Unity) SpriteAtlasCache::FindSpriteRenderDataMRU
    3. 0000000140D69E05 (Unity) SpritePacker::GetPackedSpriteRD
    4. 00000001403212DB (Unity) Sprite::RefreshAtlasRD
    5. 0000000140D6A399 (Unity) std::_Dest_val<std::allocator<BlockMask>,BlockMask>
    6. 0000000140D715A5 (Unity) Atlas::Pack
    7. 0000000140D7362E (Unity) SpritePacker::RebuildAtlasCacheIfNeeded
    8. 00000001412878B1 (Unity) Packer_CUSTOM_RebuildAtlasCacheIfNeeded
    9. 0000000041D61313 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.Sprites.Packer:RebuildAtlasCacheIfNeeded (UnityEditor.BuildTarget,bool,UnityEditor.Sprites.Packer/Execution)
    10. 0000000041D6120C (Mono JIT Code) [C:\buildslave\unity\build\artifacts\generated\common\editor\SpritePackerBindings.gen.cs:64] UnityEditor.Sprites.Packer:RebuildAtlasCacheIfNeeded (UnityEditor.BuildTarget,bool)
    11. 0000000041D55B92 (Mono JIT Code) [C:\buildslave\unity\build\Editor\Mono\Sprites\SpritePackerWindow.cs:150] UnityEditor.Sprites.PackerWindow:DoToolbarGUI ()
    12. 0000000041D525E1 (Mono JIT Code) [C:\buildslave\unity\build\Editor\Mono\Sprites\SpritePackerWindow.cs:284] UnityEditor.Sprites.PackerWindow:OnGUI ()
    13. ... (snip) ...
    14.  
    Ive submitted a bug for this, but it does not have a reproduction case, since I do not have the authority to try and strip our project down to the base essentials, watermark all of our sprites, etc etc - since it seems to only happen with our project, as far as I know.
     
    Last edited: Mar 9, 2015
  2. Wisteso

    Wisteso

    Joined:
    Nov 17, 2013
    Posts:
    50
    If anyone else runs into this issue, the solution seems to be deleting your non-essential / temporary folders and letting Unity re-generate them. In my case, I deleted "Library", "Temp", and "obj".

    So far the issue has yet to re-occur (crossing fingers). My guess is that there were still lingering library files from my Unity 4 -> 5 upgrade that were causing issues.
     
    WiedemannD likes this.
  3. Helical

    Helical

    Joined:
    Mar 2, 2014
    Posts:
    50
    experiencing the same
     
  4. WiedemannD

    WiedemannD

    Joined:
    Mar 4, 2015
    Posts:
    19
    @Wisteso : THANK GOD you posted this!! I was going nuts about it, already thinking about needing to switch to a third party sprite packer and essentially throwing away work of several months.

    SOLUTION: Deleting the Library folder and let unity rebuild everything from scratch!