Hello Guest

Author Topic: Getting an error when trying to make animations  (Read 6349 times)

cipher

  • Newbie
  • *
  • Posts: 13
    • View Profile
Getting an error when trying to make animations
« on: May 28, 2013, 09:42:28 pm »
Hello,

In my project I have stumbled upon an error that triggers when I try to make a new animation clip. The error itself triggers when I choose a sprite collection to make the animation with. However, it does not trigger with every sprite collection, just some of them (including one of the demo ones that comes with 2DToolkit). I was unable to find any notable differences between ones where the error triggered and ones where it did not. I should also confirm that I'm using the most recent version of 2DToolkit, but not the most recent version of unity (I'm only an update or two behind though).

Here's the full error that triggers:

Quote
IndexOutOfRangeException: Array index is out of range.
tk2dEditor.SpriteAnimationEditor.TimelineEditor.DrawFrameGroupEx (Rect r, .tk2dSpriteAnimationClip clip, tk2dEditor.SpriteAnimationEditor.FrameGroup fg, Boolean highlighted, Boolean showTime, Boolean playHighlight) (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationClipTimelineEditor.cs:525)
tk2dEditor.SpriteAnimationEditor.TimelineEditor.DrawFrameGroups (Int32 controlId, Rect frameGroupRect, .tk2dSpriteAnimationClip clip, System.Collections.Generic.List`1 frameGroups, Single clipTimeMarker) (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationClipTimelineEditor.cs:211)
tk2dEditor.SpriteAnimationEditor.TimelineEditor.Draw (Int32 windowWidth, .tk2dSpriteAnimationClip clip, System.Collections.Generic.List`1 frameGroups, Single clipTimeMarker) (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationClipTimelineEditor.cs:158)
tk2dEditor.SpriteAnimationEditor.ClipEditor.Draw (Int32 windowWidth) (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationClipEditor.cs:564)
tk2dSpriteAnimationEditorPopup.OnGUI () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationEditorPopup.cs:480)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)


I found a thread here that seemed to have a similar problem ( http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,1301.msg7574.html#msg7574 ), but even after making the change to the code suggested there, it didn't seem to make a difference.

Any help is much appreciated.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Getting an error when trying to make animations
« Reply #1 on: May 28, 2013, 09:53:05 pm »
Since you have something that consistently breaks, can you send me a repro case - you can obviously clear out everything that isn't relevant - just the minimum amount of data to reproduce the issue would be really good.

cipher

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Getting an error when trying to make animations
« Reply #2 on: May 29, 2013, 04:22:15 am »
So I just prepped a file to post here. I had deleted all but 1 sprite out of each collection, and any other stuff. However, now the error will no longer trigger in that file, but I'm not sure why. The only thing I could think that would effect it is the reduced size, but it was only around ~25 images, 400x400 being the largest. That wouldn't explain why the error triggered with one of the default sprite collections.

I'll investigate it further over the next 1-3 days and report back anything I find. Or if you would like, I could post a version that still has all the sprites in it.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Getting an error when trying to make animations
« Reply #3 on: May 29, 2013, 09:09:19 am »
The file size can't really affect the animation - the animation stores a reference to the actual project, so probably deleting the textures might have deleted the one that was actually causing the issue.

If your project isn't TOO big, zip it up, load to dropbox and email support at unikronsoftware.com with a link. I'll be happy to look and would be good to work out what is going on here.

cipher

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Getting an error when trying to make animations
« Reply #4 on: May 29, 2013, 08:06:27 pm »
So there's been a twist of events. I was getting ready to prep a new file to send your way, and now the error will not trigger anymore. I should note that I had changed nothing from the original project where it was happening, I had just duplicated the folder, opened that, and the error stopped triggering (in both of them).

However, now all my sprites are incredibly blurry, whether you are viewing them in the scene, or in the animation editor (etc). I tried deleting and re-importing 2D toolkit, but that didn't change anything anyways. Do you have any ideas of what might be causing this? Would you like to see the file?


Thanks for bearing with me here

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Getting an error when trying to make animations
« Reply #5 on: May 29, 2013, 08:51:57 pm »
Is it because of something like this? Try clicking on a higher quality setting and see if it changes in the editor. You might have to commit the sprite collection anyway.
http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,612.0.html

cipher

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Getting an error when trying to make animations
« Reply #6 on: May 29, 2013, 10:12:17 pm »
I went ahead and tried the things suggested in your link. The default quality was already correct, and the second suggestion made no difference.

However I guess I did find a fix. I reimported a few of the images into unity and made a new sprite collection and animation, and those were not blurry at all. The image hadn't been altered, but you can put the new and the old ones side by side and it's a really obvious difference. I was even able to literally grab the same PNG out of the assets folder and drag it back into unity, and that worked too.

 For now this fix is fairly viable, since I was going to replace these graphics sooner or later anyways, but it's bizarre. I wonder if it has anything to do with 2D toolkit at all. If that error from earlier ever returns though, I'll bump this thread

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Getting an error when trying to make animations
« Reply #7 on: May 29, 2013, 10:17:51 pm »
That is bizarre indeed. Please post if it happens again.

Dujj

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Getting an error when trying to make animations
« Reply #8 on: June 02, 2013, 09:58:28 pm »
I'm seeing the a similar problem here.  Just created a new Sprite Animation, created a clip, tried to select a different Sprite Collection and I get this error:

Quote
IndexOutOfRangeException: Array index is out of range.
tk2dEditor.SpriteAnimationEditor.ClipEditor.DrawPreview () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationClipEditor.cs:218)
tk2dEditor.SpriteAnimationEditor.ClipEditor.Draw (Int32 windowWidth) (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationClipEditor.cs:553)
tk2dSpriteAnimationEditorPopup.OnGUI () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteAnimationEditor/tk2dSpriteAnimationEditorPopup.cs:480)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Shooting support at unikronsoftware.com an email with a dropbox link.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Getting an error when trying to make animations
« Reply #9 on: June 02, 2013, 11:20:55 pm »
The reply to that email bounced, not sure why, but heres what I posted in there: "This bug has been fixed in 2D Toolkit 2.0.
It might be worth updating to give that a go. If you can't update, let me know and I'll see what I can do to back port the fix to 1.92 "