Closed jonchun closed 4 years ago
This is in custom built Godot 3.2.2-stable using the current master branch of spine-runtime-for-godot
.
macOS Mojave 10.14.6
I've set up and uploaded a demo project for ease of testing
Tagging @scottkunkel because of comment in https://github.com/EsotericSoftware/spine-runtimes/issues/728
custom skins cannot be initiated as empty skins atm; copying existing skin and adding more skins to it will work.
Nevermind. I'm just dumb. Needed to set_to_setup_pose()
spine_sprite.get_skeleton().set_skin_by_name("default")
var custom_skin: SpineSkin = spine_sprite.get_skeleton().get_skin()
var hair: SpineSkin = spine_sprite.get_skeleton().get_data().find_skin("hair/brown")
custom_skin.add_skin(hair)
spine_sprite.get_skeleton().set_skin(custom_skin)
spine_sprite.get_skeleton().set_to_setup_pose()
Closing this issue, but I think that there might be value in adding this example to the examples repo so others know how to achieve this.
I opened https://github.com/rayxuln/spine-runtime-for-godot/issues/11 to track this.
Skins are not working as intended.
while set_to_setup_pose() is required, in your last example you are actually adding brown hair to the default skin at runtime. The next time you call up default skin in the same scene, it has brown hair attached to it.
Instead, you should create a new skin and add default and brown hair to it, however that's currently broken.
Using the following resources: http://esotericsoftware.com/spine-examples-mix-and-match
The following code does not do what I expect:
I expect to see brown hair, but instead it shows nothing/blank (default skin)
If I do
then I see brown hair. It seems that once I
set_skin_by_name
, I can't do it again?I then tried to build a skin from scratch
However, the 3rd line (
add_skin
method) freezes Godot at this point when I try to execute it. I don't get any errors or anything.What DOES seem to work is doing the following:
With the above code, I'm able to
add_skin()
fine without Godot freezing. However,set_skin()
doesn't seem to do anything (similar to how trying toset_skin_by_name()
didn't seem to do anything after you've already set the skin once)