$ikchain: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
The [[QC command]] [[$ikchain]] declares a named set of bones that are used to form an IK chain.
  $ikchain (name) (end bone) [height (units)] [pad (units)][floor (units)]
  $ikchain (name) (end bone) [height (units)] [pad (units)][floor (units)]
* Declares a named set of bones that are used to form an IK chain. Chains are specified by naming the bone farthest down in the chain, the next two bones are automatically found by walking the hierarchy.  
* Chains are specified by naming the bone farthest down in the chain, the next two bones are automatically found by walking the hierarchy.  
* Ikchains are used exclusively with ikrule and iklock animation options. Depending in the specific rule used, the end bone is moved into the needed position, the top most bone is assumed fixed in place, and the position of the middle bone is moved so that that the distance from the end-to-middle and middle-to-top bones remain constant. An example would be a IK chain of the ankle-knee-hip chain, where the ankle is adjusted to hit to relative to the ground, the hip is locked in place, and the knee is bend such that the leg remains its original length.
* IK chains are used exclusively with '''ikrule''' and '''iklock''' animation options. Depending in the specific rule used, the end bone is moved into the needed position, the top most bone is assumed fixed in place, and the position of the middle bone is moved so that that the distance from the end-to-middle and middle-to-top bones remain constant. An example would be an IK chain of the ankle-knee-hip chain, where the ankle is adjusted to hit to relative to the ground, the hip is locked in place, and the knee is bend such that the leg remains its original length.
{{todo| How is the 'top-most' bone specified ?}}
* QC syntax example :
$ikchain rhand ValveBiped.Bip01_R_Hand knee  0.707 0.707 0.000
$ikchain lhand ValveBiped.Bip01_L_Hand knee  0.707 0.707 0.000
$ikchain rfoot ValveBiped.Bip01_R_Foot knee  0.707 -0.707 0.000
$ikchain lfoot ValveBiped.Bip01_L_Foot knee  0.707 -0.707 0.000
 
==$ikchain options==
==$ikchain options==
  iklock (chain) (lock position) (maintain local rotation)
  iklock (chain) (lock position) (maintain local rotation)

Revision as of 11:19, 2 April 2008

The QC command $ikchain declares a named set of bones that are used to form an IK chain.

$ikchain (name) (end bone) [height (units)] [pad (units)][floor (units)]
  • Chains are specified by naming the bone farthest down in the chain, the next two bones are automatically found by walking the hierarchy.
  • IK chains are used exclusively with ikrule and iklock animation options. Depending in the specific rule used, the end bone is moved into the needed position, the top most bone is assumed fixed in place, and the position of the middle bone is moved so that that the distance from the end-to-middle and middle-to-top bones remain constant. An example would be an IK chain of the ankle-knee-hip chain, where the ankle is adjusted to hit to relative to the ground, the hip is locked in place, and the knee is bend such that the leg remains its original length.
Todo:  How is the 'top-most' bone specified ?
  • QC syntax example :
$ikchain rhand ValveBiped.Bip01_R_Hand knee  0.707 0.707 0.000
$ikchain lhand ValveBiped.Bip01_L_Hand knee  0.707 0.707 0.000
$ikchain rfoot ValveBiped.Bip01_R_Foot knee  0.707 -0.707 0.000
$ikchain lfoot ValveBiped.Bip01_L_Foot knee  0.707 -0.707 0.000

$ikchain options

iklock (chain) (lock position) (maintain local rotation)
  • For this sequence, keep track of the position/orientation of the specific chain before the sequence is applied, then after it’s applied, do a local IK rule to move it back into position/orientation. The weights are floating point values form 0.0 to 1.0.
  • This is used to keep the specified IK chains from moving during this sequence, which can be useful when applying pelvis or body motion to a model but you want the hands or feet to remain in place.
Note.pngNote:The value for the rotation lock is somewhat backwards from the position. To lock both of them, set it to "1 0", to let both of them freely move, set it to "0 1" (which is pointless, just don’t do the iklock in this case, but you get the idea).
ikrule (chain) touch (bone) [options...]
  • Adds an IK rule where a bone needs to be positioned relative to another part of the body.
  • This is useful when the hand needs to touch some other part of the model, such as the face, hip, other hand, etc., and that other body part may be not in the original animated location due to additional animation layers, bone controllers, or other ikrules.
  • Specify a bone of "" to get the chain to move relative to the models origin instead of an animated bone.
ikrule (chain) footstep (slot #) [options...]
  • Adds an IK rule where a subsequent body part – such as a foot – needs to be moved relative to the ground.

ikrule options

range (start) (peak) (tail) (end)
  • Sets the fade-in, hold, and fade-out frame numbers for the ikrule.
height (units)
  • Used by footstep rules, specifies how high to start the search above the desired ground height.
floor (units)
  • Used by footstep rules, specifies where the actual ground is ground height.
pad (radius)
  • Used by footstep rules, specifies how big the ground contact check should be.
contact (frame)
  • Used by footstep rules, specifies what frame use use when checking for ground position.
radius (units)
  • Used by attachment rules, specifies how out to search.
usesource
  • Use the original animation source to determine the IK goals. This is use useful if the current sequence is a composite that is different from the source animation and you want to get the movement back to its original form.
usesequence
  • Run all the sequence rules, including blendlayer and addlayer rules to determine the IK goals.