Anybody can explain this? This happens if one mesh is inside a bone that is under a skin that is not active
Attachment Selection Outline is Missing
warmanw It seems to me that it would be more correct not to be able to select a mesh attachment if it is under a bone that is not part of the active skin, but how do you reproduce the condition you showed in your video? I would appreciate it if you could provide a spine project that can reproduce this condition.
Honestly it is not a big deal I remember posting about this previously but cant find the post,
In the older version that mesh would be rendered with semitransparent empty spaces, now its much better just outline is missing.
anyway attaching the project it is the 6th challenge
I guess that theoretically, because you are not supposed to see the child of something that is not active, you should probably also not see this other attachment unless pinned, but I can't really tell.
warmanw I am only seeing "challenge 1" in the file and no extra hats, did you link the worng file or am I missing something in where I should look? (Repro steps in case would be very appreciated)
I hate taking your time for small issues but still if we can make spine even better lets do it..
You are right it should not be visible, but the mesh is there under active skin the only reason it should not be visible is its parent bone is not under the active skin.
The issue is, when that mesh is bound to a bone that is IN the active skin while being in a bone that is under different skin. Check the video please
It's always best to simplify the project for us. Delete everything, like this:
http://n4te.com/x/1413-test-2-hats.zip
Then when providing the project, tell us 1) how to reproduce the problem, 2) what happens, and 3) what you expected to happen.
In that project the girl skin is active. 2 hats appear. The hat under the boy-test
bone should not appear because that bone is under the boy skin, which is not visible.
If you export (add an empty animation first) and look in Skeleton Viewer, only one hat appears. That is correct, the editor is wrong.
Actually SV shows some debug lines for the second hat, which is wrong. We'll fix that.
Both hats are weighted to the girl-test
bone. Due to that the boy-test
bone transform doesn't actually affect the attachment. That allows it to be rendered, otherwise the invalid bone transform would render all the vertices at 0,0 and you'd not see the image. The editor shouldn't be rendering it in any case. We'll fix that.
You mentioned that at runtime sometimes it gets rendered. That shouldn't be possible, eg in spine-libgdx:
EsotericSoftware/spine-runtimesblob/4.2/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonRenderer.java#L247-L249
If the slot's bone is not active, the slot's attachment is not rendered. If you do see an attachment getting rendered at runtime when it shouldn't, please report it. It could be that some runtimes don't have this check.
The bone transform values for inactive bones are cleared in the editor, so the attachment vertices are always nuked to 0,0. At runtime that work isn't done for efficiency, because those attachments should never be rendered anyway. That means you may only see the attachment being rendered incorrectly after the skin bone has been active, then made inactive.
In the editor, a bone is inactive when it's in a skin but the skin isn't visible. At runtime it's a little different. The skeleton has a single skin (and a default skin, but ignore that for skin bones) and the skin has a list of bones. A bone is inactive if it is in one or more skins (its data.skinRequired
is true) and it is not in the skin's list of bones.
If someone modifies the skeleton's skin (by adding/removing attachments or bones or constraints) or if bones, constraints, or weighted path attachments are added or removed then Skeleton updateCache
must be called:
http://esotericsoftware.com/spine-api-reference#Skeleton-updateCache
If someone sets a skin on a skeleton then modifies the skin (something that changes the skin bones, like adding another skin to it), it could result in a bone being active when it should not be. Note updateCache
is called for you if you call setSkin
and that changes the skin.
We've fixed the editor showing attachments for an inactive bone in 4.3.00-beta
. The change is more complex than I'm comfortable making in 4.2, as we are focusing on 4.3 and I don't want to lose momentum. it may be a couple weeks before the 4.3 beta starts.
Correct!
I see the fix in 4.3, Thanks!. However, for consistency, could we also show a warning for a mesh that is not under a skin, but whose parent bone is under an inactive skin? The vertices of such a mesh collapse to (0, 0).