Author Topic: Atlas Maker crashes  (Read 9815 times)

bkinsey

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 30
    • View Profile
Atlas Maker crashes
« on: September 19, 2014, 03:30:20 AM »
Just wanted to let you know that the UIAtlasMaker.cs script has crashed on me a couple times.

  1.         Dictionary<string, int> GetSpriteList (List<Texture> textures)
  2.         {
  3.                 Dictionary<string, int> spriteList = new Dictionary<string, int>();
  4.  
  5.                 // If we have textures to work with, include them as well
  6.                 if (textures.Count > 0)
  7.                 {
  8.                         List<string> texNames = new List<string>();
  9.                         foreach (Texture tex in textures) texNames.Add(tex.name);
  10.                         texNames.Sort();
  11. ---->                   foreach (string tex in texNames) spriteList.Add(tex, 2);
  12.                 }
  13.  

Quote
ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.String,System.Int32].Add (System.String key, Int32 value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
UIAtlasMaker.GetSpriteList (System.Collections.Generic.List`1 textures) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:228)
UIAtlasMaker.OnGUI () (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:963)

When the crash occurs I am unable to click on any new tabs in my editor, for example I cannot open my Hierarchy tab.

Opening and closing the Unity Editor fixes the issue, but maybe the code should more gracefully handle this. Not sure what the problem is, I just added a bunch of png files into my asset folder from file explorer, and then clicked on Unity, which attempted to catalog/load the images, and that's when the Atlas Maker crashed.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas Maker crashes
« Reply #1 on: September 19, 2014, 08:31:49 PM »
Based on the exception, you seem to have two images named the same, which is why you're encountering an issue.

Fliperamma

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 13
    • View Profile
    • Fliperamma | Game On!
Re: Atlas Maker crashes
« Reply #2 on: November 05, 2014, 09:15:23 AM »
I'm having problems with Atlas Maker / crashing too

I'm with Unity PRO 4.5.5f1, OSX Mavericks and NGUI 3.7.5

In my case Unity crashes every time and I'm not able to create new atlases, please help me here!

* I've reinstalled Unity
* I've downloaded the latest version of NGUI
* I'm working with new projects, with only NGUI imported
* I've sent bug reports to Unity already regarding this issue

1) Create a new project
2) Import NGUI
3) Click NGUI > Open > Atlas Maker > Click Atlas Dropdown
--- Error in console ---

Quote
InvalidOperationException: Operation is not valid due to the current state of the object
System.Collections.Stack.Peek () (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections/Stack.cs:321)
UnityEngine.GUILayoutUtility.EndLayoutGroup ()
UnityEngine.GUILayout.EndHorizontal ()
UIAtlasMaker.OnGUI () (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:765)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)


Other case:

1) Create a new project
2) Import NGUI
3) Search for "Backdrop" bitmap
--- I've tried different configurations here, results are the same
4) Right-click it > NGUI > Open Atlas Maker
5) Click Create

---- Unity Crashes ----
Editor Log:
Quote
Validating Project structure ... 0.001581 seconds.
Refresh: detecting if any assets need to be imported or removed ... Downloading http://update.unity3d.com/4.5/ivy.xml to /var/folders/x2/4732hpwx6cd52mpn7z44xy7w0000gr/T/unity/669c24db-586b-40f9-9082-5fdc3eb7cbf4/ivy.xml
Refresh: elapses 0.047664 seconds

----- Total AssetImport time: 0.048043s, AssetImport time: 0.000000s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]

Platform assembly: /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/2.0/Mono.Security.dll (this message is harmless)
Platform assembly: /Applications/Unity/Unity.app/Contents/Frameworks/Managed/nunit.framework.dll (this message is harmless)
System memory in use before: 58.6 MB.
Unloading 3 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
System memory in use after: 57.6 MB.

Unloading 3 unused Assets to reduce memory usage. Loaded Objects now: 671.
Total: 10.092875 ms (FindLiveObjects: 0.047168 ms CreateObjectMapping: 0.008111 ms MarkObjects: 2.232469 ms  DeleteObjects: 0.019386 ms)

Native extension for build target not found
Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.015425 seconds

----- Total AssetImport time: 0.013114s, AssetImport time: 0.000000s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]

Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.016546 seconds

----- Total AssetImport time: 0.014073s, AssetImport time: 0.000000s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]

2014-11-05 12:08:40.739 Unity[1749:707] NSSoftLinking - The DataDetectors framework's library couldn't be loaded from /System/Library/PrivateFrameworks/DataDetectors.framework/Versions/A/DataDetectors.
2014-11-05 12:08:40.740 Unity[1749:707] NSSoftLinking - The function 'DDMenuItemGetActionUTI' can't be found in the DataDetectors framework.

Hashing assets ... 0.000247 seconds
Updating Assets/NGUI/Examples/Textures/Backdrop.png - GUID: 20f7cab44eaf6e849a8b7131f390055a...
 done. [Time: 27.792320 ms]

----- Total AssetImport time: 0.056756s, AssetImport time: 0.044337s, Asset hashing: 0.000359s [130.3 KB, 354.222198 mb/s]

Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.016275 seconds

----- Total AssetImport time: 0.013778s, AssetImport time: 0.000000s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]

Receiving unhandled NULL exception
Launching bug reporter
Obtained 16 stack frames.
Receiving unhandled NULL exception
Launching bug reporter
Obtained 16 stack frames.
Receiving unhandled NULL exception
Launching bug reporter
Obtained 20 stack frames.
Receiving unhandled NULL exception
Launching bug reporter
Obtained 20 stack frames.
Receiving unhandled NULL exception
Launching bug reporter
Obtained 24 stack frames.
Receiving unhandled NULL exception
Launching bug reporter
Obtained 14 stack frames.
Receiving unhandled NULL exception
Launching bug reporter
Obtained 14 stack frames.

What could be causing this:
Quote
2014-11-05 12:08:40.739 Unity[1749:707] NSSoftLinking - The DataDetectors framework's library couldn't be loaded from /System/Library/PrivateFrameworks/DataDetectors.framework/Versions/A/DataDetectors.
2014-11-05 12:08:40.740 Unity[1749:707] NSSoftLinking - The function 'DDMenuItemGetActionUTI' can't be found in the DataDetectors framework.
« Last Edit: November 05, 2014, 09:25:48 AM by fliperamma »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas Maker crashes
« Reply #3 on: November 06, 2014, 01:45:34 AM »
I think something is wrong with your Unity install there. I've never seen those issues before and no one else had anything similar.

Fliperamma

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 13
    • View Profile
    • Fliperamma | Game On!
Re: Atlas Maker crashes
« Reply #4 on: November 06, 2014, 08:23:56 AM »
Yep, I've already tried to reinstall but no success here... maybe I'll need to format my Mac to solve this :)
« Last Edit: November 07, 2014, 01:25:16 PM by Fliperamma »

Fliperamma

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 13
    • View Profile
    • Fliperamma | Game On!
Re: Atlas Maker crashes
« Reply #5 on: November 07, 2014, 01:24:47 PM »
Formatting my Mac solved the crash problem (Which is amazing, it was impossible to work) ... but still ... no Atlas being generated.

I'm stuck with this error (which was already happening before):

Quote
UnityException: Texture 'OpenSans-Bold-48' is not readable, the texture memory can not be accessed from scripts. You can make the texture readable in the Texture Import Settings.
UnityEngine.Texture2D.GetPixels32 ()
UIAtlasMaker.CreateSprites (System.Collections.Generic.List`1 textures) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:292)
UIAtlasMaker.UpdateAtlas (System.Collections.Generic.List`1 textures, Boolean keepSprites) (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:682)
UIAtlasMaker.OnGUI () (at Assets/NGUI/Scripts/Editor/UIAtlasMaker.cs:1050)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

I've tried to change the textures import settings / type to "Advanced" and enable "read and write" but as soon as I press "apply" the texture goes back to "Sprite (2D / uGUI)"

Maybe my project is corrupted in some way? Any advice here?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas Maker crashes
« Reply #6 on: November 07, 2014, 03:59:24 PM »
Is the texture file itself readable? Maybe you have it marked as read only?