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
884 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 8 years ago

also posted this at godot tracker: https://github.com/godotengine/godot/issues/4312

Lets see if it gets some attention.

blurymind commented 8 years ago

Dragon bones json file format seems to be a good start. They are open source, have runtimes for:

java- https://github.com/DragonBones/DragonBonesJS/blob/master/LICENSE C++ - https://github.com/DragonBones/DragonBonesCPP/blob/refactoring/LICENSE Unity (c#) - https://github.com/DragonBones/DragonBonesUnity/blob/3.0/LICENSE AS- https://github.com/DragonBones/DragonBonesAS/blob/4.5/LICENSE They are all under MIT license that does not require you to buy the dragonbones license to use them.

dragonbones also supports mesh deformation.

So if you make coa_tools export a dragonbones type json file, you will be able to use coa tools with all these game engines and coa tools adoption will be much faster!

@ndee85 this is a much better solution than using spine, because the runtimes dont require you to buy a spine license.

Here are some example dragonbones files: https://github.com/DragonBones/DragonBonesUnity/tree/3.0/BirdAndCentaurDemo/Assets/Resources

Here is the dragonbones skeleton data format specification: http://dragonbones.github.io/help.html

IBwWG commented 8 years ago

Now to update Haxe support: https://github.com/SlavaRa/haxelib-dragonbones/issues/11

IBwWG commented 8 years ago

@blurymind I see there is 3.0 and 4.5, with different specs. Apparently not everyone would say 4.5 is best. Which one are you proposing to use here? Also the page you linked to only has a V2.4 for the skeleton, I guess that's separate from the sprite DB format?

blurymind commented 8 years ago

the newest one of course. They just added meshes and some very useful other things.

But you need to notice - the format specification is established and backwards compatible. They dont change that. What you are refering to seems to be the editor. We have two versions of the editor:

They both export to the same json format, so that does not affect this proposal at all. What we are interested in is what it's open source runtimes support and how well are they documented.

The question confused me. Are you asking which version of their editor to add to coa tools? If it's just adopting the code that writes to the json file - then of course the newest one that exports mesh data - always the newest one.

On Tue, Apr 19, 2016 at 7:46 PM, IBwWG notifications@github.com wrote:

@blurymind https://github.com/blurymind I see there is 3.0 and 4.5, with different specs. Apparently not everyone http://forum.starling-framework.org/topic/dragonbones-45-is-released#post-91163 would say 4.5 is best. Which one are you proposing to use here?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/ndee85/coa_tools/issues/26#issuecomment-212064899

IBwWG commented 8 years ago

Ah, thanks for clearing that up. So they already had meshes in the format spec, planning ahead, and then the engine implemented them?

It's just that the docs around the DB site and their GitHub readmes and wikis seem variously out of date, so it's hard to follow what's what.

