Shape key fix for mesh deform binding not working

I have a puzzle I can’t seem to figure out. Mainly, I’m trying to fix a cage not containing bound mesh by using the shape key trick mentioned by Juan in the bottom comment here.

My problem is also legs that are close together that don’t give too much room for increasing the size of the cage.

https://dl.dropboxusercontent.com/u/1940832/Blenderartists/MeshCageShapeKeyProblem/TheProblem.gif

I could create a shape key when binding to fix the problem, but the “fix” becomes disabled as I dial down the shape key after binding.

https://dl.dropboxusercontent.com/u/1940832/Blenderartists/MeshCageShapeKeyProblem/TheSolutionProblem.gif

The frustrating thing is that the binding sticks when I do the same thing as a test in new files with Suzanne. I dial the shape key down and the fix stays.

https://dl.dropboxusercontent.com/u/1940832/Blenderartists/MeshCageShapeKeyProblem/MonkeySolutionWorking.gif

Does anybody know what’s happening? .blend file attached if needed. The working monkey solution is on layer 2.

Attachments

MeshDeformCageProblem.blend (5.87 MB)

Ok, so I’ve spent a little bit of time with the mesh deform system…

Took a look at your file and I don’t know what the problem is. If this was a normal weight painted rig & armature modifier, it would be an easy fix. It acts like over spray while weight painting manually. Since there is no armature modifier it can’t be that…

My best guess would be the deform cage is too close to itself on the inside of the legs. I think the legs need to be farther apart and the cage not so close to itself.

I did follow the link you posted and read thru it. Wasn’t there some mention of using higher binding levels? At the same time, I wonder how a higher poly deform cage would work, would that help?

just a guess or two…

Randy

Hi, Randy, thanks for looking into it, much appreciated!

Indeed the problem is that the cage is too close to the inside of the legs and that’s what I’m aiming to resolve using the shape key trick.

I tried at higher levels of binding as well. It’s better but problem’s still there (I put it at a lower level for testing purposes).
Same with higher poly cage… though I can’t remember if the result was better or worse, but problem was still there.

I’m trying to understand the shape key trick, if not for this problem, for the future as well. But I just can’t figure out why it works with the monkey but not my mesh.

I wondered if I should report this as a bug, but I’m trying to see if someone on the forum could figure out if there’s some stupidly simple mistake I’m making (perhaps a setting change) before wasting a developer’s time.

The shape key trick shrinks the mesh to fit inside the cage for binding. Once bound and working, the shape key is set back to the full size mesh. Now the mesh is outside the cage, but influenced by the cage. Since the mesh is larger than the cage, but controlled by the cage, couldn’t the cage’s influence extend beyond the outside of the mesh?

As to why it’s not affecting the monkey example, you don’t have any part of the monkey where the cage is that close to itself.

I think you will need to spread the legs apart to get it to work, but that’s just my opinion.

You can file a bug report, but I doubt it would get much of a response. This was something added to blender during the Big Buck Bunny production, and hasn’t been worked on by a dev since then.

Those are my thoughts…

Randy

Hey, Randy. I think there might be a misunderstanding here, haha.

I understand what the shape key trick is supposed to do, and I’ve replicated the solution with the monkey. But the problem is I can’t replicate it on my model and I can’t figure out why.

The spread-the-legs would be another solution to the problem of mesh cage not containing all vertices. I’m trying to get the shape key solution to work.
i.e. If I wanted to resolve the problem by spacing out the legs, I wouldn’t have a need to figure out why the shape key solution isn’t working.

Case in point: I did another test that more closely resembles the “legs too close” problem and applied the shape key solution. And… it works.

https://dl.dropboxusercontent.com/u/1940832/Blenderartists/MeshCageShapeKeyProblem/ShapeKeySolutionWorking.gif

As you can see, I dial the shape key down and the mesh stays in the cage as it should… unlike my model. And I can’t figure out why, so that’s what I’m hoping somebody can help me understand.
Or to figure out if somehow my mesh itself is bugged.

