mauville-technologies / godot_dragonbones

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

change the method to obtain the bone position #28

Closed arisvaldez closed 3 years ago

arisvaldez commented 3 years ago

change the method to obtain the bone position, you are currently using boneData->animationPosition, but this returns a Vector2 (0,0), and always return the same value.

However if you get the value from boneData-> Global, you will be able to obtain the real time value of the bone movement.

Vector2(boneData->Global.x, boneData->Global.y)

I already made that modification and it worked for me.

davord45 commented 3 years ago

@arisvaldez This actually works? You get global position of the bone in Godot viewport?

arisvaldez commented 3 years ago

@davord45 ,That's right, I made the change that I proposed and it works wonders for me

davord45 commented 3 years ago

Can you make a pull request? @arisvaldez Or maybe a build that you can share?

arisvaldez commented 3 years ago

I can share a compilation and also the modified code

davord45 commented 3 years ago

I would appreciate that very much,thanks!

arisvaldez commented 3 years ago

u can download a build from here

godot 3.2.3

davord45 commented 3 years ago

Thanks again!

arisvaldez commented 3 years ago

you can download the code from this repo

I just added some methods in the GDBone.cpp and GDBone.h

I did not delete or replace the ones you had already put, but add more

arisvaldez commented 3 years ago

@davord45 look in the file DragonBones/src/dragonBones/armature/Bone.cpp

in this file I made a modification in the method _updateGlobalTransformMatrix

I would like to make a pull request, but I have never done one, so I would not want to spoil something, jeje.

davord45 commented 3 years ago

@arisvaldez What changes did you make in DragonBones/src/dragonBones/armature/Bone.cpp? I don't see any changes. :/

Ozzadar commented 3 years ago

Weird that im not getting emails about this.

Anything left to do after the recent merge @davord45 ? Looks to me like this issue can be closed but just want to make sure.

davord45 commented 3 years ago

Well setting the global position does not seem to be working when i try it. But i guess that is a different issue.

Ozzadar commented 3 years ago

Ok, I'll leave this open and look into it when I start putting together the 3.2.4 release (probably this weekend).

Thanks :)

On Thu, 18 Mar 2021 at 12:38, davord45 @.***> wrote:

Well setting the global position does not seem to be working when i try it. But i guess that is a different issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mauville-technologies/godot_dragonbones/issues/28#issuecomment-802095227, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM5S4UCXAHWWK4TSVTQYHTTEIT7HANCNFSM4USEM3EA .

arisvaldez commented 3 years ago

@arisvaldez What changes did you make in DragonBones/src/dragonBones/armature/Bone.cpp? I don't see any changes. :/

I think that the change I made did not apply, and it was not relevant

Ozzadar commented 3 years ago

I've linked the PR that makes a few changes across the bone to the way bone position is handled to enable a set_bone_global_position function.