I was asking which format to use. In the forum thread I linked to, it sounded like there was a 3.0 format and a 4.x format, and that at least one person was arguing the 3.0 format worked better (in the sense that the runtime was more performant, so it's a bit hard to separate the format from the runtime in that dialog?) In addition, the format spec linked to is 2.x. So, is it true the 4.5 editor uses the 2.4 format? I.e. my question doesn't make sense, because there is only the one format spec, v2.4?

blurymind commented 8 years ago

Their standalone editor can even import spine animation json files and export to a dragonbones json file. They support a lot of features that spriter doesnt. The runtimes could be investigated individually. Its possible that they are constantly catching up with the format and some might get up to date at different pace. Seeing as to how often they are updated makes them look very promising. Its all on github so you can check them out if you want to.

As a whole this seems to be much more mature than spriter's format and its goals much more inline with an open source approach. On 20 Apr 2016 13:31, "IBwWG" notifications@github.com wrote:

Ah, thanks for clearing that up. So they already had meshes in the format spec, planning ahead, and then the engine implemented them?

It's just that the docs around the DB site and their GitHub readmes and wikis seem variously out of date, so it's hard to follow what's what.

I was asking which format to use. In the forum thread I linked to, it sounded like there was a 3.0 format and a 4.x format, and that at least one person was arguing the 3.0 format worked better (in the sense that the runtime was more performant, so it's a bit hard to separate the format from the runtime in that dialog?) In addition, the format spec linked to is 2.x. So, is it true the 4.5 editor uses the 2.2 format? I.e. my question doesn't make sense, because there is only the one format spec, v2.2?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/ndee85/coa_tools/issues/26#issuecomment-212404979

IBwWG commented 8 years ago

Maybe so, but I'm still a bit confused on formats. If 2.4 is the latest format, which version of the format was DB 3.0 putting out? https://github.com/SlavaRa/haxelib-dragonbones/issues/12

blurymind commented 7 years ago

They recently added mesh binding to bones and free form deformation. That makes their json file spec fit perfect with coa tools and what it can do but can not export atm.

Please download the unity runtime in order to try the latest features of dragonbones. There are now example files for ffd and skinned mesh binding. Since there is no license like spine2d - we can use the dragonbones json file structure in coa tools export and thus use coa tools to produce animation that can be loaded by the dragonbones runtime- on unity and the other game engines that it has a runtime for

IBwWG commented 7 years ago

There's also this for OpenFL, only in beta and for DB 2.2, but still: https://github.com/jalbanesi/openfl-dragonbones

ndee85 commented 7 years ago

Just taking a look at Dragonbones. Wow.. that looks pretty advanced!! Maybe this could really be an alternative in the future!

blurymind commented 7 years ago

@ndee85 I can only hope to see Godot pick it up as a standard json/runtime. It is very good!

https://www.youtube.com/watch?v=xUfosRr9fY4 Now it has proper smooth bind skinning to sprites - which is the prime feature that I want! Blender can do that - so does your addon - turn sprites into meshes that can be deformed by an armature!

The advantage of picking up the dragonbones json specification over making a new one from scratch is:

Do you think we should advocate the bragonbones json data structure to godot devs or let them make a new one?

ndee85 commented 7 years ago

@blurymind do you know if it supports spritesheets within? So no spritesheet export, but spritesheets that can be used within the character in the software?

ndee85 commented 7 years ago

@blurymind Also, do you know if there is a json specification somewhere? I took a look at the exported json file. Not easy to read, because it is all in one line and absolutely no formatting.

blurymind commented 7 years ago

@ndee85 sorry for the delay, I will provide good example files soon. :) I have good ones that are easy to read and have the mesh data in, just didnt have much time these days

The lack of formatting on the ones you saw is the missing new line. This is not the case for all the ones that are available - they are just scattered in the different runtime repositories along with the good ones

And yes it supports spritesheets - I assume you mean a character atlas that contains multiple frames of a body part

blurymind commented 7 years ago

they updated their website to reflect the features http://dragonbones.com/en/animation.html#.V8_VCfkrK9I

radishdalek commented 7 years ago

The dragonbones json data format https://github.com/DragonBones/DragonBonesJS/blob/master/docs/DragonBones_4.5_data_format_zh.md

[note: although the comment lines are in Chinese, google chrome's "translate this page" seems to make a good job of turning it into English]

blurymind commented 7 years ago

@radishdalek thank you - the translation is very good actually, I hope it allows @ndee85 to make an exporter :+1:

I am pasting it bellow:

{
     // DragonBones data name 
    " name " :  " dragonBonesName " ,

    // Data version 
    " Version " :  " 4.5 of 5 " ,

    // Animation frame rate 
    " The frameRate " :  24 ,

    // Whether to use absolute data [0: use relative data, 1: absolute data] (optional attribute default: 1) 
    " isGlobal " :  1 ,

    // Custom data [any type of] (optional attribute default: null) 
    " userData " :  null ,

    // List skeleton 
    " Armature " : [{

        // Skeleton name (may contain a plurality of matrix data DragonBones) 
        " name " :  " armatureName " ,

        // Animation frame rate (Optional attributes Default: use the global frame rate) 
        " frameRate " :  24 ,

        // Animation type (optional attribute default: "Armature") 
        // [ "Armature": skeletal animation, "MovieClip": basic animation, "Stage": scene animation] 
        " of the type " :  " Armature " ,

        // Custom data [any type of] (optional attribute default: null) 
        " userData " :  null ,

        // Add to the default behavior of the list after the stage (optional attribute default: null) 
        " defaultActions " : [

            // This skeleton play the specified movie 
            [ " gotoAndPlay " , " animationName " ],

            // This player skeletons specify the animation and stop 
            [ " gotoAndStop " , " animationName " ],
        ],

        // This skeleton contains bones list of 
        " Bone " : [{

            // Bone name 
            " name " :  " BoneName " ,

            // The name of the parent bone 
            " parent " :  " parentBoneName " ,

            // Custom data [any type of] (optional attribute default: null) 
            " userData " :  null ,

            // Register to displacement of bone skeleton / miter / zoom (optional attribute default: null) 
            " the Transform " : {
                 " X " :  0.00 , // horizontal displacement (optional attribute default: 0.00) 
                " Y " :  0.00 , // vertical displacement (optional attributes default: 0.00) 
                " SKX " :  0.0000 , // horizontal skew (optional attributes default: 0.0000) 
                " SKY " :  0.0000 , // vertical miter (optional attributes default: 0.0000) 
                " SCX " :  1.0000 , // vertical scaling (optional attribute default: 1.0000) 
                " SCY " :  1.0000 , // vertical scaling (optional attribute default: 1.0000)
            }
        }],

        // This skeleton contains a list of slots 
        " The slot " : [{

            // Slot name 
            " name " :  " slotName " ,

            Bone names // slot belongs to 
            " parent " :  " parentBoneName " ,

            // Index default display object (optional attribute default: 0) 
            " DisplayIndex " :  0 ,

            // Mixed Mode (Optional attributes default: null) 
            " the blendMode " :  null ,

            // Custom data [any type of] (optional attribute default: null) 
            " userData " :  null ,

            // Display object color overlay (optional attribute default: null) 
            " Color " : {
                 " aM " :  100 , // superimposed transparent [0 to 100] (optional attribute default: 100) 
                " rM " :  100 , / / superimposed in red [0 to 100] (optional attribute default: 100) 
                " gM " :  100 , // green superposition [0 to 100] (optional attribute default: 100) 
                " bM " :  100 , // blue superimposed [0 to 100] (optional attribute default: 100) 
                " aO " :  0.00 , // transparent offset [-255 to 255] (optional attribute default: 0) 
                " rO " :  0.00 , // red shift [ -255 to 255] (optional attribute default: 0) 
                " gO " :  0.00 , // green bias [-255 to 255] (optional attribute default: 0) 
                " bO " :  0.00 , // blue offset [-255 to 255] (optional attribute default: 0)
            },

            // Add to the list of behaviors after stage (optional attribute default: null) 
            " Actions " : [

                // Specify the animation sub-frame playback (only displayed when an object is an effective framework) 
                [ " gotoAndPlay " , " animationName " ],

                // Specify the animation and the sub-frame playback stop (only displayed when an object is an effective framework) 
                [ " gotoAndStop " , " animationName " ],
            ]
        }],

        // This skeleton skin contains a list of 
        " Skin " : [{

            // Skin name 
            " name " :  " skinname " ,

            // This skin contains a list of slots 
            " The slot " : [{

                // Slot name 
                " name " :  " slotName " ,

                // Display a list of objects in this slot contains 
                " the display " : [{

                    // Display object name 
                    " name " :  " displayName " ,

                    // Display the object type (optional attribute default: "Image") 
                    // [ "Image": map, "armature": skeleton, "mesh": grid, ... other extended type] 
                    " of the type " :  " Image " ,

                    // Display object relative to the displacement of the bone / miter / zoom (optional attribute default: null) 
                    " the Transform " : {
                         " X " :  0.00 , // horizontal displacement (optional attribute default: 0.00) 
                        " Y " :  0.00 , // vertical displacement Y (optional attributes default: 0.00) 
                        " SKX " :  0.0000 , // horizontal skew (optional attributes default: 0.0000) 
                        " SKY " :  0.0000 , // vertical miter (optional default attribute: 0.0000) 
                        " SCX " :  1.0000 , // vertical scaling (optional attribute default: 1.0000) 
                        " SCY " :  1.0000 , // vertical scaling (optional attribute default: 1.0000)
                    },

                    // Display object's pivot point (Optional attributes Default: null, valid only map or grid) 
                    " Pivot " : {
                         " X " :  0.50 , // horizontal axis point [0.00 to 1.00] (optional default attribute: 0.50) 
                        " Y " :  0.50 , // vertical axis point [0.00 to 1.00] (optional attributes default: 0.50)
                    },

                    // UV vertex coordinate list (Optional Attribute Default: null, valid only for the grid) 
                    // [U0, V0, U1, V1, ...] 
                    " UVs " : [ 0.0000 , 0.0000 , 1.0000 , 0.0000 , 1.0000 , 1.0000 , 0.0000 , 1.0000 ],

                    // Triangle vertex index list (Optional Attribute Default: null, valid only for the grid) 
                    " triangles " : [ 0 , 1 , 2 , 2 , 3 , 0 ],

                    // Vertex coordinates relative to the display list object pivot point (Optional attributes Default: null, valid only for the grid) 
                    // [X0, Y0, X1, Y1, ...] 
                    " in the vertices " : [ - 64.00 , - 64.00 , 64.00 , - 64.00 , 64.00 , 64.00 , - 64.00 , 64.00 ],

                    // Vertex Weight list (Optional Attribute Default: null, valid only for the grid) 
                    // [amount of bone, bone index, weight, ..., ...] 
                    " weights " : [ 1 , 0 , 1.00 , 2 , 0 , 0.50 , 1 , 0.50 ],

                    // Skin slot register matrix transformation (Optional attributes Default: null, valid only for the grid) 
                    // [A, B, C, D, TX, TY] 
                    " slotPose " : [ 1.0000 , 0.0000 , 0.0000 , 1.0000 , 0.00 , 0.00 ],

                    // Matrix transformation skinned mesh registration (optional attribute default: null, valid only for the grid) 
                    // [bone index, A, B, C, D, TX, TY, ...] 
                    " bonePose " : [ 0 , 1.0000 , 0.0000 , 0.0000 , 1.0000 , 0.00 , 0.00 ]
                }]
            }]
        }],

        // Ik This contains a list of constraints skeleton 
        " IK " : [{

            // Ik constraint names 
            " name " :  " ikName " ,

            // Bind the bone name 
            " Bone " :  " BoneName " ,

            // Target bone name 
            " target The " :  " ikBoneName " ,

            // Bending direction (optional default attribute: to true) 
            // [to true: positive direction / clockwise, false: the opposite direction / CCW] 
            " bendPositive " :  to true ,

            // Skeleton chain length (optional attribute default: 0) 
            // [0: only constraint bone, n: n constraints bone and bone up grade parent bone] 
            " catena alberghiera " :  0 ,

            // Weight [0.00: no constraint to 1.00: fully constrained] (optional attribute default: 1.00) 
            " weight " :  1.00
        }],

        // Animation list this skeleton contains 
        " Animation " : [{

            // Animation name 
            " name " :  " animationName " ,

            // Loop count [0: loop unlimited, n: n-th loop] (optional attribute default: 1) 
            " playTimes " :  1 ,

            // Animation frame length (optional attribute default: 1) 
            " DURATION " :  1 ,

            // Keyframe animation included in this list (optional attribute default: null) 
            " Frame " : [{

                // Frame length (optional attribute default: 1) 
                " DURATION " :  1 ,

                // Frame events (optional attribute default: null) 
                " Event " :  " eventName " ,

                // Frame sound (optional attribute default: null) 
                " Sound " :  " soundName " ,

                // Frame behavior list (optional attribute default: null) 
                " Actions " : [

                    // This skeleton play the specified movie 
                    [ " gotoAndPlay " , " animationName " ],

                    // This player skeletons specify the animation and stop 
                    [ " gotoAndStop " , " animationName " ],
                ]
            }],

            // Skeletal animation timeline included in this list (optional attribute default: null) 
            " Bone " : [{

                // Timeline name (with bone names correspond) 
                " name " :  " BoneName " ,

                // Timeline zoom (optional attribute default: 1.00) 
                " Scale " :  1.00 ,

                // Timeline Offset (Optional attributes default: 0.00) 
                " offset " :  0.00 ,

                // Keyframe timeline included in this list (optional attribute default: null) 
                " Frame " : [{

                    // Frame length (optional attribute default: 1) 
                    " DURATION " :  1 ,

                    // Tween easing [0.00: linear, null: no Easing] (optional attribute default: null) 
                    " tweenEasing " :  0.00 ,

                    // Tween easing curve [x1, y1, x2, y2 , ...: Bezier] (optional attribute default: null) 
                    " Curve " : [ 0.00 , 0.00 , 1.00 , 1.00 ],

                    // Frame events (optional attribute default: null) 
                    " Event " :  " eventName " ,

                    // Frame sound (optional attribute default: null) 
                    " Sound " :  " soundName " ,

                    // Bone displacement / miter / zoom (optional attribute default: null) 
                    " the Transform " : {
                         " X " :  0.00 , // horizontal displacement (optional attribute default: 0.00) 
                        " Y " :  0.00 , // vertical displacement (optional attributes default: 0.00) 
                        " SKX " :  0.0000 , // horizontal skew (optional attributes default: 0.0000) 
                        " SKY " :  0.0000 , // vertical miter (optional attributes default: 0.0000) 
                        " SCX " :  1.0000 , // vertical scaling (optional attribute default: 1.0000) 
                        " SCY " :  1.0000  // vertical scaling (optional attribute default: 1.0000)
                    },
                }]
            }],

            // Timeline list Slots This movie contains 
            " The slot " : [{

                // Timeline name (and the name of the corresponding slot) 
                " name " :  " slotName " ,

                // Keyframe timeline included in this list (optional attribute default: null) 
                " Frame " : [{

                    // Frame length (optional attribute default: 1) 
                    " DURATION " :  1 ,

                    // Tween easing [0.00: linear, null: no Easing] (optional attribute default: null) 
                    " tweenEasing " :  0.00 ,

                    // Tween easing curve [x1, y1, x2, y2 , ...: Bezier] (optional attribute default: null) 
                    " Curve " : [ 0.00 , 0.00 , 1.00 , 1.00 ],

                    // Display object index for this frame (skin corresponding slot display a list of objects) (Optional attributes default: 0) 
                    " DisplayIndex " :  0 ,

                    // Display object color overlay (optional attribute default: null) 
                    " Color " : {
                         " aM " :  100 , // superimposed transparent [0 to 100] (optional attribute default: 100) 
                        " rM " :  100 , / / superimposed in red [0 to 100] (optional attribute default: 100) 
                        " gM " :  100 , // green superposition [0 to 100] (optional attribute default: 100) 
                        " bM " :  100 , // blue superimposed [0 to 100] (optional attribute default: 100) 
                        " aO " :  0.00 , // transparent offset [-255 to 255] (optional attribute default: 0) 
                        " rO " :  0.00 , // red shift [ -255 to 255] (optional attribute default: 0) 
                        " gO " :  0.00 , // green bias [-255 to 255] (optional attribute default: 0) 
                        " bO " :  0.00 , // blue offset [-255 to 255] (optional attribute default: 0)
                    },

                    // The player to the current frame, a list of actions performed behavior (Optional attributes default: null) 
                    " Actions " : [

                        // Specify the animation sub-frame playback (only displayed when an object is an effective framework) 
                        [ " gotoAndPlay " , " animationName " ],

                        // Specify the animation and the sub-frame playback stop (only displayed when an object is an effective framework) 
                        [ " gotoAndStop " , " animationName " ],
                    ]
                }],
            }],

            // Freeform animation timeline included in this list (optional attribute default: null) 
            " FFD " : [{

                // Timeline name (and the name of the corresponding skin) 
                " Skin " :  " skinname " ,

                // Timeline name (and the name of the corresponding slot) 
                " name " :  " slotName " ,

                // Timeline name (display object index) 
                " DisplayIndex " :  0 ,

                // Keyframe timeline included in this list (optional attribute default: null) 
                " Frame " : [{

                    // Frame length (optional attribute default: 1) 
                    " DURATION " :  1 ,

                    // Tween easing [0.00: linear, null: no Easing] (optional attribute default: null) 
                    " tweenEasing " :  0.00 ,

                    // Tween easing curve control points list [x1, y1, x2, y2 , ...: Bezier] (optional attribute default: null) 
                    " Curve " : [ 0.00 , 0.00 , 1.00 , 1.00 ],

                    // Vertex coordinate list Index Offset (Optional attributes default: 0) 
                    " offset " :  0 ,

                    // Vertex coordinate list [x0, y0, x1, y1 , ...: relative displacement] (optional attribute default: null) 
                    " in the vertices " : [ 0.01 , 0.01 ]
                }]
            }]
        }]
    }]
}
blurymind commented 7 years ago

Dragonbones also has FFD and mesh binding: https://www.youtube.com/watch?v=xUfosRr9fY4 https://www.youtube.com/watch?v=XPH_ZBzCtfY

They also released this new feature trailer: https://www.youtube.com/watch?v=M8QmyDdYjiM

ndee85 commented 7 years ago

I am currently diving into the dragonbones json file format. This will take me some time to fully understand it. But I am making little progress. I get proper mesh export working. So this means, generated meshes in blender now perfectly match the meshes in dragonbones. Next up, I'll create a simple dragonbones project and examine the exported json format to understand all dependencies and see what I need to add to blender to export it.

I don't want to promise anything yet. But I would love to write a fully functional exporter to dragonbones json format. But this may take some time.

blurymind commented 7 years ago

@ndee85 this is awesome news!! :+1:

It will make it possible to export the coa tools animation data to Unity3d and cocos2d, among other major game engines. Not just Godot. http://dragonbones.com/en/download.html#runLibrary There are javascript, C++ and C# runtimes that are open source - could potentially be ported to other engines.

It will also allow coa tools in blender to replace the DragonBones editor for some users who like using blender more.

ndee85 commented 7 years ago

@blurymind I am making good progress.. Armature is now fully exported. Next will be to properly import meshes. My test on mesh data worked. Now I need to put it properly into the json structure. Here is a little screenshot.

db_export

ndee85 commented 7 years ago

@radishdalek @blurymind I have working mesh and armature export. Draworder, vertex weights and ik will be next on the todo. db_export_02

blurymind commented 7 years ago

@ndee85 you are making an incredibly fast progress with this! Maybe Godot devs might make an importer for the dragonbones json file instead of spine's -it would save the effort of having to make a separate exporter for godot - when it gets mesh deformation features that is. Juan seems to be very set on the task of getting Godot to have it's own animation editor that supports all the Dragonbones features instead of porting the C++ animation runtime that is already available for coccos2d. I doubt that godot will ever get to the level of Blender+coa tools as far as animation workflow goes. It's just not as specialized, b3d+coa will always be a better tool to do rigging and animation. I believe that it will even beat the official Dragonbones editor in terms of workflow.

Once this works, Mike from Gamesfromscratch might be interested in making a video. So far he has covered spine2d and only mentioned dragonbones. Seeing dragonbones export in blender would get his attention

cesarpachon commented 7 years ago

hi! I develop html5 games with cocos2d (javascript) and I am trying to implement the whole art pipeline in opensource and linux (ubuntu, gimp, inkscape, vim) I really really love the idea of following a opensource json standard so we can export from blender and take advantage of all the existing runtimes of different game engines. adopting dragonbones format instead of creating a new one is a wise decision, IMHO. I hope I would like help someway to this project!

blurymind commented 7 years ago

The more software that supports one open file standard, the better it is for the open source community and the file standard. :) Unlike the proprietary tools, we don't need to fragment file types and runtimes, limiting the developers/artists United effort = better runtime support for more game engines out there, bigger community using one standard, better quality tools exporting it

Thank you @ndee85

ndee85 commented 7 years ago

@cesarpachon @blurymind Ok.. I have some more progress. I think the most important and heavy lifting stuff is done. I have now support working for:

Maybe I will make a push with all the changes tonight so you guys can try it out already.

So the next big task will be Animation support. Here is a current screenshot. It matches perfectly dragonbones. The cool thing. Blender with coatools combined offers even a much faster workflow. And blenders Editor has a better performance. So this could really be a great alternative for Linux users. blender_dragonbones

ndee85 commented 7 years ago

@cesarpachon You can help by testing the format. It would be really cool if you try to implement the dragonbones runtime into cocos2d and see if the files that are generated with coatools do work. I will write again once I have pushed everything.

cesarpachon commented 7 years ago

@ndee85 ok, I started by searching the cocos source code, docs and forums. it looks like dragonbones is not directly supported (not runtime in the source code, neither c++ nor javascript)1 I found old references that the cocos studio tool (I don't use it) was able to import it 2, and also references to an option in dragonbones to export for cocos in a special XML format, not JSON 3. So.. as you said, the dragonbones-cocos integration will need to be written from scratch. I'll check the cocos-spine runtime as reference.

ndee85 commented 7 years ago

@cesarpachon What about this? https://github.com/DragonBones/DragonBonesCPP/tree/master/Cocos2DX_3.x I have to admit I have absolutely no clue about cocos2d. But aren't there some libs that can be used/imported in cocos2d?

blurymind commented 7 years ago

The cocos2d runtime has been updated 10 days ago, so it should support the latest features of the file type :)

On Fri, Oct 7, 2016 at 6:40 AM, Andreas Esau notifications@github.com wrote:

@cesarpachon https://github.com/cesarpachon What about this? https://github.com/DragonBones/DragonBonesCPP/ tree/master/Cocos2DX_3.x I have to admit I have absolutely no clue about cocos2d. But aren't there some libs that can be used/imported in cocos2d?

— 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-252157527, or mute the thread https://github.com/notifications/unsubscribe-auth/AGMbVSU48FCL4xK_pagc7I_iEpAjy3ZHks5qxdtggaJpZM4IGsfM .

ndee85 commented 7 years ago

I am taking a look how to best export Animation. This will be a tricky one. I have to admit I am a bit dissapointed by dragonbones animation capablilities. I can only key all channels at once. So pos,rot,scale is one keyframe and also one interpolation curve. I cannot only key rotation for a bone and leave pos or scale unkeyed. This will mean it won't be possible to get all keyframes information from blender to dragonbones. Also dragonbones does only support a max length of 2 for IK bones.

I am thinking of "baking" animations. So that I set a keyframe for everyframe and won't bother interpolation or any IK. That way it won't is not meant for editing in dragonbones but the animation should look the same as in blender. What do you guys think?

Do so many keyframes decrease the performance? I have to admit I don't know. Any suggestions?

cesarpachon commented 7 years ago

@ndee85 @blurymind today I will try to get more information on the real status of the dragonbones-cocos integration. btw, I am right now working with the 3.10 version, not the latest one, because I am at a few weeks of a production deadline and can't risk to break something for changing versions.. about the baking of keyframes, that is not the ideal solution due to the increase in the size of the files, but I don't think that would be overkilling. perhaps we may have some code in the runtimes to get rid of silly channels, where all the keyframes hold the same value.

pixelpicosean commented 7 years ago

I suggest to extend the dragonbone format to include the functionalities you've mentioned, so we have our own(better) format and may also be easy to extend existing runtimes for that, not sure yet.

About the baking, I think too much keyframes may not be a good idea since it will increase file size a lot. Maybe we need some samples to compare with instead of guessing.

blurymind commented 7 years ago

@pixelpicosean the actual format does not require extending to work better in coccos and is a bad idea to fork it and make it incompatible with unity and other already supported via dragonbones runtimes for different game engines.

What you are asking is to update the coccos runtime to support the latest dragonbones format features. I am however puzzled, as looking at the github where the runtime is hosted- it was updated 10 days ago.

So it is possible that people are simply not using it properly or with the case of @cesarpachon , he is using an OLD file format/runtime in order to avoid risks. But running old stuff of course means less features supported :)

