2D Toolkit Forum
2D Toolkit => Support => Topic started by: Evil-Dog 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!
-
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 :)
-
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.
-
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.
-
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.
-
Fixed in tk2d 2.2 :)
* please verify this if possible