Introduction of IK
In most cases, we make actions through the bone control mesh, and need to adjust the corresponding bones one by one from top to bottom according to the parent-child relationship, and finally complete the action. This method is called FK (Forward Kinematic, forward dynamics).
In fact, the way of FK is different from people's normal way of thinking. Taking hand movement as an example, when we want to pick up an object, what we need to think about is definitely not how to move the big arm, how to move the forearm, or how to move the hand, but We have to grab objects with our hands and where to get them.
To sum up, we need to reverse the movement of its parent part through the movement of the hand. This method is called IK (Inverse Kinematic, inverse dynamics).
Create IK bones
First we pull out the new bone at the wrist, disconnect the parent-child relationship, and rename it.
Add IK constraints to the bones of the forearm, and specify the target as the IK bone created in the previous step.
There is a somewhat efficient setting here. When the step size/chain length is 0, blender's default is not that IK does not work, but that IK works for all bones.
After adjusting the chain length to 2, the performance of IK is basically normal.
But obviously now there will be ghosts and animals on the elbow side from time to time. We have to add an additional restriction to the elbow to limit the direction of movement of the elbow.
We pull the new bone from the elbow joint, also deparent the parent-child relationship, rename the bone and pull it some distance away. (Too close distance will affect the direction calculation of Ik)
Set the pole to the object bone.
The model may be twisted when the pole is bound backwards. At this time, adjust the pole angle to straighten it.
The effect after binding the polar bones:
Make the ik and pole bones of the left arm symmetrically.
In the same way, we correspond to the IK of the legs.
Customize the shape of IK, Pole bones
In order to better distinguish, observe the IK, Pole bones and tgt bones. We add a cube to the scene, and adjust the custom object corresponding to the bone to the newly created cube in the bone properties-view display-custom shape.
We swap out the IK bone for a wireframe cube and the Pole bone for a wireframe ball.
After completing the bone layering, you can see the clear control bones.
The introduction of the controller
In terms of the movement characteristics of the hands and feet, we hope to reversely calculate the movements of the corresponding limbs through the movement of the edges, which is more in line with the purpose of our movement (such as holding objects, lifting and kicking, etc.).
crotch controller
For the torso, there is not much need for reverse control.
But there are still problems at present. Under the skeletal logic of blender, the bones can only rotate around the end point, which brings relatively strange motion effects.
Brothers may not be able to see the strange place, mainly because according to the law of human body movement, the force point of the hip lift/crotch movement should not be that position, or that the part that moves when the force is exerted at that position is actually different. Too right (there is no evidence for the suspected car). As far as the correct force position (rotation position) is concerned, it is closer to the top of the bone in the current movement.
So we want to rotate the hip bone through the tip.
The implementation method is very simple, directly add a bone opposite to the hip direction, and hang the parent-child relationship.
The difference will be seen at a larger rotation angle, mainly because the shape of the entire crotch can remain relatively complete under a larger angle of movement.
In order to achieve independent control of the hips and better reflect the differences, we cleared the parent relationship of the spine bones.
Now the effect difference between using tgt bones and controller movement is more obvious:
Controllers for the crotch and ribcage
Next, we hope to directly control the torso and thoracic cavity through the controller. It is not difficult in terms of thinking. We directly build a new bone that covers the torso and thoracic bone.
But here are two ways to implement constraints:
- Copy Rotation/Copy Position
- parent-child relationship
The first is to implement constraints by copying rotation + copying position.
Note that in the world space, the bones will be driven to cause the model to be distorted, and it will return to normal after being adjusted to the local space.
There is another bug here. Obviously, the direction of our controller adjustment is directly opposite to the direction of the tgt bone movement.
The guess is that the direction of the controller is opposite to that of the tgt, so we go directly back to the edit mode to adjust the rotation and align the coordinate axes.
After aligning the axes, the controller behaves normally.
In the same way, we add the copy position to the tgt of the spine and chest cavity, and select the world coordinates. And set the limit to ensure that the chest controller can only move up and down in the vertical direction (this involves the problem of coordinate transformation, in fact, only the transformation in the y-axis direction is open) The effect is as
follows
Transitive Relationships for Parent-Child and Copy Constraints
Unfortunately, because we canceled the parent-child relationship of tgt before, this person is still in a pitiful state of separation of upper and lower body (skeletal).
We need to create a controller and parent-child relationship to achieve unified control of the crotch and ribcage controllers.
The problem came again, but the new controller's control over the torso controller apparently didn't work.
Guess: There is a conflict between the copy rotation/copy position constraints between bones and the parent-child constraints, so they are not transitive.
We directly adjust the constraint relationship between the thorax controller and the new controller, and replace it with the same constraint of copying rotation + copying position.
The control of position and rotation is already normal, but due to the problem of the coordinate axis, there will be some counter-intuitive situations in the control of rotation. If you want to achieve the rotation in the same direction as the chest and spine, you need to adjust the coordinate axis direction of the controller when you create it.
But a new problem has appeared again. We also mentioned in the blog post of bone binding vol1 that the replication constraint will cause all the intermediate sets in the transfer relationship to lose control, that is, the chest controller is now copying rotation and copying After the position constraint is added, it is no longer possible to independently control the rotation and position of the ribcage!
In order to realize the re-control of the chest controller:
1, the chest controller can be redone and converted into a parent-child relationship.
Two, or we can directly make partial adjustments. According to the structure, the human torso cannot be layered into the chest and crotch for separate position changes, so we simply let the torso controller do the overall position. Control, hand over the rotating part to the chest controller and crotch controller for control.
The body controller only controls the overall position and not the rotation.
Chest and hip controllers only control rotation not position
Someone may ask, what should I do if I want to move my chest when I shrug my shoulders?
If you want to control the independent position of the chest, you should still adjust the constraint relationship and use the parent-child method to do the constraint.
But at the same time, the essence of the shoulder shrug is not that the chest moves upward, but the bones of the shoulder move upward. The idea of shrugging by lengthening the torso itself is not so suitable.
Set up custom controller shapes to complete the torso and ribcage controllers
Set color display and group management
In the action mode, select the object data attribute bar, create a new bone group and complete the allocation of bones, select different color sets, realize the display of different colors, and complete the division.
The effect is as follows
foot controller
The logic of the foot controller introduces two implementation methods:
one is to directly follow the logic of the tgt bone, and make a controller for the sole and toe respectively. Since the sole and toe cannot move, just copy the rotation constraint directly.
The second binding method is a bit different from the first requirement. We want to achieve a binding relationship similar to that of stepping on the ground, allowing the foot to maintain a sense of contact with the ground while lifting.
The schematic diagram is as follows. Of course, this binding method conflicts with the IK bones we made before, so we have to start a new stove for binding instructions.
We set up a jiojio for light speed modeling to complete the basic bone binding. Then we don't need tgt this time, and start the demonstration directly.
First of all, to adjust the direction of rotation, a new bone needs to be created based on the middle of the current connection. The new bone realizes the parent-child relationship with the arch, and then the rotation based on the forefoot can be realized.
Create a single bone at the origin of the world, achieve overall control by copying the rotation, and add corresponding rotation restrictions.
The key point is to control the rotation of the forefoot. It is necessary to make a copy of the rotation constraint and make a rotation limit, so as to achieve the feeling of stepping on the ground.
I just mentioned that this kind of binding has some conflicts with the previous IK, because in the binding method here, the position change of the foot is all achieved by the rotation of the controller, and the position change driven by IK is a pure position change, and There is no rotation change. In the IK driving mode, the position change of the foot cannot drive the rotation constraint of the corresponding bone to take effect.
So on the basis of the previous binding, this is basically not an alternative binding method. If it is the second method, the binding method of the entire foot may need to be redone.