blurymind commented 7 years ago

But for animation features its an open format, so perhaps it can be extended without forking a new file standard :) it would be good to communicate with the community there and see if they are already working on something that @ndee85 might have in mind

We could first compile a list of features that are desirable in the format, then post it to their bug tracker - my concern is avoiding creating a fork of the format and more runtimes to support the fork

adamearle commented 7 years ago

Honestly not to be rude but you may as well just beusing Blender it has far better capabilities. Can I ask why you would invest your time into such a program.

Personally again with Blenders new Grease pencil development see developers working on a Blenders Grease pencil would be a wiser investment.

Just my opion though

Adam

On Sat, Oct 8, 2016 at 2:51 AM, Andreas Esau notifications@github.com wrote:

I am taking a look how to best export Animation. This will be a tricky one. I have to admit I am a bit dissapointed by dragonbones animation capablilities. I can only key all channels at once. So pos,rot,scale is one keyframe and also one interpolation curve. I cannot only key rotation for a bone and leave pos or scale unkeyed. This will mean it won't be possible to get all keyframes information from blender to dragonbones. Also dragonbones does only support a max length of 2 for IK bones.

I am thinking of "baking" animations. So that I set a keyframe for everyframe and won't bother interpolation or any IK. That way it won't is not meant for editing in dragonbones but the animation should look the same as in blender. What do you guys think?

