Bad deformities

Hello.

I’m trying to make a simple character and now i found a problem with its rig. When i bend the arm, it doesn’t deform the way i want it to. So my question is, what do i have to do in the mesh/rig so it works correctly?

How it is deforming - http://s15.postimg.org/ek8yn3au2/Untitled02.jpg
How i want it to deform - http://s21.postimg.org/r8ox12aaf/Untitled03.png (i’ve changed the mesh in editor mode so i could take this print)*

Thanks in advance!

*if i can turn it into a 90º angle and get a L shaped arm (when bending), it would be perfect for what i want to do.

Edit - I attached the .blend file. (it only has half of the rig done because i found out the problem before doing the other side)
char.blend (456 KB)

In none of the screenshots do you actually show your rig and it’s impossible to see your weighting since you didn’t include a blend file

Sorry about that, i uploaded the file.

There wasnt an armature modifier on the robot mesh.
I added one with empty vertex groups, by selecting the mesh, then the armature with shift+RMB, then pressing ctrl+P.

I assigned weight to the arm vertex groups, Upper.Arm.L, Lower.Arm.L.
I rotated the IK.Arm.L so the arm was L shaped.

I added 2 shapekeys.

With Arm.Joint.L selected in edit mode i moved the arm joint vertices into position.
Added Driver to the shape key value.

Disabled IK, rotation wasnt visible.

Changed the bone rotation mode to XYZ Euler.
Changed driver settings in Graph Editor.

This IK rig doesnt seem to work with drivers, the IK wont update the bone rotation when set.
I disable the IK, the little eye icon.
I dont know what to suggest for the IK rig.

To get the L shape, shapekeys using drivers is probably the best option.
You can use preserve volume on the armature modifier, but it wont make the mesh L shaped.

Attachments


robot.blend (443 KB)

Thank you, i’ll try to find a way to fix it.

I added the armature to the mesh with empty groups and made the weight groups manually. That gave me a nice result and it’s close enough to what i wanted, thank you again!