Robert

Moving a bone with Image Compensation in Setup mode seems to deform the mesh, rather than simply updating the local vertex coordinates relative to the bone. This deformation results in strange vertex motion when the weights for that bone are changed. If the local coordinates for every vertex were corrected instead, the bone could be transformed without resulting in vertex motion when the weights are later adjusted.

Here are my thoughts on how this could work:
1. For every bone, each vertex has a local coordinate relative to the bone's position.
2. Before adjusting the bone, apply the bone's transformation matrix to find every vertex's global coordinate.
3. After adjusting the bone, recalculate the local coordinate of every vertex by applying the inverse of the bone's new transformation matrix.

If I position a bone incorrectly, I currently have to unbind the bone from all meshes, move the bone, rebind the bone, and redefine the relevant weights. It would be a lot nicer if I could just move the bone to the correct position with Image Compensation, without deforming the mesh.

This behavior has been reported previously, but I wanted to describe how I think it should behave:
http://esotericsoftware.com/forum/Vertices-move-when-a-weighted-bone-has-been-repositioned-6528
http://esotericsoftware.com/forum/Undesired-vertex-transform-being-applied-via-bone-compensate-6835
Robert
Posts: 4

Nate

You have a good grasp of how weights work. 8) I agree, this is a pretty big problem. We should get to it soon, it's on the issue tracker here:
https://waffle.io/EsotericSoftware/spine/cards/580bacfc29fef328007f9db0
You can subscribe to email updates on the GitHub version of the issue:
Weighted mesh compensation doesn't adjust bind pose · #63 · EsotericSoftware/spine-editor

---

We finally found some time to look at this more deeply. Here's the current behavior:



Note the nice new mouse over highlight for pies. :) Here's the new behavior, without image compensation:



And here it is with image compensation:



I think the first GIF is never what you want in setup mode, so starting in 3.6.02-beta it's no longer possible. This change means if you want to transform bones and then adjust weights to tweak how the mesh deforms, you'll need to do it in animate mode, which is where you'll see behavior like the first GIF.
User avatar
Nate

Nate
Posts: 7647

Robert

Thanks for looking into this! I upgraded to 6.0.2 beta, and there are unfortunately still some problems. If you open up the raptor example, like what you showed here, moving torso2 with Image Compensation causes raptor_horn and raptor_jaw to move around, and raptor_front_arm wiggles. It almost seems like Image Compensation is not being applied to certain child bone meshes. Also, moving bones with Image and Bone Compensation causes a lot of distortion, but it seems to appropriately suppress motion of the child bone meshes.
Robert
Posts: 4

Nate

Since raptor was rigged before these changes, probably its meshes are deformed in setup mode. If you Reset the torso or front arm mesh, you can see it looks different undeformed. We'll need to rig it again from scratch, as an example project shouldn't have this problem.

Are you able to find any problems using a newly rigged skeleton?
User avatar
Nate

Nate
Posts: 7647

Robert

Unfortunately I do still see the problem with a newly rigged skeleton. I put together a simple example with three colored circles, and am attaching it to this post. Moving the green bone with image compensation results in the blue circle moving. Moving the green bone with image compensation and bone compensation results in the green and red circles deforming.

Edit: Attachment removed
Robert
Posts: 4

Nate

Robert wrote:Moving the green bone with image compensation results in the blue circle moving.
When you move the green bone with image comp, its child bones (the red and blue bones) are moved. The blue circle is weighted to the red and blue bones, so it moves with those bones. The green and red circles do not move, because they are weighted to the green bone.

If the attachments are regions instead of meshes and you move the green bone with image comp, both the red and blue circles move with their bones.

This seems to make sense.
Robert wrote:Moving the green bone with image compensation and bone compensation results in the green and red circles deforming.
This was a bug, should be fixed in 3.6.03-beta, available in a few minutes.
User avatar
Nate

Nate
Posts: 7647

Robert

Nate wrote:If the attachments are regions instead of meshes and you move the green bone with image comp, both the red and blue circles move with their bones.
I hadn't realized this was the intent for image comp, and would have thought it applied to all child bones. Regardless, I plan to use image and bone comp together, which appears to work great now. Thanks for fixing this!
Robert
Posts: 4

Nate

Wooo! I was worried you'd find another problem. :D

That is how it's always worked for regions. I guess it makes sense to make meshes work roughly the same, at least it's hard to come up with a real world use case where that behavior doesn't work well with meshes.

---

I should mention, the behavior seen when the green bone is rotated with image comp (no bone comp) occurs because the red and blue bones are descendants of the green bone. If all 3 bones are attached to the root, then none of the meshes move when the green bone is rotated with image comp.
User avatar
Nate

Nate
Posts: 7647


Return to Bugs