Do so many keyframes decrease the performance? I have to admit I don't know. Any suggestions?

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

blurymind commented 7 years ago

@adamearle I don't think you understand the advantages of using json animation data in a game engine. And honestly - we do intend to use blender to export it, so your statement makes no sense. Not to be rude =')

ndee85 commented 7 years ago

@adamearle You are missunderstanding the purpose of the export. I am not exporting to make it work in dragonbones but to use dragonbones gameengine runtimes. That way we just can export and it should work everywhere where dragonbones is supported. Because blender is better I want to make the export work with blender. Skeletal animation has great advantages over spritesheet animation.

ndee85 commented 7 years ago

ok.. I pushed the Dragonbones Export to this repo now. Animation export does not work yet. Still. Please feel free to test the export.

cesarpachon commented 7 years ago

thanks by the effort, @ndee85! but as my actual need is for animations in cocos2d javascript rather tan C++ I can't allocate time for testing the existing dragonbones runtime for C++; even I already asked if it may run in javascript through the JSB bindings, or if it is needed to write a javascript runtime from scratch, as they have for pixi and egret js engines. PD: if it is the case that there is the need of write the JS runtime from scratch, I would prefer to do it for a new, open format supported by COA, just like COLLADA did for 3D (as dragonbones editor didn't run on linux, as COA does). so I will keep an eye on this thread.

