A small test of the spine.set_attachment function.
Short guide
In the old runtime, we combined skins in the right slots to dress the doll character in different clothing/stuff combinations.
Was:
spine.set_skin(model, skin, slot)
Became:
Now we set one base skin for the model and then turn on the atachments for the desired slots.
spine.set_skin(model, skin)
spine.set_attachment(model, slot, attachment)
Where the attachment is a name of picture or mesh within the Spine slot:
Only one skin can be visible at a time. And only one atachment can be visible inside a slot at a time.
So, for correct works with the new extension we need to prepare the Spine model: move attachments from skins to slots.
From video example above:
spine.set_skin("#spinemodel", "skin1")
spine.set_attachment("#spinemodel", "weapon", "fox_weapon1")
spine.set_attachment("#spinemodel", "head", "head2")
spine.set_attachment("#spinemodel", "face", "pd_face")
If we want to turn off all attachments in a slot, then we simply pass “” as attachment value:
spine.set_attachment("#spinemodel", "weapon", "")
It’s a way what we have right now.
Also the Spine software has other way to combine skins and attachments. It seems more flexible and capable of showing combined skins in the Spine Editor. (see Skins view - Spine User Guide)
The main idea is to create a new skin in runtime and attach other skins from the skeleton to it. These skins can include multiple attachments and even new combinations of bones for easier work in the animation editor.
Skin newSkin = new Skin("new-skin"); // 1. Create a new empty skin
newSkin.addSkin(skeletonData.findSkin("shirt/pink"); // 2. Add items
newSkin.addSkin(skeletonData.findSkin("pants/green");
newSkin.addSkin(skeletonData.findSkin("shoes/sneakers");
Description here:
http://esotericsoftware.com/spine-runtime-skins#Grouping-attachments
For do that in the new runtime we need to get access to some lua functions and possible some object (Skin)? Possible it may be a feature request for NE.
Please correct me if I’m wrong somewhere. I’m just diving into the new version of Spine.