2D Toolkit Forum

2D Toolkit => Support => Topic started by: gdeglin on April 24, 2013, 10:05:01 am

Title: Unable to create animation clips
Post by: gdeglin on April 24, 2013, 10:05:01 am
Somehow I broke things in such a way that I am no longer able to create new animation clips even though I can create sprites just fine.  I get the following errors when I create a clip...

"Unable to find any sprite collections (from the GetDefaultSpriteCollection method)" followed by ...
NullReferenceException: Object reference not set to an instance of an object
tk2dSpriteAnimationEditorPopup.CreateNewClip () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationEditorPopup.cs:357)
tk2dSpriteAnimationEditorPopup.<DrawToolbar>m__33 (System.Object userData, System.String[] options, Int32 selected) (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationEditorPopup.cs:395)

I tried removing all 2d toolkit plugin files and re-installing from the asset store but this seems to break lots of stuff. Specifically, I get multiple define errors between my TK2DROOT/tk2d/Code/* directories and my Plugins/tk2d/* directores.

If I copy the the TK2DROOT/tk2d/Code/* directores into the Plugins/tk2d folder (as the Setup For Javascript command normally does), most of the errors go away. But I still get an error that says "The type or namespace name `tk2dClippedSpriteSample' could not be found." ... which is weird because I thought this was renamed to just tk2dClippedSprite instead of tk2dClippedSpriteSample in 1.92. And in either case, my clip creation problem is not solved.
Title: Re: Unable to create animation clips
Post by: gdeglin on April 24, 2013, 10:15:06 am
The problem just got even stranger (but hopefully closer to a solution...)

If I remove multiple platform support, I am able to create a clip just fine. But once I add 1x, 2x, and 4x I get the same error as above.
Title: Re: Unable to create animation clips
Post by: gdeglin on April 24, 2013, 10:24:06 am
Ok I found a solution. Creating a throw-away sprite collection that has no multiple platforms enabled seems to make things work.
Title: Re: Unable to create animation clips
Post by: unikronsoftware on April 24, 2013, 10:37:03 am
I take it you've not imported or deleted the demo sprite collections?
I thought I resolved this a while back, but perhaps not... what version of Unity & 2D Toolkit are you using?
Title: Re: Unable to create animation clips
Post by: gdeglin on April 24, 2013, 10:03:45 pm
Yeah I excluded the demo files. Version 1.92 final. Unity 4.1.2f1
Title: Re: Unable to create animation clips
Post by: unikronsoftware on April 24, 2013, 11:14:36 pm
I've added that to the TODO for 2D Toolkit 2.0
Title: Re: Unable to create animation clips
Post by: unikronsoftware on May 11, 2013, 11:14:11 pm
Update - this has been fixed in 2.0.