blurymind commented 7 years ago

thank you @ndee85 !! I am going to test this asap on Unity3d during the weekend.

I'm afraid I don't use cocos2d and don't like javascript, so I can't be of any help here. Perhaps @cesarpachon could have more luck if he writes about his issues on the cocos2d github or the dragonbones for cocos2d runtime github? https://github.com/DragonBones/DragonBonesCPP/issues which he already did: https://github.com/DragonBones/DragonBonesCPP/issues/128 I wish him best of luck in creating yet another json format, a new exporter and a runtime for it - for cocos2d. I don't understand why everyone is so set on reinventing the wheel here xD It will be the exact same data- give or take, just structured in a different way in the json file.

Because COA runs on linux, it can fill a gap for a number of users (me included), who like to use the runtime, but not the dragonbones editor. Blender is much nicer to use, so there is huge potential here! Dragonbones has an editor plugin on Adobe Flash studio - but people use that less and less nowadays and Flash is proprietary. So Blender can replace it for a lot of people!

@ndee85 we should contact dragonbones developers to feature COA-tools on their website - the way they did with the flash studio addon. It will attract a lot of people to Coa-tools and Blender!

ndee85 commented 7 years ago

@blurymind I contacted them via their support email. I wanted to discuss their animation pipeline a bit. And see if we can split up animation keyframes a bit further. I would be great to key channels like pos, rot or scaling separately. I thought it would be nice to have keyframe groups. Similar as in blender. Lets see if I'll get a response :) I'll need to make sure that I'll write data only when it is different from the initial values, this is how dragonbones also handles writing the data. That way I will also be able to reduce the size of a json file.

