Looked at the knee earlier and didn’t have time to reply, had to go to work…
Krisnack is right, it’s a weight painting problem, not enough blending with the weight paint. The lower leg’s weight needs to blend into the upper leg a bit, and vice-versa. 2 things you should do, 1st when touching up the weights, in the weight painting tool shelf, enable Auto Normalize. With this enabled, as you add weight to a vert for one bone, it subtracts weight from other bones. This happens anyway, behind the scenes, but enabling this lets you visually see what’s going on.
Example: weight a vert 100% to one bone, weight it 100% to another bone. Now that vert is influence 100% by 2 bones looking at the 3d view, but it’s actually weighted 50% to 1 bone and 50% to another. With auto normalize you can see the actual weights as they will affect a vert. You will never be able to weight a vert 100% to 2 bones.
2nd thing I think you need to work on is the knee topology & edge loops. The file title is ‘subsurfapplied.blend’, did you apply the subsurf modifier? If you did, don’t do that. When you apply a subsurf modifier with a level of 1, you get 4x the amount of verts. You now have 4x the amount of verts to weight paint (I don’t know if you did this before weight painting), 4x the amount of verts that must be moved on screen as you animate. Likewise, that’s 4x the amount of verts that must be moved when scrubbing/previewing your animation, that can slow down a computer quite a bit.
Now look at the topology of your knee:
There are quite a few edgeloops in there that you could get rid of, but then again, they wouldn’t be there if you haven’t applied the subsurf modifier. I’d try to redo that knee and get rid of the diamond shaped face, keeping the area all more squarish quads.
Common practice is to have an armature modifier on a mesh, then the subsurf modifier below the armature modifier. Modifiers work from the top down. So the top armature modifier poses the mesh, the next modifier, the subsurf, does it’s job and subsurfs the posed mesh.
This can help overcome deformation problems as well…
It’s late, other projects, etc…
Randy