Hello Guest

Author Topic: Anyway to keep sprite references when restructuring collections and atlases?  (Read 6978 times)

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
I work on a very big project with tons of sprites and I hit some unity walls when collections are too large and I can't commit them due to lack of memory.  So I've restructured my collections into various projects to make sure I have enough memory to process them individually by closing and opening the respective projects.  But when I change things around I'll lose the reference to sprites in my animations and I have to rebuild the animations.  Is there a way or any plan to have a way to make 2dtoolkit relocate the same sprites in their new collections?
Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Not possible the way its set up right now - they are just Unity references. Your best bet is to have a higher level animation construction system, perhaps text based which will reconstruct the animations as required based on names, etc. We've got a prototype system which will most likely be in tk2d 2.4

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Interesting, I'll think about that, thanks
EDIT: I checked the text method and I can't use copy/paste in that window so it seems unusable.
Can't copy paste in the sprite search bar either, which is inconvenient.
Is this a problem on my end?
« Last Edit: December 30, 2013, 09:01:21 pm by Evil-Dog »

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Sorry to bump this, cause I think EDITs get lost in the mix.
I checked the text method and I can't use copy/paste in that window so it seems unusable at the moment.
Can't copy paste in the sprite search bar either, which is inconvenient.
Is this a problem on my end?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
WARNING: Make sure you have meta files enabled before attempting this.
Try deleting the libraries folder and have Unity regenerate everything. This may be caused by that long standing unity bug which gets reset somehow when libraries is regenerated.

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
I've tried to no avail.  I still can't copy paste in the text field.
Other ideas?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Which window / text box specifically? What version of Unity / tk2d are you using?

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
The text window in the animation window where you setup your animations using collections.  There's the text button that opens a text box above the "process" button right.  Same thing with the search boxes in the collection or animation window.  I've tried in a new project and I can copy paste but not in my main project, that's the weird thing.
Unity 4.2.1f4
2dtoolkit 2.1 final + hotfix 1

Also, because I use javascript mainly and that 2dtoolkit, like many other plugins, don't respect the unity folder standard of being in the plugins/standard assets/editor folders, it's unusable unless the code in Plugins.  So updating such plugins is a bit of a pain and risky to lose all connections to your scripts if you don't do it right.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
This has been fixed in a newer version. Look for this line in tk2dSpriteAnimatorAnimOp.cs,
textNames = GUILayout.TextArea(textNames, GUILayout.ExpandWidth(true));
and change it to
textNames = EditorGUILayout.TextArea(textNames, GUILayout.ExpandWidth(true));
That should fix it.

p.s. there isn't really any "standard" way of dealing with folders for JS, and unity only allowed one folder to be uploaded to the asset store earlier on, so there wasn't an option of putting it in plugins as the editor stuff would have to be in a different folder. You should be fine if you use the SetupForJS function though - it moves the appropriate files into the correct folders.

Evil-Dog

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 38
    • View Profile
Ok awesome thanks I'll try that

Maybe not a standard but plugins have to at least work and some don't unless you move stuff around.  I didn't know there were limitations on the asset store previously though, that explains it.  I'll try SetupForJS, thanks for that tool.