Author Topic: UIAtlasMaker exception  (Read 50331 times)

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
UIAtlasMaker exception
« on: February 13, 2013, 08:00:34 PM »
I frequently see this exception when updating my atlas. After the exception, sometimes the atlas is updated, sometimes it is not. Kind of puzzled what's going on. Thinking about reverting back to TexturePacker instead. Has anyone else seen this problem and/or bug reported it?

MissingReferenceException: The object of type 'Texture2D' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
  at (wrapper managed-to-native) UnityEngine.Object:get_name ()
  at UIAtlasMaker.ExtractSprites (.UIAtlas atlas, System.Collections.Generic.List`1 sprites) [0x00069] in /Users/alexr/Desktop/ChickenFoot/CD Unity project/Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:473
  at UIAtlasMaker.UpdateAtlas (System.Collections.Generic.List`1 textures, Boolean keepSprites) [0x00019] in /Users/alexr/Desktop/ChickenFoot/CD Unity project/Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:647
  at UIAtlasMaker.OnGUI () [0x008dc] in /Users/alexr/Desktop/ChickenFoot/CD Unity project/Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:923
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000d0] in /Applications/buildAgent/work/27593436b7e20640/mcs/class/corlib/System.Reflection/MonoMethod.cs:222

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #1 on: February 13, 2013, 10:31:22 PM »
Nope, can't say I've seen this.

Nexic

  • Guest
Re: UIAtlasMaker exception
« Reply #2 on: April 18, 2013, 03:15:19 PM »
I have been having this problem today, was about to give up when I realized that all the problems started since I begun using the Cache Server. Disabled it and Atlases work like a charm again. Just thought the community here might like to know that one.

Bilko

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: UIAtlasMaker exception
« Reply #3 on: June 15, 2013, 09:42:31 AM »
When I try to create an atlas I get the following error also:

MissingReferenceException: The object of type 'Texture2D' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UIAtlasMaker.AddSprite (System.Collections.Generic.List`1 sprites, .SpriteEntry se) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:225)
UIAtlasMaker.ReplaceSprites (.UIAtlas atlas, System.Collections.Generic.List`1 sprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:387)
UIAtlasMaker.UpdateAtlas (.UIAtlas atlas, System.Collections.Generic.List`1 sprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:563)
UIAtlasMaker.UpdateAtlas (System.Collections.Generic.List`1 textures, Boolean keepSprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:620)
UIAtlasMaker.OnGUI () (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:903)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)


I am using NGUI 2.6.2 2.6.3 is not on the asset store yet.

I thought it was a FastGUI issue however it does the same error even when I remove anything fast GUI related.

Any ideas on how to fix this? Note I do not have the cache server enabled like the previous user.

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #4 on: June 15, 2013, 05:58:18 PM »
Make sure you save after every modification to the atlas and restart Unity for good measure.

Bilko

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: UIAtlasMaker exception
« Reply #5 on: June 17, 2013, 04:49:57 AM »
Hello again;

I can not even create an altas, the ONLY way I can get it to build is if I uncheck the PMA shader, however then the atlas is not correct. I can not update the atlas or anything with that checked.

I hope this gives you a little insight to the issue. I look forward to your reply.

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #6 on: June 17, 2013, 10:11:40 PM »
I've narrowed down the issue. It only happens the very first time you try to create an atlas in a brand-new instance of Unity. When it happens, delete the files it created (material, prefab, and texture), and re-do the atlas creation. Second time onwards works just fine.

I'll add in a proper fix to the next release.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #8 on: June 18, 2013, 12:16:16 AM »
2.6.3 has the fix.

CazicThule

  • Guest
Re: UIAtlasMaker exception
« Reply #9 on: June 30, 2013, 08:03:01 AM »
Got the latest version, restarted Unity and I'm still getting this error. I'm not using "cache server". Can't add anything to an atlas...
« Last Edit: June 30, 2013, 08:11:37 AM by CazicThule »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #10 on: June 30, 2013, 09:55:44 PM »
Verify that you actually have the latest version. Open up your readme file -- what version does it say you have?

CazicThule

  • Guest
Re: UIAtlasMaker exception
« Reply #11 on: July 01, 2013, 05:01:44 AM »
ReadMe - 2.6.3

Lexile

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UIAtlasMaker exception
« Reply #12 on: July 01, 2013, 05:07:00 AM »
Updated my Unity editor to 4.2.0f1 and I'm getting this bug now. Two things happen when I touch atlases now:

1. I get the error message described in OP's message -> Can't add any new sprites.

2. Even if the atlas maker doesnt add/update anything, the behaviour of some sprites change. Ie. a stretched sliced sprite i'm using as a background suddenly becomes pixelated, and I can't fix it without reverting to a backup project file.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #13 on: July 01, 2013, 11:38:14 PM »
An issue in the latest beta, perhaps?

The original issue is not possible because the code is completely different there now. Texture is never used directly anymore. Its name is saved and used instead. I need new line numbers and console log of the issue you are running into.

Lexile

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UIAtlasMaker exception
« Reply #14 on: July 02, 2013, 01:32:30 AM »
Seems the lates beta wasn't somehow wasn't compatible with my old project. Started a new one and I don't seem to be getting any of those errors any more, even though had to redo a couple of hours of work.