Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DragonBones exporter does not export events and Z depth #171

Open
davord45 opened this issue Sep 26, 2020 · 36 comments
Open

DragonBones exporter does not export events and Z depth #171

davord45 opened this issue Sep 26, 2020 · 36 comments

Comments

@davord45
Copy link

davord45 commented Sep 26, 2020

Hi ndee85.

Dont know if you are working on this addon anymore,i see you post a commit from time to time.I gotta report that DragonBones exporter is not finished,if you could please finish it so that it exports Z depth animation and events.I use it in Godot game engine and its awesome,just lacking those features.

Hope you see this.

@davord45
Copy link
Author

davord45 commented Oct 5, 2020

#173
I made a pull request for this isssue,for anyone having the same problem.

@ndee85
Copy link
Owner

ndee85 commented Dec 12, 2020

Hi @davord45,
do you have a sample file that animates those properties? Do you use a custom build godot version to test?

@ndee85
Copy link
Owner

ndee85 commented Dec 13, 2020

Implemented zOrder animation with this commit: ceb5a4c
Next I am going to implement the event system.

@davord45
Copy link
Author

davord45 commented Dec 14, 2020

Sorry for getting back so late,i am using Godot Dragonbones module which you can download here:

https://www.godotdragonbones.com/

Its already compiled so no need to do that.

@davord45
Copy link
Author

I can make you a sample file tommorow.

@davord45
Copy link
Author

davord45 commented Dec 14, 2020

Thanks for taking the time to implement these features btw! @ndee85

@davord45
Copy link
Author

davord45 commented Dec 14, 2020

Also the events i managed to export only Sound and Play type not regular events cause they are a Array of events and the JSON formatter caused an error when i tried to add an array. Hopefully you can figure that out. Right now in my pull request In COA regular events are play events.

@ndee85
Copy link
Owner

ndee85 commented Dec 14, 2020

I have checked the regular events yesterday. I think it shouldn't be to hard to add. I will have a look at it when I have some spare time.

@ndee85
Copy link
Owner

ndee85 commented Dec 14, 2020

I didn't know that extra godotdragonbones version existed :-)
Good to know.

@davord45
Copy link
Author

I tested out zOrder export and it works great!
Way more elegant than what i had lol.

@ndee85
Copy link
Owner

ndee85 commented Dec 14, 2020

Great. Glad to hear!
Goint to add the event system soon and than I think the exporter should be more or less complete. Or do I still miss something?

@davord45
Copy link
Author

Well i found that meshes that are Slots which have a ShapeKey driver deformation, those deformations dont get exported like regular Mesh ShapeKey deformations. And animation curves always get exported as a standard S curve. Also i found that when the bone scale for instance X goes to negative value it exports Y value as a negative as well,even when its positive. I have implemented some fixes for that. Do you think it is possible also to make 2 bone IKs to export as DragonBones IK? Cause i know that IKs get baked into chain bones.

@davord45
Copy link
Author

davord45 commented Dec 14, 2020

Slots deformation and scale are kind of a bug and Curve and IK are more of a new feature.
Thats all i found missing in the exporter,rest is amazing.

@ndee85
Copy link
Owner

ndee85 commented Dec 14, 2020

the problem with ik is that they don't behave the exact same way as in dragonbones. Blender is more powerful in that regard. So I thought the best way would be to bake those. Based on the setup it can differ quite a lot in blender. So think the best way is to bake in that case. It is similar with the curves. Blenders graph editor is way more flexible, end exporting this is not as easy. :-)

@davord45
Copy link
Author

davord45 commented Dec 14, 2020

Understandable,i managed to export curves but in some cases when the curve is really extreme DragonBones runtime starts freaking out. But i found that when i divide the value i can get some variation in curves. It helps the animation,but i guess baking the animation solves that issue, but it leaves bunch of keyframes.

@ndee85
Copy link
Owner

ndee85 commented Dec 14, 2020

Ok. Timeline Events are now fully supported. Please have a test with your files and see if they work as expected!
Commit: ba0e0ad

@ndee85
Copy link
Owner

ndee85 commented Dec 14, 2020

Forgot to commit some changes. So now everything should be updated.
ea3dc7e

@davord45
Copy link
Author

davord45 commented Dec 14, 2020

I added the events but they dont export or they export in the JSON but are not imported in the DragonBones Editor. And now i got a bug with the zOrder export as well,i made a simple one arm go behind the body and other go in front.In DragonBones Editor it made the keyframes but the only plays second arm going in front of the body but on a keyframe where first arm goes behind the body.

