• Runtimes
  • [Unity/Futile] What are the steps to export?

Is the process similar to the unity3d tutorial? Meaning do I just need to export the json and atlas while renaming each file to .txt?

I looked over the runtime on github, and I noticed that the example used Texture Packer to create the atlas file (I'm assuming it's to avoid any rotations in the atlas, because futile doesn't support it). Is this recommended?

So, correct me if I'm wrong, I'm guessing the steps are:

  • 1. Have an animation ready on Sprite.

    1. Export the json with pretty print selected (Although when i changed it into a .txt file... the formatting was all over the place, is this a bug?) and rename the .json extension to a .txt

    2. Grab the folder that contains all the images you used to create the animation and drag them into Texture Packer and publish for unity3d (Basic Algorithm, No rotation, Trim On/Off?)

    3. The atlas.png, atlas.txt (Created by Texture Packer), and the atlasJson.txt (created by spine) should be in the Resources Folder in your unity project.

    4. From here you can copy the Futile Spine runtime into your project's plugins folder.

Related Discussions
...
  1. If you're using TexturePacker Pro, publish for libGDX. Rotation is ok (I'm assuming it is if you're letting Spine handle UV-mapping since you're using the Texture Packer at all).

Make sure Premultiply Alpha is checked.

Export as a .txt file so Unity can recognize the file as a text asset.

I use the built in Texture Packer to export all of my animation textures together, which will help save on draw calls. (In settings, I check "Combine subdirectories.") Also, you're using the built in Texture Packer, and not the program (of the same name) from texturepacker.com right? (That can be made to work, but it's fiddly, and not worth the effort, IMO.)

There's no need to rename the .json file to .txt, if you're using the current version of Unity. It supports .json files as text assets now. You need to rename the .atlas file, though. I use a custom importer to rename it for me, so I don't ever have to do it manually.

Hey! TexturePacker Pro isn't fiddly. But Spine's built-in packer is arguably very convenient in that it means one less program to open especially when you're prototyping quickly. :p

That's right. There's no need to rename the json.
But you do need to rename the .atlas if that's what you're exporting. Unity won't recognize .atlas.

I love TPP! I even wrote an importer for TPP files for the Unity 4.3 Sprite system.

I meant getting it to work with Spine+Unity is fiddly. (Though I've done it.) 😛

Atlas renamer importer script:
https://github.com/ThirdPartyNinjas/Uni ... mporter.cs

Put that in an Editor folder somewhere in your Assets (I use Assets/Scripts/Editor/Importers/) and when you export an .atlas file into your project, Unity will delete the old version and rename the new one to .atlas.txt as soon as it gets focus.

Neat importer script! Would you mind if I included that in spine-unity, under the Spine runtime license? I wonder if it would confuse people?

5 gün sonra

Sorry for not responding sooner, Nate. Been out on holiday trips.

Sure thing. Everything in that repo is public domain, so you're welcome to do whatever you like with it. 🙂

3 ay sonra
Chounard yazdı

I use the built in Texture Packer to export all of my animation textures together, which will help save on draw calls. (In settings, I check "Combine subdirectories.")

How are you making this work?

In my Spine test project, I have two animations in the right hierarchy. I exported them by checking "Combine subdirectories" in the "Spine Texture Packer Settings."

For some reason, I still get two separate atlases. Is there something else that needs to be changed?

See images below:

I don't use "Create Atlas" in the Export settings. I go to the Texture Packer setting in the menu, and save the atlas from there.

Got it work, thanks!