sanja-sa / gddragonbones

Plugin module for Godot 2.1 ... Godot 3.4 Game Engine to use DragonBones
MIT License
95 stars 44 forks source link

Texture doesn't render - on older dragonbones file format #4

Closed blurymind closed 6 years ago

blurymind commented 6 years ago

I will try this again at home to make sure, but on a windows 7 pc with an ordinary video card (Ati Radeon HD 3470), this is what I get: dbonesrenderissue

Here is the terminal output:

running cmdline: "F:\stuff\godot\godot-2.1.4-dbones.exe" "-path" "F:/stuff/godot
/godot/dragonbones" "-editor"
unicode error: invalid skip
DB resource (res://Rooster_Ani/Rooster_An_ske.json) loaded in 3 msecs
ERROR: ImageTexture::create_from_image: Condition ' p_image.empty() ' is true.
   At: scene\resources\texture.cpp:196
ERROR: Node::remove_child: Condition ' idx == -1 ' is true.
   At: scene\main\node.cpp:790
Also saving modified external resource: res://Rooster_Ani/Rooster_An_tex.png
ERROR: Node::remove_child: Condition ' idx == -1 ' is true.
   At: scene\main\node.cpp:790
running: F:\stuff\godot\godot-2.1.4-dbones.exe -path F:/stuff/godot/godot/dragon
bones -rdebug 10.166.192.114:6096 -allow_focus_steal_pid 3304 -p 0x0 res://Node2
D.tscn
running cmdline: "F:\stuff\godot\godot-2.1.4-dbones.exe" "-path" "F:/stuff/godot
/godot/dragonbones" "-rdebug" "10.166.192.114:6096" "-allow_focus_steal_pid" "33
04" "-p" "0x0" "res://Node2D.tscn"
DB resource (res://Rooster_Ani/Rooster_An_ske.json) loaded in 3 msecs
ERROR: Node::remove_child: Condition ' idx == -1 ' is true.
   At: scene\main\node.cpp:790

The errors pop up when running the game

My home laptop has a much better video card - will post again later tonight to see if its related

Ranoller commented 6 years ago

If you are exporting from a version of dragonbones down to 5.5 texture doesn´t render (tested). It´s the case?

Edit: I test with the latest commit (Flip V H) and works well in Win7, with intel graphics and nvidia (2 different computers)

blurymind commented 6 years ago

@Ranoller that's possible, I am attaching the file used for testing here: Rooster_Ani.zip It's just the rooster example file straight from the editor (5.6) Please let me know if it works for you

I wasn't able to export it from the editor on this computer due to https://forum.starling-framework.org/topic/cannot-save-or-export-requires-login-login-fails-due-to-blocked-access

So what I did is try to load it straight from the examples folder

I will further test at home, where the network access problem can be resolved

sanja-sa commented 6 years ago

@blurymind If you open in text editor file 'Rooster_An_ske.json' (from your example folder) you can see such strings:

{"frameRate":24,"isGlobal":0,"name":"Rooster_Animation_Project_v24","version":"5.0"

I think, this is wrong version of DB file. The authors not included 5.5 version of examples. You can try from attached file (folder 5.6 ver.) rooster.zip. I'll check old version, why they not loading in debugger. Most likely, DB Runtime not loading old version DB export (I must check it).

blurymind commented 6 years ago

@sanja-sa You are correct! 5_6 from the attached works and 5_0 fails to render Should we consider this a bug? Perhaps there should be a warning when opening an old dragonbones file? But there are currently more important features to do.

Would you like me to close this?

sanja-sa commented 6 years ago

@blurymind Thanks!! This was i little bug(or not). When it is loading DB res file with old version in texture atlas data not present texture atlas size (and in this case present zero divison :( ). Now, I have correct it in code, when testing is done and ok, I'll commit correction.

blurymind commented 6 years ago

@sanja-sa thank you! :+1: I am really happy how good this module is becoming

@ndee85 has an addon for blender that can export to the dragonbones format: https://github.com/ndee85/coa_tools But I think it exports to an older version of dragonbones atm. Something worth noting to him

Using @ndee85 's addon instead of the dragonbones editor would resolve the network problem issue

sanja-sa commented 6 years ago

Fix: https://github.com/sanja-sa/gddragonbones/commit/1bd1f8d6931bab670ed1b8bcee0a745e56c67544

Ranoller commented 6 years ago

Oh man.... if it reads dragonbones files before 4.9.5 it will be awesome (Dragonbones later 5.5 become in more restrictive controls that any program in my computer... login to save!!!!, i didn´t see this kind of invasive DRM in any commercial program in the world). In version 4.9.5 there are all needed functions to animate. I will compile later and test. Good work.

Ranoller commented 6 years ago

@sanja-sa thank you! +1 I am really happy how good this module is becoming

I subscribe this!

blurymind commented 6 years ago

@Ranoller Yeah that is true, it has been brought up on multiple different forums. My speculation is that dragonbones editor will become a subscription model service in the future. Having support for 4.9.5 will allow us to use the older version of the editor that doesn't have the network restrictions.

I brought this issue here as well: https://forum.starling-framework.org/topic/fatal-error-on-export It seems that the moderator of the forum is not a part of the development team working on the editor.

My hope is that they remove the network restriction regardless of what they decide to do with the editor. Its great that we can use Blender and Coa-tools instead of the Dragonbones editor to create and author dragonbones files - that is the only thing that makes it truly open source.

Ranoller commented 6 years ago

It´s a pitty. I use dragonbones because i need a animation program with "no administrator rights" for one of the computers that i have in the day. I´m paid user of 300$ version of spine, but i can´t use spine in this computer. Dragonbones and blender works. For me is not question of money, is question of portability (and transparency like godot, dragonbones is losing transparency). Version 5.6 tries to connect with an Node.js aplication without any explanation... it´s strange. But version 4.9.5 have all the basics to work with.

And obviously Dragonbones is a plagiarism of Spine, function to function. I hope Dragonbones doesn´t turn in a kind of ransomware like other programs with "folders creation all disk in computer", "comprobations", "connecting without asking" etc..... by the way they have some of this. If you install later ver, previously is deleted without ask, no mathers the folder in it is (There is workaround, but it will doesn´t needed)

sanja-sa commented 6 years ago

@Ranoller If it'll not work 4.9.5 ver files, give me DB file with 4.9.5 ver, I'll test it.

Ranoller commented 6 years ago

I did test.... there is the dragon exported to 4.5 format and 4.0 format: (there is not a 4.9.5 format): DragonBonesExport4_0.zip DragonBonesExport4_5.zip

Works, but have some issues: 1) Default position is strange, like it was the first position for the editor resources inside dragonbones. 2) Animation doesn´t loop at -1

Other things works (I don´t test by code, only editor, i don´t know if blend animations works)

blurymind commented 6 years ago

@sanja-sa I confirm that loading older dragonbones files works in godot now, The rendering issue is resolved! However they can some times crash the editor. I loaded a 5.6 rooster, then after that loaded the 4_5 dragon example @Ranoller shared and that crashed godot editor. Here is the terminal output

OPENING: F:/stuff/godot/godot/dragonbones (F:::stuff::godot::godot::dragonbones)
running cmdline: "F:\stuff\godot\godot-2.1.4-dbones2.exe" "-path" "F:/stuff/godot/godot/dragonbones" "-editor"
unicode error: invalid skip
DB resource (res://Rooster_Ani/Rooster_Ani_ske.json) loaded in 0 msecs
ERROR: GDDragonBones::set_resource: Null resources
   At: modules\gddragonbones\gddragonbones.cpp:174
DB resource (res://Rooster_Ani/rooster/5_6/Rooster_Ani_ske.json) loaded in 0 msecs
DB resource (res://DragonBonesExport4_5/NewDragon_1_ske.json) loaded in 0 msecs
ERROR: Vector<struct Vector2>::operator []: SEVERE: Index p_index out of size (size()).
   At: d:\build\dbonesgodot\godot-2.1.4-stable\core\vector.h:136

Would youlike to to open another issue? This one can be closed I think - as the rendering issue is resolved