ndee85 commented 7 years ago

Finally I have properly working animation data. Currently it is only for bones. So no color/alpha or slot changes. But I think they should be easily added. So here is a gif. I have gone the road of "baking" the keyframes for now. As long as Dragonbones does not support multichannel keys for bone/sprite transformation I'll think this is the road to go. Otherwise the code will get to complicated and it may happen that we can loose animation data from blender.

So, here is a small gif showing the transfered animation. dragon_bones_anim_support

ndee85 commented 7 years ago

So, finally animation support is there. Just pushed everything to github. So here is what is supported right now:

Bones

Slots

Interpolation curves are not supported right now. As already mentioned, Dragonbones has no multichannel keyframing. It is not possible to get proper to convert proper curve data from blender to dragonbones. If very accurate animations are desired, I have added the option to bake animations. This will key for every frame. Otherwise it will only set keys where they really are. Resulting in ok animation representation because interpolation curves are missing.

Todo

blurymind commented 7 years ago

Thank you @ndee85 . Quite a lot of features so far , coa tools is almost on par with the dragonbones editor! For mesh vertex keying - perhaps using blendshapes? Event keyframes are useful for things like sound effects and object spawning

ndee85 commented 7 years ago

@blurymind I thought about blendshapes already. It is not easy to transfer animated blendshapes to dragonbones data structur. But I have a different Idea. We will see if it will work out as I think :)

