gddragonbones icon indicating copy to clipboard operation
gddragonbones copied to clipboard

feature request: ability to set slot alpha and other slot methods

Open blurymind opened this issue 6 years ago • 13 comments

It would be very useful if we can affect various slots in a dragonbones asset via gdscript. Ability to set slot opacity, set blend mode, even replace slot image.

These features seem to be missing in the runtime at the moment, as the methods are not exposed to gdscript

DB provide lots of API to support Avatars System for different requirements.

  1. change slot display index slot.displayIndex = xxx
  2. change slot display directly slot.display = xxx
  3. change slot display from db factory (to ensure pivot is set by designer in DBPro) armatrue.replaceSlotDisplay(xxx,xxx,xxx, slot)
  4. change mesh texture armatrue.replaySlotDisplay(xxx,xxx,xxx, slot)
  5. change textureatlas armature.replaceTexture()

here are some examples https://www.csharpcodi.com/csharp-examples/?api=DragonBones.Slot

blurymind avatar Jan 26 '18 19:01 blurymind

possibly this could set opacity and color modulate? https://github.com/sanja-sa/gddragonbones/blob/5e12611d768d3fb967b75ae39610df4c1e486578/gddragonbones/src/dragonBones/armature/Slot.h#L334

Was having some fun digging around and looking at your commits to see how you expose the methods https://github.com/sanja-sa/gddragonbones/search?utf8=%E2%9C%93&q=dragonbones.slot+display&type=

My C++ experience is not yet up to the level though

Here are some examples from dragonbones forum,on swapping sprites on slots https://forum.starling-framework.org/topic/dragonbones-pro-setting-up-for-changing-clothes

documentation in chinese http://edn.egret.com/cn/apidoc/egret/name/dragonBones.Slot

blurymind avatar Feb 01 '18 20:02 blurymind

@blurymind I thinks it's right, but I need some time to return for updating module with new functionality. It's better to test now current version for get stable version, than we can go further. We need TODO list for brilliant ideas.

sanja-sa avatar Feb 02 '18 09:02 sanja-sa

@sanja-sa thank you. I will test the module more extensively and see if I can catch any more crashes or bugs. It seems to be quite stable at the moment btw

blurymind avatar Feb 02 '18 15:02 blurymind

Hello @sanja-sa!

I was just checking out your addon's issues (no offence), and for the easiest means of using DB anims in Godot, this feature is quite important. Hence, I also request that this gets implemented, as some of my anims require this.

That's all! Have a nice day!

definite-d avatar Mar 15 '19 20:03 definite-d

@sanja-sa Is this something you have time to work on? As I see it we can probably do that with godot's native polygon2d node. What would be great is to get and importer for dragonbones files that converts the data to godot nodes

blurymind avatar Mar 22 '19 11:03 blurymind

Hello @blurymind!

Your suggestion is fantastic! It's good that I'm not the only one who thought Polygon2Ds are like DB meshes.

definite-d avatar Mar 23 '19 09:03 definite-d

Just thinking that there will be less code to maintain that way..

On Sat, Mar 23, 2019, 9:28 AM Afam Divine [email protected] wrote:

Hello @blurymind https://github.com/blurymind!

Your suggestion is fantastic! It's good that I'm not the only one who thought Polygon2Ds are like DB meshes.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sanja-sa/gddragonbones/issues/5#issuecomment-475854877, or mute the thread https://github.com/notifications/unsubscribe-auth/AGMbVasyrnWwryFbSSxFnmL8_HHBgzBPks5vZfO9gaJpZM4RuwEd .

blurymind avatar Mar 23 '19 11:03 blurymind

Polygon2D for now is slow on rendering, i think that this is bad idea.

Ranoller avatar Mar 23 '19 12:03 Ranoller

@Ranoller what node would you suggest for such a purpose?

definite-d avatar Mar 23 '19 12:03 definite-d

@definite-d if you want a 2d mesh deformation in your animation, only polygon2d can do it http://docs.godotengine.org/en/3.1/tutorials/animation/2d_skeletons.html However there seems to be a performance issue with it https://github.com/godotengine/godot/issues/19943 @sanja-sa basically created a new node and @Ranoller is already suggesting to use it - as it is more performant than polygon2d. But the dragonbones node lacks some basic features still when compared to its runtime and has only seen maintenance updates. It would be nice if somebody makes a pull to add these features to make it on par with godot's internal node

blurymind avatar Mar 25 '19 11:03 blurymind

Hello!

Sorry to bother on this topic again, but this issue is quite a pain in my team's workflow. Certain anims require it, and now we're stuck between having to readapt the anims (which would eliminate the effects) and exporting to sprite frames (which would reserve the effects but would lead to a memory hog). Would a viable solution be to use the Frames feature of DB, or is this feature close to release? Please help.

definite-d avatar May 29 '19 11:05 definite-d

It's kind of why I don't use this runtime seriously atm. I really wish this feature was exposed to Godot

On Wed, May 29, 2019, 12:59 PM Afam Divine [email protected] wrote:

Hello!

Sorry to bother on this topic again, but this issue is quite a pain in my team's workflow. Certain anims require it, and now we're stuck between having to readapt the anims (which would eliminate the effects) and exporting to sprite frames (which would reserve the effects but would lead to a memory hog). Would a viable solution be to use the Frames feature of DB, or is this feature close to release? Please help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sanja-sa/gddragonbones/issues/5?email_source=notifications&email_token=ABRRWVMU2SWKMHX3MHM6SDDPXZV2XA5CNFSM4EN3AEO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWPDABA#issuecomment-496906244, or mute the thread https://github.com/notifications/unsubscribe-auth/ABRRWVPFSRTGJYOE3OQP7XTPXZV2XANCNFSM4EN3AEOQ .

blurymind avatar May 29 '19 12:05 blurymind

Well... this module is only changed to maintain compilation in godot master (in my branch) because original author doesn´t seem to be available. I only can guarantee compatibility with godot master if i don´t find a top-breaking change that i can not solve (not really c++ programmer)... so, probably not new features will be added.

For the moment i compile it in my system every x weeks to test with new godot changes and module compiles... i will try to maintain this compatibility until polygon internal vertices in godot can be animated and the polygon editor becomes more functional... before... well. This module can be droped out.

Ranoller avatar May 29 '19 12:05 Ranoller