ndee85 / coa_tools

COA Tools is a 2D Animation Suite for blender. It offers a 2D cutout animation workflow similar to programs like spine or spriter.
GNU General Public License v3.0
885 stars 138 forks source link

Idea: One open standard Json animation file specification to rule them all #26

Open blurymind opened 8 years ago

blurymind commented 8 years ago

This came out as a hot topic on the godot facebook group.

Right now the open source community is looking for an open standard json file format that stores animation data in the form of keyframes.

We have an addon for blender that does that already: https://github.com/ndee85/coa_tools It is compatible with Godot too!

What are the technical advantages of having game animation stored as a json file+ an image atlas?

What other software can use this technique and export animation data to a json file?

Popular games that use it:

What open source software can do this already?

The problem with the json file format, the game runtime and the lack of one open standard: The three major competing applications for cut out game animation do basically the same things. However as a means to lock their users to their product, the structure of the json files they output is different. That forces game developers to have to rewrite a new run time for each of the three - that parses the data accordingly. What is worse - they put a license on their runtimes that prohibits anyone else - who does not own the license to their software to use their runtimes.

We need a json file specification that is open - one that can work on all game engines without the need to purchase a license from someone.

Somehow this json specification must be kept compatible in all open source editors or runtimes - so as to not have to duplicate effort to implement new runtimes for each game engine.

Perhaps we need to create a new github/web page for it? One that describes the structure of the specification - and makes it easy for other developers to implement exporters/importers/runtimes.

blurymind commented 7 years ago

@ndee85 This is great, because unlike the dragonbones editor or ANY other competitive software of this type (like spine2d) - blender has nice sculpting tools that can be used to create/tweak the shape keys- much quicker than painstakingly moving vertices!! :+1:

ndee85 commented 7 years ago

@blurymind yes, this is one thing. The creation of shapekeys. But the other thing is, that if you want to animate vertex coords in spine or dragonbones. You have to manualy set it for each animation. And adjusting them will be such a pain! With shapekeys you have full control and adjusting them is just changing the bone locations or scale or whatever! I have to say, this feature really sets coa tools apart of the others. At least workflow wise! I wouldn't have thought that I can export the shapekeys in such a good way!

I am a bit excited that it worked out so well!!

ndee85 commented 7 years ago

Ok. Just pushed timeline events and shapekey support for dragonbones with this commit 4a4122af5ba7df8f960a4d11b05574eb4c90b116

blurymind commented 7 years ago

@ndee85 epic win!! Thank you for the awesome updates! :D Time to make the other editors have a run for their money

ndee85 commented 7 years ago

Here is a small preview how shapekeys are transfered to dragonbones. You can create as many shapekeys as you wish. The all get exported as an animated mesh. Works pretty straight forward. This enables advanced 3D like animations and facial expressions.

I think the last part on the todo is the texture atlas generation and then we can say it is on paar with dragonbones!? Did I miss something? ^^

dragonbones_shapekey_support

blurymind commented 7 years ago

@ndee85 you are rocking it! Yes indeed it is getting on par - and even better than their editor!

Question - on the screenshot above- you don't have a keyframe on each frame - which makes me think that the shapekey animation doesn't get baked on export, but actually preserves the original keyframes. Is that correct?

Here is a demo on integration of dragonbones files in Untity3d https://www.youtube.com/watch?v=VnJKU56q708

I couldnt give it a try in the weekend, but will do as soon as i get some free time. I am very eager to play with this, once my freelance client is off my back.

All thats left now is to put up a short video tutorial on exporting the example character to unity. I am saying unity- because it seems to be the most popular game engine supported by the runtime at the moment

blurymind commented 7 years ago

@cesarpachon Dragonbones animation data is now officially supported by cocos2d: http://www.cocos2d-x.org/wiki/Animaiton_Editor_Introduction You can directly import it in the game engine and should work. No need to install runtimes

The Action Editor supports making and editing the mainstream skeletal animation and the frame animation sequence. It also supports importing Dragon Bones and Flash animations directly.

They just added it to the game engine. Here is the announcement: http://discuss.cocos2d-x.org/t/cocos-creator-1-3-0-released/33094

http://discuss.cocos2d-x.org/uploads/default/optimized/2X/b/bf93d28f377bdd862d0b7039ccfae0b5c06bb897_1_690x476.jpg

Responding to the call of users, we have added Dragon Bones ( a very popular skeleton animation editing tool) support in this version. DragonBones component and Spine component works similar. You just need to create a node with DragonBones component, and drag exported DragonBones animation data and image data into the component then it's ready to be played in your scene. You can also customize the properties of the component such as default animation, playback speed and cycle times easily in editor.