@davord45
Copy link
Author

davord45 commented Dec 14, 2020

Do you want me to send you the .blend to test with it?
Also there is no limit to sound events,if you add too many sound events it crashes the DragonBones Editor and probably the runtime.

@davord45
Copy link
Author

davord45 commented Dec 14, 2020

@ndee85 Here is the link to the .blend file:
https://www.mediafire.com/file/e02akkpnvz2ov5m/nDeechaser.blend/file

Attack animation is the only one that has events and zOrder animation.
Also i didnt bake the animation when i was exporting.

@ndee85
Copy link
Owner

ndee85 commented Dec 14, 2020

Thanks. I'll have a check with your file an see what is causing the problem.

@ndee85
Copy link
Owner

ndee85 commented Dec 14, 2020

Are you sure you updated the sources correctly? I just tested your file and all events did export properly. Also adding multiple sound events should not be possible on the same frame. Do you have an "Animation" event? If not, you did not update correctly.

Just checked that drawing order is still not working correctly in some cases. Will have a recheck on that.

@davord45
Copy link
Author

I didnt have "Animation" type,I downloaded the commit from blender28 and installed it to Blender. Do i need to update in Blender as well?

@ndee85
Copy link
Owner

ndee85 commented Dec 14, 2020

make sure to zip the coa_tools directory from Blender directory. Install that zip file then.

@davord45
Copy link
Author

davord45 commented Dec 14, 2020

You are right i was downloading the wrong branch. Sorry about that.

Now exporting works very nicely, I like how you give on Animation events dropdown of all animations!

May i ask how do Target,Int,Float,String fields on regular events effect JSON and what is their use in DragonBones?

Thank you for this nice feature! @ndee85

@ndee85
Copy link
Owner

ndee85 commented Dec 15, 2020

I have to admit I am not sure how to use the custom event. I asume it will trigger a callback in the runtime with the given parameters that can be set. The rest will be up to the dev what callback will be doing. But those are just assumptions.

I just reverse engineered the json file that dragonbones exports and made sure it outputs the same structure.

@ndee85
Copy link
Owner

ndee85 commented Dec 15, 2020

Just checked the godotdragonbones. It seems there are two signals in godot. One is for triggering sounds and the other is used to trigger customEvents.

dragon_anim_snd_event
dragon_anim_event

The dragon_anim_event will have a dictionary parameter which delivers the int, float and string props.

@davord45
Copy link
Author

davord45 commented Dec 15, 2020

Nice, that does seem useful actually.

Was wondering could you add a field on the export panel for naming the armature? Cause right now everything that gets exported is called "Armature". Godot Dragonbones module has a way to control child armatures that are parented to a bone of another armature. Demonstrated in the video below.

https://youtu.be/qUPBceXtIDM

Naming the armature in COA would save some time.

#176
This pull request has a field for naming the armature.

@davord45 davord45 reopened this Dec 15, 2020
@ndee85
Copy link
Owner

ndee85 commented Dec 15, 2020

ok. Just added the armature name in the export settings.
You can also update COATools via the addon preferences. There for open the addon settings.
Refresh and then install the blender28 branch. Just force the install. This will get the latest source from the github repo.

@davord45
Copy link
Author

I get this error when i try to export. But i dont have slots in this armature.
image

@davord45
Copy link
Author

davord45 commented Dec 15, 2020

Updated to a new commit,its different error

image

@ndee85
Copy link
Owner

ndee85 commented Dec 15, 2020

Is this the exact same file you posted above? Strange exports fine for me. Did you restart after updating blender?

@ndee85
Copy link
Owner

ndee85 commented Dec 15, 2020

Also just added a check which makes sure that slot_data does exists before accessing it. Not sure if this will fix your issue. Or something else is the root. But please make sure to restart blender after updating to latest branch.

@davord45
Copy link
Author

davord45 commented Dec 15, 2020

It was the same project. I updated it but i dont see a check for slots. But it worked now correctly.

Armature name in DB Editor is as i set it in COA.

@ndee85
Copy link
Owner

ndee85 commented Dec 15, 2020

Ok. Still working on exporting the zOrder correctly. I noticed some problems which I need to think of how to best fix.

@davord45
Copy link
Author

davord45 commented Dec 15, 2020

If it helps i noticed that the zOrder in DragonBones is looking at the default order and then comparing to the changed order on the keyframe. It looks what is the fastest way of rearranging the order of meshes from top to bottom in order. It does not compare changed order to the previous order in animation,just the default one.

Hopefully that helps you out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants