Author Topic: UIAtlasMaker exception  (Read 55103 times)

miyudreams

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 19
    • View Profile
Re: UIAtlasMaker exception
« Reply #15 on: July 02, 2013, 11:10:25 PM »
Hey, just got this problem today on NGUI v2.6.3, "MissingReferenceException: The object of type 'Texture2D' has been destroyed but you are still trying to access it." I didn't pay any attention to the stack trace. (should be a similar issue)

In my case it was because I updated the atlas, and there's a texture in the atlas that disappeared. But this texture was still being used in a widget added to my scene. Once I click on the "missing" texture and Add it back into the Atlas, I stopped getting this error. First of all, i don't know how the texture disappeared from my atlas. I only selected a bunch of textures that are currently in my atlas, and clicked the Add/Update button in the Atlas Maker, & I was changing the Padding property in the Atlas Maker.

CazicThule

  • Guest
Re: UIAtlasMaker exception
« Reply #16 on: July 05, 2013, 05:08:38 AM »
I'm not using the beta, I'm using 4.1.5f1

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #17 on: July 05, 2013, 08:24:11 AM »
That's what I use and I am able to create atlases just fine. I need some repro steps to go any further.

CazicThule

  • Guest
Re: UIAtlasMaker exception
« Reply #18 on: July 05, 2013, 05:16:53 PM »
Creating atlases works fine the first time, but any subsequent additions will get the Texture2d exception

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #19 on: July 05, 2013, 08:12:41 PM »
Again, works just fine. What's your target platform?

Bilko

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: UIAtlasMaker exception
« Reply #20 on: July 18, 2013, 07:35:55 AM »
I have NGUI 2.6.3 installed on Unity 4.1.5 and I still get the 2D texture error. Any ideas of a fix ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #21 on: July 18, 2013, 09:50:48 AM »
I don't even know how to reproduce the issue, let alone fix it. As I mentioned, I am not seeing it in Unity 4.1.5 + NGUI 2.6.3 on Windows.

Bilko

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: UIAtlasMaker exception
« Reply #22 on: July 19, 2013, 05:01:24 AM »
I am on a mac using Unity 4.1.5 + NGUI 2.6.3. I understand your not seeing it on your windows machine, but myself and quite a few others are getting this error (maybe only mac users). Is there a mac that you can borrow to try and trouble shoot this problem? Because the product is unusable in it's current state.

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #23 on: July 20, 2013, 04:08:23 AM »
Yup, I will look into it.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #24 on: July 20, 2013, 04:13:07 AM »
I see it happening the first time you try to add a texture, but works fine the 2nd time you do it. I will look into why this is happening the first time you append a texture to an atlas, but in the meantime, just hit the add button a 2nd time and it will work from that point onwards. Certainly not "unusable".

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #25 on: July 20, 2013, 04:20:59 AM »
Awesome... I can't reproduce it again. I think I have to restart the computer for it to happen.

devfo

  • Guest
Re: UIAtlasMaker exception
« Reply #26 on: September 03, 2013, 09:32:33 PM »
I am getting this error every time and cannot get past it.
I am using Unity version 4.2.1. I can create a new atlas, but cannot update it. I have to delete my atlas and recreate it every time i want to update it. This is getting really annoying

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIAtlasMaker exception
« Reply #27 on: September 04, 2013, 04:32:57 AM »
Check the previous posts here. The answer is always the same. I cannot reproduce it. I cannot fix what I cannot reproduce. The issue goes away by restarting Unity, and there are no clear steps on how to reproduce the problem.

Here's a video in case you don't believe me:

http://www.screencast.com/users/ArenMook/folders/Camtasia%20Studio/media/0556a735-e7a7-4ea5-830a-0ce81bcff8f1

devfo

  • Guest
Re: UIAtlasMaker exception
« Reply #28 on: September 04, 2013, 09:59:59 AM »
Just because you cannot reproduce it, doesn't suggest the bug does not exist. Especially since I am not the only one with this issue. I attached screen shots of the bug showing the exact details. As of now, i cannot get past this bug even if i restart unity, start a new project, etc...
Good thing I don't tell my customers (Bank of America, Prudential Investments) that I cannot reproduce their bugs. Instead I ask for more details, program information, sample data, environment setup, other software being used. After that, I will do some remote debugging on their systems to see the exact issue.
Guess I will fix it myself. I will update you when I find the fix...
Thanks

devfo

  • Guest
Re: UIAtlasMaker exception
« Reply #29 on: September 04, 2013, 11:35:22 PM »
file: UIAtlasMaker.cs
Function: static bool PackTextures (Texture2D tex, List<SpriteEntry> sprites)

Error occurs on line # 150: if (Mathf.RoundToInt(rect.width) != textures\[i\] .width) return false;

It seems that textures is null. But i am not sure why.
if I comment out this line or RETURN if texture is null, it does not error. However the atlas maker will only add 1 image to the atlas. It will not loop and add all textures.

EDIT:
Seems that the issue is with your checking of Unity versions:
#if UNITY_3_5 || UNITY_4_0
changed to
#if UNITY_3_5 || UNITY_4_2

by doing this I am able to create a "one time" atlas. However I cannot update it. So I have to wipe it out, select ALL sprites to be added, then press add/update all.

Please test your code with the latest Unity 4.2 build.....
« Last Edit: September 04, 2013, 11:56:22 PM by devfo »