• Runtimes
  • Is there a way to load an animation without atlas?

Related Discussions
...

Hi,

I'm wondering if there is a way to load an animation without any atlas attached? (runtime-c)

I want to use spine to create 'in' and 'out' animations for screens like menus and this kind of stuff with many big images, and I don't want a giant atlas. (The 'spinosaurus.json' example comes without any atlas, how can I load it?)

And once I have the animation loaded How can I access the SRT data?

Thanks in advance!

Usually it is preferable to only read a few texture files which contain many textures than read lots of texture files separately. However if you must this is possible (still creates an atlas, but all you files will be separate)

if you put the files in their own folders then using the Texture Packer there is an merge sub directories box, un tick that. Then generate the atlas.

Ok, although this is not the question I asked, hehe
There is a way to load an animation without any atlas? or is it not possible?

Technically you can generate an atlas at runtime that meets the requirements of a skeleton pretty quickly and just fill it with blank data; but otherwise no, at least not in Spine-CSharp and Unity.

Ok, thanks. I will do that ^_^

Mitch escreveu

Technically you can generate an atlas at runtime that meets the requirements of a skeleton pretty quickly and just fill it with blank data; but otherwise no, at least not in Spine-CSharp and Unity.

Why would you want to generate the atlas at runtime. This seems incredibly silly. In my opinion it would be much better to do what I suggested. If you have a large amount of files just make a simple batch file which creates new folders and copies your images there. then call the texture packer commands, and delete the folders.

I under stand why you would want to do something like this, if you need to edit your textures without using spine. We do something similar to generate our spritelamp files. (we generate the files from separate images then use spine texture packer to pack them up)

You can certainly use an animation without an atlas, in any of the official runtimes. For spine-c, use SkeletonJson_createWithLoader to specify your own attachment loader. See AtlasAttachmentLoader for an example, except your newAttachment method will just be empty since you don't have anything to load for each attachment. After that you just create an Skeleton, pose it using Animation or AnimationState, and call updateWorldTransform like normal. Then, instead of rendering, get the world SRT of each bone and apply it to whatever you want the animation to drive. You can actually do all this just with spine-c, since no rendering is required.

One reason to do this is to drive a UI from an animation. Eg, animate a UI in Spine with some placeholder images, then at runtime load the animation and use it to drive the transforms for actual UI widgets (buttons, sliders, etc). Or maybe you want the animations to drive something else, like parts of a 3D model.

5 dias depois

Yes, I want exactly that @Nate points, use spine to animate placeholders and then put our UI stuff. Thanks!

I made some changes in spine-c to support the new loader and other useful stuff here:
https://github.com/Darky-Lucera/spine-r ... 74cc7e83f7

Added functions:

  • Page: spAtlasPage_copyConstructor, spAtlasPage_addAtEnd, spAtlasPage_findPage
  • Region: spAtlasRegion_createWithName, spAtlasRegion_copyConstructor, spAtlasRegion_addAtEnd
  • Atlas: spAtlas_createVoid, spAtlas_addFile, spAtlas_merge
  • AtlasAttachmentLoader: spAtlasAttachmentLoader_create2 (new loader which creates new regions if it can't find a named region.)