Hello Guest

Author Topic: Can't create animation clip  (Read 6617 times)

mr_malee

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
Can't create animation clip
« on: April 10, 2014, 01:34:14 am »
Not sure how this happened, but whenever I try to create a new animation clip after creating a new sprite animation I get this error popup:

Invalid Sprite Collection found in clip. Please correct this in the inspector.

then Unity outputs this error:
Code: [Select]
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)

The errors don't stop and I have to force quit Unity.
Currently unable to make new animations :(

I've tried rebuilding index and checking integrity, everything reports ok.

I have 3 sprite collections with 2 platforms (UI, Game, Fonts). They all compile fine, no errors output.
« Last Edit: April 10, 2014, 01:36:32 am by mr_malee »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Can't create animation clip
« Reply #1 on: April 10, 2014, 02:51:22 am »
1. Try rebuilding the index (2D Toolkit > Rebuild Index)
2. Find all sprite collections in the project (expand the -tk2d object to see what tk2d knows about). Maybe there is something corrupt in the project? If you do find a corrupt one, delete it and rebuild index

mr_malee

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Can't create animation clip
« Reply #2 on: April 10, 2014, 07:11:17 pm »
Is there anything specific I should be looking for? Everything looks fine in the collection. I've tried rebuilding the index as well.

In order to create new animations I have to duplicate an existing one then modify.

mr_malee

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Can't create animation clip
« Reply #3 on: April 10, 2014, 07:19:38 pm »
ah found it.

it was my Font sprite collection. For some reason having 2x platform fonts seems to break the animation system.
I removed all platforms from my font sprite sheet, recompiled, rebuilt index.

Now I can create new animations :)

But I've just lost HD fonts :(

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Can't create animation clip
« Reply #4 on: April 11, 2014, 02:28:52 pm »
Lost HD fonts how? Have you tried restarting Unity?

mr_malee

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Can't create animation clip
« Reply #5 on: April 11, 2014, 06:42:22 pm »
what I mean is, if I add a 1x and 2x platform in my Font Sprite Collection (collection which only contains 1 font) and commit. I'm then unable to make animations.

Maybe I don't understand the workflow for 2x fonts.

1. Create a font and png at 1x (font size 16)
2. Create a font and png at 2x (font size 32)
3. Add the 1x font into the sprite collection
4. Put 2x font into a sub folder named "2x", name font.png "font@2x.png", name font.txt "font@2x.txt"

Is there something else I need to do?

I've attached a test project that replicates the problem. Try and create a new animation clip in the "TestAnimation" sprite animation.

« Last Edit: April 11, 2014, 06:44:35 pm by mr_malee »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Can't create animation clip
« Reply #6 on: April 12, 2014, 07:10:31 am »
You don't seem to have any sprites in your project - you've also deleted the samples folder which would have had a few valid sprites in there. You can't create an animation while you don't have any valid sprites in the project.