2D Toolkit Forum

2D Toolkit => Support => Topic started by: whynotmatt on March 31, 2014, 04:48:12 pm

Title: "Invalid sprite collection found in clip." when creating animation clip
Post by: whynotmatt on March 31, 2014, 04:48:12 pm
I am trying to make my first sprite animation. I've created my sprite collection and added in all the images that I need. I then create a new Sprite Animation and click on the "Open Editor" button. When I click the "create clip" menu item in the Sprite Animation editor, I get the error message: "Invalid sprite collection found in clip."

I am using Unity 4.3.4f1 on a Mac. What am I doing wrong?
Title: Re: "Invalid sprite collection found in clip." when creating animation clip
Post by: unikronsoftware on March 31, 2014, 07:21:08 pm
Is this in an empty project?
Do you have any sprite collections that contain either invalid data?
Have you run the integrity checker in the 2D Toolkit menu - its worth checking to make sure your project is not corrupt.
And finally, try this in an empty project in the event that there is something broken in your current one.
Title: Re: "Invalid sprite collection found in clip." when creating animation clip
Post by: whynotmatt on March 31, 2014, 10:34:44 pm
This is not an empty project.

How do you tell if a sprite sheet has invalid data?

I ran the integrity checker and it said I was missing the tilemap classes. So I added those, but I still get the same error.

It seems to run ok in an empty project.
Title: Re: "Invalid sprite collection found in clip." when creating animation clip
Post by: unikronsoftware on April 01, 2014, 02:10:45 pm
It is likely that there is a sprite collection with some bogus data.
If you click on the -tk2d object in the root of the project, expand the Sprite Collection Index in inspector - look at the first thing in the index, is it a valid sprite collection? Does it have uncommitted data, broken data object, etc...
If its invalid, delete it and 2D Toolkit > Rebuild Index to see if that helps.
Title: Re: "Invalid sprite collection found in clip." when creating animation clip
Post by: whynotmatt on April 01, 2014, 04:56:20 pm
I looked in the -tk2d object and everything seems to be there. How would I know if a collection has uncommitted data or broken data?

Here is the error message displayed in the unity log.


ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[tk2dEditor.SpriteAnimationEditor.ClipEditor+FrameGroup].get_Item (Int32 index) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
tk2dEditor.SpriteAnimationEditor.ClipEditor.DrawFrameInspector () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationClipEditor.cs:367)
tk2dEditor.SpriteAnimationEditor.ClipEditor.DrawInspector () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationClipEditor.cs:539)
tk2dEditor.SpriteAnimationEditor.ClipEditor.Draw (Int32 windowWidth) (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationClipEditor.cs:612)
tk2dSpriteAnimationEditorPopup.OnGUI () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationEditorPopup.cs:488)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Title: Re: "Invalid sprite collection found in clip." when creating animation clip
Post by: unikronsoftware on April 01, 2014, 04:57:48 pm
I'm not sure - I've not seen this reported before. To make this simpler can you try and create a repro case and either attach it here / email support please?