Now we need testers who actually try and export stuff and use it somewhere with dragonbones runtime to see if it works in a real world environment :)

blurymind commented 7 years ago

I am quite excited about this. Even though I am a godot user, I also use Unity for freelance client work and will give it a try in the weekend! It would be a good idea to post on the dragonbones community forum about coa tools. It will attract more test users http://forum.starling-framework.org/forum/dragon-bones

ndee85 commented 7 years ago

@blurymind good point about the forum. I talked to reduz yesterday. He said that 2d mesh deformation will definately be a target for 3.0! This means I can add proper support for godot soon. I am still thinking which approach I should use. Write a coa tools tscn exporter which writes directly a godot scene file or write a dragonbones json importer?

ndee85 commented 7 years ago

@blurymind I have running event keying working!

And finally, I also have support for animated and bone driven shapekeys! I was testing a lot and came up with a pretty nice solution. So this means that you can create shapekeys in blender. Add bone driver and animate as you like. Those keyed shapekeys will then be transfered to dragonbones. This enables a veeeery powerfull worklow for animating! Even Komplex facerigs are now possible and they will be available in runtimes! I don't think any other package can perform with such feature, since once shapekeys are set up, animating them is a charme! On the other hand, animating vertex coords of meshes is very unintuitive!

I'll try to push this tonight! Have to clean a few rough edges here and there.