Hello Guest

Author Topic: I keep getting a crash when commiting my collection  (Read 5054 times)

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
I keep getting a crash when commiting my collection
« on: September 07, 2013, 06:21:42 am »
NullReferenceException: Object reference not set to an instance of an object
tk2dSpriteCollectionBuilder.UpdateVertexCache (.tk2dSpriteCollection gen, Single scale, tk2dEditor.Atlas.Data[] packers, .tk2dSpriteCollectionData coll, System.Collections.Generic.List`1 spriteLuts) (at Assets/Editor/tk2d/Sprites/tk2dSpriteCollectionBuilder.cs:1477)
tk2dSpriteCollectionBuilder.Rebuild (.tk2dSpriteCollection gen) (at Assets/Editor/tk2d/Sprites/tk2dSpriteCollectionBuilder.cs:1279)
tk2dSpriteCollectionEditorPopup.Commit () (at Assets/Editor/tk2d/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:446)
tk2dSpriteCollectionEditorPopup.DrawToolbar () (at Assets/Editor/tk2d/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:436)
tk2dSpriteCollectionEditorPopup.OnGUI () (at Assets/Editor/tk2d/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:835)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/84669f285f6a667f/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

After that, weird behaviours occur, more errors when trying to use the collection or empty collection after reloading the project, or collection not appearing in a sprite's collection list.
Any idea how to fix that?

EDIT: Happens when dicing 128x128 is enabled. I think I nailed it for you, it happens when an animation has an empty png for exemple, dicing on an empty png = BOOM!
« Last Edit: September 07, 2013, 06:37:00 am by Evil-Dog »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: I keep getting a crash when commiting my collection
« Reply #1 on: September 07, 2013, 09:27:01 am »
Thanks - someone else reported the same thing a few days ago. Weird no ones actually tried to do this before this! The code's not changed in about 1 1/2 years :)

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: I keep getting a crash when commiting my collection
« Reply #2 on: September 07, 2013, 02:17:19 pm »
Bwahaha that happens :)
I'm getting other error message that seem to not break anything too, I'll post it when I get it again. Something about  something.Peek() or something.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: I keep getting a crash when commiting my collection
« Reply #3 on: September 07, 2013, 05:49:30 pm »
something.Peek was reported recently too! Its a Unity bug, that happens if you have a texture in the project window selection while you click "Commit" on the sprite collection. Its just a GUI error, pretty much harmless.

mitralone

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: I keep getting a crash when commiting my collection
« Reply #4 on: September 09, 2013, 08:31:08 pm »
I had that same error when I tried to slice a fully transparent image. The commit just does not work and errors start to jump out from tk2d scripts. Just do not try to dice a blank or full trans image. It needs at least one pixel to work. Man you should have seen my scene and better yet seen my face when scene turned that way. Terror for about 20 mins.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: I keep getting a crash when commiting my collection
« Reply #5 on: September 09, 2013, 09:08:28 pm »
Fixed in tk2d 2.2 :)

* please verify this if possible