• Editor
  • Reset Mesh request

Related Discussions
...

I've been working with the meshes, and I've run into instances where the mesh inadvertently ends up with some vertex deformation, even in setup mode. In my typical workflow, when I'm figuring out where to place the bones and how to build the cage, I do a lot of creating/deleting verts and edges, and using the modify tool to move verts as well. Sometimes I will also change the position of bones using the Create + option (in OSX) workflow. When editing the mesh, I always work in "deformed" mode, so the mesh doesn't deform the attachment in setup mode.

What usually happens is after messing around for awhile, I'll notice that that the mesh is slightly deformed. I can see this by toggling the "deformed" mode off and on. Often it'll just be slightly deformed, and I usually don't notice when it happens. I'll just be working for awhile, then notice that it's not 100% in an undeformed state. This is with no bones changed from what should be their default state (except in the case when I re-position it with the Create + option workflow).

What would be super-useful, is if there was some way to revert the mesh to it's non-deformed state (in setup mode of course), while keeping all the weighting and the current mesh. Basically a way to revert to "bind pose", and remove all vertex deformation.

I thought the "reset" button might do this, but it doesn't work if weights are applied. Also, even when using it when weights are not applied, the reset button changes the base transform of the whole mesh slightly, if the mesh has been modified.

That last part seems like a bug to and is reproducible. Just modify a vert on a mesh with no weights applied, and then hit the reset button


the mesh will change position.

Thoughts?

Reset (in the tree properties, not Edit Mesh) translates the mesh because it can't know which vertices you have moved and want to revert and which vertices are in the position you want to preserve.

Reset does what you want, it removes all mesh deformation, but it also removes all weights. The reason is similar to why Reset translates. Spine knows your mesh as a collection of vertices that may or may not have been moved from their undeformed position. Reset knows the undeformed vertices, but it can't reasonably know how to rotate, scale, or scale those vertices to match the orientation of the mesh when you clicked Reset. It's an even worse problem if some of the vertices have been moved and some haven't. This means when Reset happens the mesh vertices are likely in a different position relative to the bones that are bound to it. If the weights were not removed, they would affect the mesh from its new position, which is almost certainly not what you want.

Here is Spineboy's head where the hair bones are weighted to the head mesh:
 Loading Image

After Reset that removes weights:
 Loading Image
See how much the orientation changed?

After Reset that doesn't remove weights:
 Loading Image
The weights have wrecked the mesh. I can't think of a situation where this is what you want.

When bones are bound to a mesh using Weights, you can use image compensation to manipulate bones without deforming the mesh. Sort of. It's complicated under the covers and may not work perfectly in all situations. It's best to do as much setup as possible before assigning weights.

It sounds like you are taking actions that should not deform the mesh. If you can figure out what actions cause it to be incorrectly deformed, that may help.

Thanks Nate, that all helps me understand what's going on.

First off, how did you do the formatting to make "Reset" and "Edit Mesh" look like in-line code formatting?

Reset knows the undeformed vertices, but it can't reasonably know how to rotate, scale, or scale those vertices to match the orientation of the mesh when you clicked Reset.

Ah, so the mesh itself is not ultimately a node with it's own underlying transform? I was thinking it had it's own transform that could be used to position the undeformed (reset) mesh.

I'm used to 3d tools like 3Ds Max. For example, if I have a head mesh, then bind the vertices to some bones for example with a Skin modifier, then move those bones to deform the mesh, and then finally remove or turn off the Skin modifier, the head mesh would revert back to it's undeformed state, PRS transformed to it's own transform node. If that head mesh had been also linked in the hierarchy to a bone (for example a head bone), the mesh's transform would be positioned relative to the head bone, but all the vertices would be reverted back to their original positions relative to where they were when the mesh was created.

Does that makes sense? In practice, when I would rig a 3D character, many times I would be moving bones and adjusting weights in order to get the desired joint deformation. It was often a trial and error process. Whenever the bones were re-positioned during this process, I would then reset the Skin modifier so it knew that the new position of the bones was the default position, from which to deform the mesh during animation.... the vertices would revert to their undeformed state in bind pose though.

So in Spine, what specifically I'm wrestling with is when I reposition the bones after assigning the weights. I'm using the workflow where I select a bone while in Create mode, then hold down the option key while dragging to create a new bone. Since that workflow doesn't change the relative position of child bones in the hierarchy, intuitively I'd expect it to also not change weighted verts, but I guess it does... that's I think the first part of what's tripping me up.

(The reason I'm doing it this way is that I'm dealing with a tricky series of joints and I can't really see how the vertices and image are going to deform until it's weighted, and I adjust the bones. If the bones aren't where they need to be, then it's a pain to remove all the weighting, and start over after the bones are moved. )

You mentioned using compensate, I hadn't tried that. That might be an option for me.

End of the day, I'm mostly just concerned with understanding the workflow and limitations. I can work around however it's built, if it turns out I was just misunderstanding how the tools work. Thanks for taking the time to talk me through it 🙂

Surround text with a backtick (`) to get the gray highlighting.

Meshes don't have their own transform. They are just a collection of vertices in the parent bone space. When a bone is bound to a mesh, the mesh at that time is considered the bind pose for the bone. When a bone is unbound, I believe it tries to keep the mesh as is.

Redrawing a bone by holding cmd/alt with the Create tool uses (under the covers) both bone and image compensation to keep the mesh from deforming. It tries, but there are cases where this doesn't work so well. 🙁 I think mostly it is rotation and nonuniform scale that can be an issue. Try moving bones using bone and image compensation, the mesh should not deform.

OK, thanks Nate, I'll try to use image and bone compensation for my flow.

One thing I'm seeing initially is that there seems to be a problem when using both options together. What I'm seeing is that when both Images and Bones are turned on, the child bones are actually affected, and the image/mesh is not. This only seems to happen when dealing with meshes... normal non-meshed attachments and bones seem to work properly (both the child bones and attachments are left in place).

You can see this in the raptor file attached... hope it's helpful.

Thanks for the bug report. I see the issue and have fixed translate compensation for bones with mesh attachments when both image and bone compensation is on. Will be in v3. Cheers!

Sweet, glad to help 🙂