ndee85 commented 7 years ago

@blurymind Automatic Texture Atlas generation is now commited. Take a look here :) You currently have to set the size in of the final texture yourself. Going to add automatic size calculation soon too.

stip_atlas

blurymind commented 7 years ago

@ndee85 Thank you, you are rapidly improving the entire workflow! This will save a lot of time and simplify the process

blurymind commented 7 years ago

It's good to note that having all body parts of the character in one image file (atlas) - is a great optimization- as it greatly reduces the number of draw calls!

So packing them bodyparts in an Atlas is an incredibly important and useful feature that @ndee85 has now made a part of the addon

LPsyCongroo commented 7 years ago

Hey everyone. I love this plugin, and I'd really like to test it in Unity but every time I export to Dragonbones I keep getting this error message. I'm not tech savvy enough to know what it means =/

capture

EDIT: I figured out the problem, I didn't add the animations using the COA Tools menu. Works awesome! I'm going to test out shapekeys when I get the chance.

Out of curiosity, as anyone gotten their DragonBones files into Unity yet? I don't mean the Demos either, but one of their own characters. I can't even figure out how to get the runtimes into my project folder without errors being thrown all over the place. Plus, a lot of the documentation is in Chinese which is not helpful...

rosshadden commented 7 years ago

I know you don't want to support every format ever, but I think it would be a good idea to add an export to the spine format, too.

Sure, using the spine runtimes is not free, however they are very well supported and maintained, and people do use them. A lot more people than dragonbones, if only because they support so many more languages and game engines.

If we did so, it would expand the reach of this tool from ~4 game engines to ~40 (the one I use, love2d, being one of them).

blurymind commented 7 years ago

Spine devs are not very open to the idea and prohibit other tools from being able to export the spine format. I havent even written on their forum or to them and they blocked my ip from their website. This i assume is just because at one point- just like you now- i kept advocating on the request to have blender export to it too- for free.

If you already have a 300 dollar spine license, then you do not need to use blender or another tool to export to it in general- as their editor will have you mostly covered on all operating systems. In contrast the dragonbones editor does not have a native version for linux.

I know its annoying but its just pure politics. The reason they have 40 runtimes is that they got devs to use their editor and write runtimes. If we use dragonbones and focus on supporting and promoting it as much as we already do for spine, it also will get 40 runtimes- because that will motivate devs to write them!

On 22 Nov 2016 03:43, "Ross Hadden" notifications@github.com wrote:

I know you don't want to support every format ever, but I think it would be a good idea to add an export to the spine format, too.

Sure, using the spine runtimes is not free, however they are very well supported and maintained, and people do use them. A lot more people than dragonbones, if only because they support so many more languages and game engines.

If we did so, it would expand the reach of this tool from ~4 game engines to ~40 (the one I use, love2d, being one of them).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ndee85/coa_tools/issues/26#issuecomment-262139867, or mute the thread https://github.com/notifications/unsubscribe-auth/AGMbVa0TG3shYFOPjUfYI-asFp_eIzi2ks5rAmTXgaJpZM4IGsfM .

blurymind commented 7 years ago

Another great opensource engine that would be very cool to have dragonbones runtime is love2d. It has a big community of devs and already has a runtime for spine. https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-love

Later this week I am going to try and request it on their board

Seems more viable than godot support at the moment

rosshadden commented 7 years ago

@blurymind Love2d is the game engine I use. I recently asked them via a tweet, but haven't heard anything from them.

I did start a dragonbones love2d runtime, but I realized I needed to break out some of my lua libs before working on it, because they would be useful in th dragonbones runtime as well. So for now it's in the "nothing to see here" stage. I would love some help once I get it far enough along :). Or if you want to lead your own charge, by all means.

The point is I think we're on our own for most dragonbones runtimes. They have 2-4 official ones, and the consensus seems to be if you want another one we are best off making it ourselves.

blurymind commented 7 years ago

They have a lua runtime for cocos which can potentially be adopted or taken as inspiration :)

On 28 Nov 2016 18:41, "Ross Hadden" notifications@github.com wrote:

@blurymind https://github.com/blurymind Love2d is the game engine I use. I recently asked them via a tweet https://twitter.com/darthlink44/status/800905943517040642, but haven't heard anything from them.

