coa_tools
coa_tools copied to clipboard
Idea: One open standard Json animation file specification to rule them all
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?
- Your game uses much less memory - as only one frame is used and the animation (movement of body parts) is being driven by the game engine's runtime. You get better framerate!
- Your animation can be procedurally altered during runtime - since the runtime is driving it, the programmer can layer ontop or override animations. For example you can have your player character's head turn in the direction of a specific object on the screen.
- Your game/app uses much less HD space - smaller file size makes it much better for mobile development where file size is important.
- You can swap body parts of your character, as the animation is running. This makes it very easy to implement an equipment system that actually affects the way your character looks or reuse the same animations an all the enemies you want in the game - while having them look different.
What other software can use this technique and export animation data to a json file?
- Spine 2d
- Spriter
- Creature
- anime studio
- toonboom harmony
Popular games that use it:
- rayman origins, rayman legends, dragon's crown, etc etc
What open source software can do this already?
- Godot and Blender (via coa tools)
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.
also posted this at godot tracker: https://github.com/godotengine/godot/issues/4312
Lets see if it gets some attention.
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
Now to update Haxe support: https://github.com/SlavaRa/haxelib-dragonbones/issues/11
@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?
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:
- standalone (free)
- as an addon for Adobe flash studio (open source and free)
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 [email protected] 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
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?
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" [email protected] 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
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
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
There's also this for OpenFL, only in beta and for DB 2.2, but still: https://github.com/jalbanesi/openfl-dragonbones
Just taking a look at Dragonbones. Wow.. that looks pretty advanced!! Maybe this could really be an alternative in the future!
@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:
- its mature/tested/has a community and developers
- Supports ALL features of Spine2d - it's the most advanced specification that is open
- It's open source
- Already has multiple other game engine runtimes - Unity/C# being the most mature one
- The runtimes are not locking the user to a license and do not require a fee
- Animation data can already be edited in their free editor or in adobe flash - multiple applications can author it.
Do you think we should advocate the bragonbones json data structure to godot devs or let them make a new one?
@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?
@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.
@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
they updated their website to reflect the features http://dragonbones.com/en/animation.html#.V8_VCfkrK9I
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]
@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 ]
}]
}]
}]
}]
}
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
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.
@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.
@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.
@radishdalek @blurymind
I have working mesh and armature export. Draworder, vertex weights and ik will be next on the todo.
@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
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!
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
@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:
- Meshes
- Armatures (Bone Matrices and Posing)
- Weighting
- IK Constraints
- Slots Support (easily swapping meshes)
- Color and Alpha
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.
@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.
@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.
@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?
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 [email protected] 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 .
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?
@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.
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.
@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 :)
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
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 [email protected] 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 .
@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 =')
@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.
ok.. I pushed the Dragonbones Export to this repo now. Animation export does not work yet. Still. Please feel free to test the export.
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.
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!
@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.
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.
So, finally animation support is there. Just pushed everything to github. So here is what is supported right now:
Bones
- Position
- Rotation
- Scale
Slots
- Color
- Alpha
- Slotindex
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
- Event Keyframes. Dragonbones can add keys for sounds or events that will execute stuff in the runtimes. This is not implemented yet.
- Texture Atlases for graphics
- Mesh Vertex Keying. This can be a tricky one. Don't know if I can do it yet.
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
@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 :)
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
@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?
@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.
@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:
@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!!
Ok. Just pushed timeline events and shapekey support for dragonbones with this commit 4a4122af5ba7df8f960a4d11b05574eb4c90b116
@ndee85 epic win!! Thank you for the awesome updates! :D Time to make the other editors have a run for their money
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? ^^
@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
@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.
@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.
@ndee85 Thank you, you are rapidly improving the entire workflow! This will save a lot of time and simplify the process
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
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 =/
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...
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).
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" [email protected] 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 .
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
@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.
They have a lua runtime for cocos which can potentially be adopted or taken as inspiration :)
On 28 Nov 2016 18:41, "Ross Hadden" [email protected] 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 .
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.
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
@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.
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!
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
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.
@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.
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!
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!!