Pharan написалSkeletonRenderSeparator doesn't actually decide that itself beyond the default numbers it starts you off with.
Yeah, before playing each animation for both skeletons, I run a method to change specific separators' sorting order in their layers. I change their value from the default one only if it's needed for that animation.
But that's ok. My problem is that when I add a slot to the model, and I need it to be independent from the rest, problems arise when I create a new separator to encapsulate it. Let me illustrate...
You see that 'Character Shadow' in Element 0 up there? That shadow image is relatively new in my skeleton (we forgot to include it) and, as it needs to be at the end of the Draw Order in Spine, it's in the first position in the list of slot names...:
Then, Element 1 points to 'B_Arm', which is intended. Thing is, before I changed Element 0 to point to 'Character Shadow' it was pointing to 'B_Hand' instead and only contained that image, but now it has both 'Character Shadow' and 'B_Hand', as shown here:
And that Part Renderer containing multiple and so different (in location) body parts, could be a problem in the future.
So let's imagine that I'd wanted to create another separator to hold 'Character Shadow' on its own and still have the old one that held 'B_Hand' with its already order number untouched.
Therefore I add another Element (#18) and point it to 'Character Shadow'...:
...and change Element 0 to 'B_Hand'...:
And now only 'Character_Shadow' gets highlighted when clicking over it...:
...and 'B_Hand' it's also on its own...:
Great, right?! Well... yes, but take a look at that...:
Where did it go 'F_Forearm' and 'F_Hand'...? :o
Moreover, why when clicking on the shadow, instead of Element 18, is Element 0 which gets selected...?
...and when you click on 'B_Hand', it's Element 1 which gets selected...?
My theory is that no matter what you do in the tree, the component script assign what is going to be rendered by each Part Renderer sequentially, after parsing all the Elements in the separator list.
So if 'B_Hand' has moved to Element 1, Element 1 is now 2, and 2 is 3, and so on. And as their default values doesn't change by this 'insertion' of a new separator, then that explains why my sorting order gets messed up. Because all Part Renderers after the one I intend to add/insert get a different place in the list and their order number no longer is valid.
My opinion on this...? I humbly think that you guys should implement some mechanism so when you 'insert' another separator, order in layer values get changed accordingly to their new positions in the sequence.
This is one of the aspects of the runtimes that is most distressful for me, maybe even more than the dipping issue was. 😃
The only other alternative I see is to generate separators as needed, each time a new animation is set. That is, decide which body parts in each skeleton should make an exception to the rule of Spine's native Draw Order, and create separators so each of those images get a Part Renderer of its own, and then sorting them on the fly.
I don't know. What you'd do in my case?