I did start a dragonbones love2d runtime https://github.com/acleverpun/dragonbones-love, but I realized I needed to break out some of my lua libs before working on it, because they would be useful in th dragonbones runtime as well. So for now it's in the "nothing to see here" stage. I would love some help once I get it far enough along :). Or if you want to lead your own charge, by all means.

The point is I think we're on our own for most dragonbones runtimes. They have 2-4 official ones, and the consensus seems to be if you want another one we are best off making it ourselves.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ndee85/coa_tools/issues/26#issuecomment-263355688, or mute the thread https://github.com/notifications/unsubscribe-auth/AGMbVcConLtOuyBrrPD3QyZMI6GCtkQQks5rCyBNgaJpZM4IGsfM .

rosshadden commented 7 years ago

I really don't want to be the guy leading the charge for a love2d dragonbones or coa_tools runtime. Animations are not my forte. I made some posts about it in the love forums and really hope someone else picks up the torch. I'd be happy to help, just don't want to lead it.

blurymind commented 7 years ago

Here are some links @rosshadden is mentioning: https://love2d.org/forums/viewtopic.php?f=3&t=82956

Ross> I would love to join, but I don't event know where to begin. love2d is particularily interesting to me, but I dont feel confident enough to write an entire runtime. Someone who knows it really well should write it. I can help with testing it

blurymind commented 7 years ago

@ndee85 There is an interesting new development with spine2d json filetype:

The Defold engine developers, who have been supporting it for a while now just made an announcement about dragonbones: http://forum.defold.com/t/dragon-bones-4-9-5-supports-spine-3-3/3630/6

Dragon Bones now exports to spine 3.3 as of 4.9.5 update. Everything works perfectly fine, all animation imports including mesh deformations. Just export images separately and create atlas in Defold and you're good to go.

a1e7c1d23665a21414b8137d7405ac3cd61b6b2b_1_592x500

More over, because they have implemented their own runtime for spine files, they don't have a limitation in their runtime to enforce users to own the 300$ spine license!.

-Does the spine runtime in Defold require the user to still spend 300$ for a spine license? -We have implemented our own Spine runtime. We use no code from Esoteric software.

The way this affects us right now: Since coa_tools now exports to dragonbones and dragonbones can convert the files to spine - coa tools can now be used to create spine2d animation for the Defold engine - without need to own or purchase the 300$ license by esoteric games!

This is also possibly true for other game engines with built in support for spine files and their own runtime - youo games Game maker for example - but needs to be confirmed!

cesarpachon commented 7 years ago

wow! that's amazing! if only Dragon Bones run on linux it would solve my particular need.. right now I am tied to Spine as their editor runs on linux and they have cocos2d runtime for javascript (dragonbones runtime is only for C++, as far as I know). I had not figure out a way to create a pipeline from coa_tools to cocos2d-javascript on linux environment. I even started a small experiment with my own set of gimp, blender and javascript modules for cocos2d: it supports position, rotation, visibility but I yet need to work on render-order channels to cover my basic needs: https://github.com/cesarpachon/2d_open_anim_pipeline

rosshadden commented 7 years ago

Dragonbones not working on Linux is one of the reasons coa_tools can be useful. Also because Blender is incredible and standard. I think this news is a huge motivation for having coa_tools output the spine format, as it now gives us reach to two very different runtime collections.

blurymind commented 7 years ago

@cesarpachon The dragonbones editor is written in adobeair, which unfortunatelly is no longer supported for linux. That is why they haven't ported it is my guess. However it is not very difficult to run the windows version via wine. Basically install adobeair with wine, then install dragonbones with wine and run it. dbones-linux-screenshot from 2016-12-08 23-52-30 And voala - dragonbones editor running under linux.

Running it with wine is a bit laggy and not usable for animation , however we might still be able to use it to convert the dragonbones animation data you exported from blender via coa-tools to spine animation data.

Ideally you would have a spine2d exporter for coa-tools as well - that way we won't need the dragonbones editor for converting the data in the middle - but for now this is a nice workaround for Defold users under linux.

No matter the platform - blender+ coa tools outperforms the Dragonbones animation editor - the frame rate we get is way better. So @ndee85 has achieved something very special here imo - regardless of the limitations of the db runtime, exporting to a dragonbones json file has now enabled us to also be able to get spine2d json files for game engines with the spine2d runtime!

blurymind commented 6 years ago

It looks like somebody has created a dragonbones runtime via a Godot module for Godot 2: https://github.com/sanja-sa/gddragonbones

The goal now would be to get it ported to Godot 3 or even better to create a gdnative addon that would elliminate the need to recompile godot and it's export templates

Many thanks to sanja-sa!!