Hope that clarifies things, haha.

.blend of the new test attached if needed for reference.

Attachments

WorkingShapeKeySolution.blend (572 KB)

Have you done all of the normal checks on your mesh? Remove Doubles, Recalculate Normals, Apply Scale, Location and Rotation? Armature, mesh, and mesh deform have the same origin?

Per your suggestion, I went through normals, removing doubles, applying transformations… pressed the “Bind” button then, with a bit of anticipation, dialed down the shape key and… it didn’t work. =/

I’m not sure why this is not working, but here is a simple solution.

Shrink the legs on the bound mesh. (Unbind first.) Make this change in the basis, not a shapekey. (Or, just delete the basis and key1 as they won’t be needed any longer.) Bind the mesh. Next make a shapekey on the mesh cage to recover the lost volume.

It worked for me.

Good luck!

Attachments


I hope there has not been a problem here, my only intent is to help…

I looked at the ‘WorkingShapeKeySolution.blend’ file and indeed it works, but I see one major difference in-between it and your character file. In your new test file, the characters legs are inside the mesh deform cage naturally, that is without a shape key or anything else to alter it. In your character file, the mesh is naturally outside the deform cage in spots. The area of the mesh that is outside of the cage is influenced by the cage, and some of that influence is spilling over to the other leg.

DanPro has a working example. It appears he spread the legs, turned on the shape key and binded it, and it’s working.

Hey DanPro, care to share that file? So we can all look at it. I really think it would be helpful for all of us.

Randy

It’s not “fixed”. I just solved the issue another way. Instead of a shapekey to shrink the legs, I just edited the mesh (basis) to fit before binding, then added a shapekey to the deform mesh to regain the volume after binding.

Here is the file if it helps, but I thought I explained it pretty well in my other post. :wink:

http://www.pasteall.org/blend/41505

Good luck!

IMPORTANT NOTE: I’ve figured out a working solution! But… I still have no idea why the problem exists. More on that later.

Hey, guys. Really appreciate the effort!

Not at all! I hope my attempt to clarify didn’t come across as attacking. That is not at all the tone I was taking, haha.

I checked out the file, but your shape key doesn’t seem to expand to the original volume…? Dialing it up and down doesn’t seem to do anything.

Here’s my attempt to follow your instruction:

As you can see, I couldn’t get it working. And this is after multiple tries, too, because I had to redo the recording several times, haha.
I even tried deleting all shapes, editing the basis shape to be narrow, creating a new shape matching the initial volume and the problem still remains when I bind the mesh and dial up the fatter shape.

So here’s the solution I got working:

https://dl.dropboxusercontent.com/u/1940832/Blenderartists/MeshCageShapeKeyProblem/SolutionFix.gif

Basically, I created a new geometry (Cube), then swapped out its object data with the object data of the original mesh (Also used “Copy Attributes Menu” add-on to copy the location/scale of the original mesh).
Then when I apply the “Mesh Deform” modifier and bind, voila, it works. Why does it? I don’t know…

Here’s something else I found. If I do the exact same process, but copy the “Mesh Deform” modifier from the original mesh instead of creating a new one, all of the sudden the solution doesn’t work:

https://dl.dropboxusercontent.com/u/1940832/Blenderartists/MeshCageShapeKeyProblem/ModifierCopyProblem.gif

Something definitely seems buggy here. Let me know if anybody else can confirm this.

The shapekey is on the Clothing-Cage, not the clothing itself. But, whatever, glad you finally go it working.

Just an update in case this happens to anybody else. It turns out, I could simply delete the “Mesh Deform” modifier on the problematic object and create a new one and everything will work as it should.

So somehow the single modifier was bugged. I didn’t know that was possible to do. Too bad I don’t know how to replicate the problem…
But I guess I’ll report the bug anyways, haha. Maybe the developers could figure it out with the file.