Hello Guest

Author Topic: An invalid sprite collection has been found in the selected clip  (Read 4806 times)

sebastian

  • Newbie
  • *
  • Posts: 17
    • View Profile
Hey there--

So late in the game I've decided I needed to implement tk2d platforms.  What an AMAZING feature-- thank you-- it's really gonna save my butt for getting my app to run on older devices.

However, in early tests I've found that adding platforms to my sprite collections then gives me a "An invalid sprite collection has been found in the selected clip. Please correct this in the inspector" error when I load tk2d SpriteAnimations that reference the original clips.

I'm not seeing how to 'correct this in the inspector'.  I've tried dragging the new sprite collection prefabs into the animation window-- restarting unity-- rebuilding the tk2d index... 

Is there a workflow for this error?  I have a ton of spriteAnimations already built so I'm really hoping I don't need to recreate them all with the new platform specific sprites...

Thanks for your help!
Sebastian

sebastian

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: An invalid sprite collection has been found in the selected clip
« Reply #1 on: August 18, 2014, 05:34:38 pm »
Sorry I also had one more related follow up question--  does tk2d platform functionality swap the loaded platform specific sprites after loading?  Or does it determine which platform sprites to use before loading anything into memory?

The issue I'm trying to overcome in my app is too many mb being loaded at startup.

thanks for any clarification!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: An invalid sprite collection has been found in the selected clip
« Reply #2 on: August 18, 2014, 06:06:42 pm »
Quote
However, in early tests I've found that adding platforms to my sprite collections then gives me a "An invalid sprite collection has been found in the selected clip. Please correct this in the inspector" error when I load tk2d SpriteAnimations that reference the original clips.

This shouldn't happen. If you can reproduce this in a simple project, please post a repro case. The idea behind platform collections is that it still uses the same old sprite collections as before.

Quote
Sorry I also had one more related follow up question--  does tk2d platform functionality swap the loaded platform specific sprites after loading?  Or does it determine which platform sprites to use before loading anything into memory?

You need to set tk2dSystem.CurrentPlatform to 1x, 2x or 4x to load the appropriate collections before any of them are loaded initially. You control what is loaded, but you must do it before anything else is loaded.

sebastian

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: An invalid sprite collection has been found in the selected clip
« Reply #3 on: August 18, 2014, 10:05:51 pm »
Okay thank you very much!  I'll see if I can figure out what's going on with the Anim collection and will follow up with more questions if needed.

Thanks very much again!

sebastian

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: An invalid sprite collection has been found in the selected clip
« Reply #4 on: August 19, 2014, 08:59:59 pm »
Okay I figured out what I was doing dumb:

I had created new textures (i.e. myTexture@x1  and myTexture@x2) but had mistakenly thought I needed to drag those into the tk2d sprite editor window and commit to rebuild-- so I was making entirely new sprites, not new platform sprites.

A followup question:  What is best practice for file management if I'm starting with 4x textures?

ie-- my workflow is:

1)  got all my tk2d sprites and sprite animators working fine with large textures just called "myTexture"

2)  now I realize I need other platforms-- specifically 1x and 2x

3)  i've added @1x and @2x textures to the same folder as myTexture so that the folder now has:
myTexture
myTexture@1x
myTexture@2x

4)  I'm assuming since in tk2d editor I'm setting the 'current' platform to 4x, that I need an @4x in there somewhere.  So is the proper workflow:

A)  duplicate the myTexture so the folder has 4 items (myTexture, myTexture@4x, myTexture@2x, myTexture@1x)

or

B) just rename the original texture so the folder has 3 items (myTexture@4x, myTexture@2x, myTexture@1x)

Thanks for your help!!
Sebastian
« Last Edit: August 19, 2014, 09:04:08 pm by sebastian »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: An invalid sprite collection has been found in the selected clip
« Reply #5 on: August 19, 2014, 11:41:35 pm »
You don't need @4x in the name, that is only used to find sprites. If "myTexture" is 4x, and you set it up in the sprite collection is 4x, it doesn't need the @4x in the name. So #3 is sufficient.

sebastian

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: An invalid sprite collection has been found in the selected clip
« Reply #6 on: August 20, 2014, 01:29:56 am »
Oh okay-- perfect!  Even better.

I very much appreciate the quick support and help!!

Thank you!