Hello Guest

Author Topic: Adding Folders of sprites to a Collection Workflow  (Read 3852 times)

Majicpanda

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 62
    • View Profile
Adding Folders of sprites to a Collection Workflow
« on: July 27, 2013, 03:49:54 pm »
Hopefully I'm doing something wrong here.... If you have 100 sprites sitting in your project folder Armor let's say, you then bring over 50 more and need to get them into the collection but have no idea which they are you end up dragging the entire folder into the collection resulting in a bunch of 1's after the duplicates and any updates you made won't be reflected because it copied them.

Is there another way to do this task over the course of my project?  I need something like "Add all these images and overwrite existing"

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Adding Folders of sprites to a Collection Workflow
« Reply #1 on: July 27, 2013, 04:26:33 pm »
This is expected behaviour.
In tk2dSpriteCollectionEditorPopup.cs, look for HandleDroppedPayload
The first loop in the function goes in and creates duplicates for all the textures which already exist - you can add some code in there to find duplicates and ignore them. You can compare tex to spriteCollectionProxy.textureParams[-].texture to detect duplicates.

I've added a note for the next version - this is easy enough to do and there will be a prompt to ask you what you want to do with the duplicates in the next version.

Majicpanda

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 62
    • View Profile
Re: Adding Folders of sprites to a Collection Workflow
« Reply #2 on: July 27, 2013, 08:14:42 pm »
Excellent as always thank you :)  The work around right now is to simply search for "1" and delete them all, but this also makes me have to select all and set the anchor point for all the sprites again.  It would be really cool if you could set an anchor for the current batch of sprites you are importing (not for the whole collection) and it set it... that would be insanely helpful for my current situation.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Adding Folders of sprites to a Collection Workflow
« Reply #3 on: July 27, 2013, 09:22:48 pm »
Well, if you modify the code as recommended - newly added sprites are all multi-selected after adding. Should solve your problem nicely ;)