Blocking bones from going through walls in pose mode

I’ve always wanted a feature like this and wondered if it exists. When posing a model during animation, one of the annoying parts is making sure that in each keyframe, the feet are closely aligned with the ground. Not too much so they don’t go through it, not too little so they don’t float above it. Such can never be perfectly precise, but having to take care of it manually gets bothering… especially if you have more limbs touching surfaces (like your character leaning against a wall).

Is there a feature for Pose Mode that can limit bones from going through surfaces? When enabled, moving scaling or rotating bones in Pose Mode would account all solid surfaces. If during a pose operation any bone would go through a wall, you can no longer rotate / move / scale past that point. Such could also be used to prevent a model from going through itself… for example If you animate someone putting their hand on their head.

This would be tricky if you can’t cheaply detect the mesh geometry for collisions, but only bones of the armature. So each bone would need a radius limiting how far it touches surfaces along its length. This would be useful though.

Have you tried the Floor constraint?

No… haven’t heard about it till now. I assume it’s a constraint type under Bone Constraints? If so I’ll look at that next time, thanks.

when was this implemented?? could have saved me a lot of time :frowning:

Based on the publication date of the book in which I first heard about it, no later than 2008. But I think it’s one of the oldest constraints out there.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Constraints/Relationship/Floor

Certainly seems like what I’m looking for, will try it soon. I didn’t look into it till now which is why I didn’t know of this constraint, but now I do.

Note: the floor constraint uses the location of the head of the bone, not the tail. That info should save you about a minute or two of fiddling around.

Ideally, I’d want the bone to collide along its entire length. But that sounds just as good if the rig is done properly so it shouldn’t be a problem. Thanks for the info.

If your character has a particularly complicated foot rig, you could probably put this constraint on more than one bone per foot. Otherwise if you just place the bone strategically, you should be fine.

not had chance to check it out but from the conversation it sounds like you would simply need to add a single “floor bone” to your foot, most likely on the ball as that is where the sinking issue normally originates from. maybe, one on the heel too depending on how much trouble that pivot point causes you.

Got around top trying this today, but it seems the Floor constraint doesn’t work for me. I added it, selected a flat plane as the object, but when I pose the bone it still goes through without any issue. Here is a simple test Blend.

Also, I read here that the floor constraint can only be used on even planes. What if I have something like a road with a sidewalk though? Do I need to add multiple flat planes and multiple floor constraints for each surface? And if I wanted this limitation on the inside of a sphere for instance, would it be possible?

You’re combining things in a weird way there. Auto-IK is a touchy thing that can break some other functions, which is why I never use it. Here is how you should set up a floor constraint. FloorCorrected.blend (438 KB)

When targeting geometry, the floor constraint only recognizes a flat plane. You can get around this by using a bone as your target instead. Here I have made a bone called FloorBone and given it a Shrinkwrap constraint, so it sticks to the surface of the uneven plane. The foot can’t pass below the FloorBone because it has a Floor constraint targeting that bone. This solution is incomplete, because the FloorBone stays flat instead of rotating to fit the uneven plane. In this example, I’ve created two opposing FloorBones. One of them tracks the root of the other, so it rotates to follow the plane’s contours. The foot bone also locally copies the rotation of this additional FloorBone, so that it appears to follow the ground as well. For visual convenience, the FloorBones are on a separate bone layer, so they are easy to hide from view once you see how they work. FloorBone.blend (446 KB)

Thanks @K_Horseman. That looks a bit more complex than I imagined, so I’ll probably only use this constraint when I really can and need to. Still good to know and have a working example.

Yeah, the floor constraint really isn’t quite made for the level of detail you’re asking for, so my solution is a bit of a kludge. Still, a two-bone kludge isn’t too bad. Generally speaking though, it’s usually not that difficult to just be careful about where you place things. If you don’t want your character to pass through walls, just don’t animate him passing through walls! :stuck_out_tongue: