• Editor
  • Why does my slot have a rotation of 0 when it's rotated?

Related Discussions
...

I have a hand. It is weighted to a bone, and the bone is rotated. I need to get the transform and rotation coordinates of the hand to apply to another hand I am trying to skin to this skeleton so that they line up perfectly, however it says its rotation is 0.

If I apply the same coordinates this hand has to the other hand, they are in no way at all lined up with eachother. Is there an easier way to line up a skin to match perfectly exactly than manually moving each piece into place and trying to eyeball it close enough? Right now I have to constantly flip between the two skins and micro adjust -every single piece- trying to get it all to match up.

Changing the Axes from Local, Parent, World, all do not change the transform coordinates of the art.

Technically slots don't have a rotation at all. Your screenshot shows you have a mesh attachment selected. A mesh only "sort of" has a rotation. A mesh is really just a bunch of vertices (4 in your screenshot). When you use the rotate tool to move all of a mesh's vertices, Spine keeps track of how much you rotated the mesh, but this is only useful as a reference. When you rotate the mesh vertices, they are really just being translated in a circle. If you press Freeze in the mesh properties, you'll set the mesh rotation to zero (and scale to 1, which is tracked similarly). When you rotate fewer than all the mesh vertices, or you translate the mesh vertices, the mesh rotation doesn't change. You could translate all the vertices in such a way that the mesh appeared that it had been rotated 90 degrees, but it's rotation would stay 0 because it only tracks how much all the vertices have been rotated.

All meshes start as a region attachment. When converted to a mesh attachment, it takes the rotation of the region attachment.

Note that paths, bounding boxes, and clipping attachments work in the same way.

Interestingly, because of your post, I found Spine had a bug where the world rotation for a mesh is wrong. We've now fixed this in 3.7.48-beta! Sorry if that was confusing, it could explain why you are having trouble.

You can try this: select a mesh, ctrl+c, select another mesh, make sure World axes are selected (or Local, if that is what you want), then cltr+v. This will apply the transform of the first to the second. It should work even if you are using a version of Spine that displays an incorrect world rotation for meshes. Transform copy also works for bones.

I trued what you suggested, but unfortunately it doesn't work for us.

I think the part of the problem is that all our rigs don't believe in parent/child relationships between slots and bones. The rigmakers had some kind of Spine issue with parent/child relationships that they aren't around to explain anymore, but its carried through the entire project that in the hierarchy, every single piece of artwork is a slot set to Mesh, with 100% weight to a single (or more) bones.

This is what happens if I copy/paste on the world axis between the two artworks. The gif starts with the arm manually postioned by me into place, I drag it off, go to the original arm, copy it, and paste it into the other arm. As you can see, it doesn't inherit any rotation, because the original arm "Isn't" rotated, its four vertex from the mesh have just been translated by the bone its weighted to. I also tried doing this but then copying the rotation from the bone itself, but that also didn't angle it correctly either.

madmuffin a écrit

between slots and bones. The rigmakers had some kind of Spine issue with parent/child relationships that they aren't around to explain anymore, but its carried through the entire project that in the hierarchy, every single piece of artwork is a slot set to Mesh

Please note you are still using the wrong terminology. The images you see in the viewport are attachments, specifically region attachments or mesh attachments. Slots never render anything in the viewport and do not have a position, rotation, etc like attachments and bones. Slots are purely conceptual, to organize/group attachments and simplify defining the draw order:
Basic Concepts - Spine User Guide: Slots
I understand you meant attachment when you said slot, but sometimes it can be very confusing to refer to attachments as slots.

It's OK to parent a mesh to one slot and bone, but weight it so some other bone(s) affect its transform. That will work fine, it just makes it less clear which bone influences an attachment. Maybe the rigger wanted to see the bone hierarchy without all the slot and attachment noise in the tree. The tree has a filter though, so you can have it show only bones if you like.

Back to your problem. Sorry, I had tested out pasting the transform and thought it did what you needed, but I was mistaken


it just adjusts the rotation for you. If your mesh attachments are not aligned when given the same rotation, it could be that Freeze was used on one or both of the meshes to give them a different orientation. This is further complicated by Spine having a bug that doesn't show or set the world rotation correctly. You can give it a try in 3.7.48-beta, which we will have ready soon. If your meshes are weighted (or parented if they don't have weights) to the same bone, then you could set the local rotation to the same value. If that doesn't make them align, then likely Freeze was used.

As for what else you can try, you could try unchecking Mesh to turn it back into a region attachment, then check Mesh again. This will reset the mesh rotation and likely your attachments will then match when given the same rotation. Note you'll have to redo the weights and will lose any mesh deform keys (Spine will prompt if there are any).