mauville-technologies / godot_dragonbones

Plugin module for Godot 2.1 & Godot 3 Game Engine to use DragonBones
MIT License
87 stars 13 forks source link

Adding the ability to nest animations within slots on a parent animation #13

Closed Ozzadar closed 4 years ago

Ozzadar commented 4 years ago

Wiki for this feature: https://github.com/mauville-technologies/godot_dragonbones/wiki/Feature:-Nested-Dragonbones-Projects

Very likely going to go into a 3.2.52 release (2 releases from now) -- as this has a ripple effect and I want to design it right;

this PR proves the concept though

New function signatures:

sprite.nest_armature_in_slot(project_name, slot_name, _ske_resource)

In this GIF, the hat is a separate Hat dragonbones project and nested within a hat slot on the Player project Define your child animations in editor: image

onready var sprite = $Sprite

# Called when the node enters the scene tree for the first time.
func _ready():

    sprite.display_child_animation_on_slot("OtherHat", "hat") 

ezgif-7-aa7f72888820

blurymind commented 4 years ago

the beginnings of animation blending and mixing? :)

Ozzadar commented 4 years ago

Yeah. We discovered that setting child armatures in the slots is possible within the DragonBones API -- but not by the DragonBones Pro editor itself.

Doing it this way will allow you to keep all your animations independent of each other. (Good for things like objects, guns, etc); getting around the 4000px X 4000 px limit on the texture atlas sizes generated in DragonBones Pro.

It looks completely do-able; but there are errors on destroying an object with nested armatures.

I estimate that this will take me at least a few weeks to iron out the kinks and generate enough assets to prove it out to my liking.

It's become the headline feature of 3.2.52 =)

https://www.godotdragonbones.com/feature-roadmap

Ozzadar commented 4 years ago

Closing this as the lovely folks over in the Discord helped me understand the native Dragonbones implementation of child armatures; so I was able to get it working, see this PR:

https://github.com/mauville-technologies/godot_dragonbones/pull/17