Coder Social home page Coder Social logo

ranoller / gddragonbones Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sanja-sa/gddragonbones

39.0 5.0 6.0 941 KB

Plugin module for Godot 2.1 & Godot 3 Game Engine to use DragonBones

License: MIT License

Python 0.01% C++ 97.80% C 2.19%

gddragonbones's Introduction

GDDragonBones Plugin

Plugin module for Godot Game Engine to use DragonBones

Forks:

To compile with godot 2.0 to 3.0 use the original repo:https://github.com/sanja-sa/gddragonbones ( needed to compile 2.0 )

To compile with godot 3.1 to 4.0 before vulkan merge you can use this repo: https://github.com/Ranoller/gddragonbones (you are here!)

To compile with godot 3.1 to 4.0 after vulkan merge use: https://github.com/mauville-technologies/godot-dragonbones (current maintained repo)

Links

Support Versions

  • Godot 2.1 & Godot 3
  • DragonBones Pro 5.6

Support Platforms

  • Windows
  • Android
  • iOS
  • x11 (Linux)

Compiling

  1. Drop the "GDDragonBones" directory inside the "modules" directory on the Godot source.

  2. See the official docs for compilation instructions for every supported platform.

  • Compiling Godot Engine with flag for Android:
android_stl=yes

Sample

Samples

Play/Stop animation

var skeleton = get_node("skeleton")

# if needed set speed animation
skeleton.set_speed(0.5)

# set current animation, if not choosed before
skeleton.set("playback/curr_animation", "walk")

# start play	
skeleton.play()

# start play from time in sec
skeleton.play_from_time(2);

# start play from progress [0 - 1]
skeleton.play_from_progress(0.5);

#stop animation
skeleton.stop()

#stop all animation
skeleton.stop_all()

Mixing(blending) animation

var skeleton = get_node("skeleton")

# if needed set speed animation
skeleton.set_speed(0.5)

# play animation by layers, see DragonBones documentation for parametrs
skeleton.fade_in("idle", -1, -1, 2, "", GDDragonBones.FadeOut_All)
# 1. "idle" 	-- The name animation.
# 2. "-1" 	-- The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1)
# 3. "-1" 	-- playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1)
# 4. "2" 	-- The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0)
# 5. "" 	-- The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null)
# 6. GDDragonBones.FadeOut_All -- The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: GDDragonBones.FadeOut_SameLayerAndGroup)
#	GDDragonBones.FadeOut_None 		-- Do not fade out of any animation states.
#	GDDragonBones.FadeOut_SameLayer 	-- Fade out the animation states of the same layer.
#	GDDragonBones.FadeOut_SameGroup 	-- Fade out the animation states of the same group.
#	GDDragonBones.FadeOut_SameLayerAndGroup -- Fade out the animation states of the same layer and group.
#	GDDragonBones.FadeOut_All 		-- Fade out of all animation states.	
#	GDDragonBones.FadeOut_Single  		-- Does not replace the animation state with the same name.
#
# skeleton.fade_in("walk", 0.3, 0, 0, "normalGroup", GDDragonBones.FadeOut_All)

# run animation in "1" layer
skeleton.fade_in("eyes_idle", -1, -1, 1, "", GDDragonBones.FadeOut_SameLayer)

# stop specified animation by name
skeleton.fade_out("eyes_idle")

Set pose from animation

var skeleton = get_node("skeleton")

# choose animation
skeleton.set("playback/curr_animation", "idle")

# seek animation [0.0-1.0]
skeleton.seek(0.5)

gddragonbones's People

Contributors

blurymind avatar ranoller avatar sanja-sa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gddragonbones's Issues

GDOwnerNode does not exists (Godot 3.2.2 stable Mono version)

Hello, while generating the mono glue I get the following error: (using Godot 3.2.2 stable Mono version)

ERROR: BindingsGenerator::_generate_cs_type: Base type 'GDOwnerNode' does not exist, for class 'GDDragonBones'. At: modules\mono\editor\bindings_generator.cpp:1210 ERROR: BindingsGenerator::generate_cs_api: Generation of the Core API C# project failed. At: modules\mono\editor\bindings_generator.cpp:1115 ERROR: BindingsGenerator::handle_cmdline_args: --generate-mono-glue: Failed to generate the C# API. At: modules\mono\editor\bindings_generator.cpp:3181

Am I doing something wrong? Does this module support mono? Thanks!

error: use of typeid requires -frtti

modules/gddragonbones/src/dragonBones/model/UserData.h:41:5: error: use of typeid requires -frtti
BIND_CLASS_TYPE_A(UserData);

The command I used:
scons platform=android target=release android_arch=armv7 android_stl=yes

I got this error and many other similar errors while compiling for android
I'm using Android NDK R20

FORKS OF GODOT-DRAGON BONES: please read _before_ make an issue

Forks:

To compile with godot 2.0 to 3.0 use the original repo: https://github.com/sanja-sa/gddragonbones ( needed to compile 2.0 )
To compile with godot 3.1 to 4.0 before vulkan merge you can use this repo: https://github.com/Ranoller/gddragonbones (You are here!)
To compile with godot 3.1 to 4.0 after vulkan merge use: https://github.com/mauville-technologies/godot-dragonbones (current maintained repo)

Please, is you have a compiling problem, test that you are using the correct repo with the correct version.

Slots?

Nice, we can change animation but how about slots?
Thx.

Imported dragonbone files rotating around the wrong axis

Hi there, thanks so much for keeping this module updated.
The problem is that, after importing, the body parts of the rig-doll just went all over the place (sorry for the rather... curious wording). However, the same file works properly in Unity. I think you can see the problem more clearly by clicking the link. Two pictures, one in Unity, one in godot.
I'm building with godot 3.22 RC. I wonder what I did wrong?
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.