Documentation - Maxscript
IKFK_Solver : IK Solver
The IKFK_Solver is a solver that allows the animator the use of Both IK (inverse kinematics) and FK (forward kinematics) in the same hierarchy, useful for all kind of character limbs. The animator can easily switch between the modes using the IKFKBlend value, a value of 0.0 sets the hierarchy in forward kinematics Mode, that means that the movement of each node is inherited to its child, in this mode the animator can easily define arcs of movements. A value of 100 sets the hierarchy in inverse Kinematics mode, that means that the nodes will try to reach the position of the IKGoal helper, in this mode the animator can easily attach the foot or the hands of the character to the ground or other objects.
Optionally, the animator can interact with both modes without changing the IKFKBlend value, by rotating the FK nodes (or bones) or by moving the IKGoal Helper. The solver automatically match both IK and FK values each time that the FK or IK buttons are pressed or when the animator moves the IKGoal or rotates the FK Nodes. Other matches are done depending on the operation in progress.
The solver has scaling and stretching features as well. The way of scaling the hierarchy in FK mode is by using the Scale Mult Value, when this value is in 100 the hierarchy will be in its original size, if this value is increased or decreased it will shrink or grow the size of the hierarchy respectively. The way of scaling the hierarchy in IK mode is setting the IKStretch value to 100 and pulling the IK Goal a distance greater than the length of the hierarchy. The Scale Mult and the IKStretch are automatically matched every time that the animator switches modes if the Match Scale Multiplier is on.
It is composed by these Matrix3 controllers:
IKFK_Chain
IKFK_Control
The main calculations are done by the IKFK_Chain controller, it also holds the references of all the controllers used in the solver.
Creation Method
Assigns the IKFK Solver to a chain of nodes between the start_joint and end_joint nodes.
The function will create Control Helpers that the user can
manipulate in order to interact with the solver: one control helper for every joint for Forwards kinematics animation, one goal and one target control helper
for Inverse kinematics animation. Those helpers will contain IKFK_Control controllers that will be driven by an additional control helper which
contains the main IKFK_Chain controller where the user can access all the parameters of the solver.
The original joints will follow the transformation of the Control Helpers with the usage of Transform Constraints.
IKFK_Chain Properties
This is the list of nodes in the chain, these nodes will contain the IKFK_Control transform controllers and they will be used for animating the chain in Forwards Kinematics.
This node is used in Inverse kinematics for driving the movement of the chain.
The parent of the goal node can also be included in the solver with this parameter, this is specially useful for matching transformations from FK to IK (or viceversa) in the case that the goal parent node have be used for the animation of the chain. It doesn't have to be the immediate parent, it can also be a parent node several levels above in the hierarchy.
This node is used in Inverse kinematics in order to drive the orientation of the chain.
This node is used in Forward kinematics, the chain will inherit the rotation from this node depending on the .rotation_space parameter's value.
The user can switch between the IK and FK modes using the IKFKBlend value, a value of 0.0 sets the hierarchy in forward kinematics Mode, that means that the movement of each node is inherited to its child, in this mode the user can easily animate arcs of movements. A value of 100.0 sets the hierarchy in inverse Kinematics mode, that means that the nodes will try to reach the position of the IKGoal helper, in this mode the user can easily attach the foot or the hands of the character to the ground or other objects.
This parameter controls the stretch of the chain independently from the goal's position. A value bigger than 100.0 will increase the length of the chain, and a value lower than 100.0 will deacrease it.
This parameter controls how much the chain is going to stretch in order to reach the goal's position when it's further away than the total chain's length. If this value is 100.0 the chain will stretch fully, if this value is 0.0 the chain will not stretch at all.
This parameter controls how much effect the Rotation Space Node has over the chain when it's in FK Mode.
This parameter is only used with chains of more than 3 joints. It's useful for having more control over the joint's angles.
This parameter is used when there is no Target node assigned. You can control the chain's orientation with this parameter.
Enables/Disables the target node.
Enables/Disables the goal parent node.
Enables/Disables the rotation space node.
If this parameter is ON, the animator can interact with both modes without changing the IKFKBlend value, by rotating the FK nodes (or bones) or by moving the IKGoal Helper. The solver automatically match both IK and FK values when the animator moves the IKGoal or rotates the FK Nodes.
If this parameter is ON, the last joint of the chain will have the same orientation as the Goal Node when the solver is in IK Mode.
If this parameter is ON, the solver will keep the initial orientation of the chain relative to the rotation space node if the rotation space is being used.
Used as offset transformation if the keep_initial_rot_space parameter is on.
This parameter is used when matching the target node, the distance relative to the chain will depend on this value.
With this parameter you can choose to whether the IK goal or the start joint will be used as the parent space for the swivel angle. If IK Goal is selected (which is the default), then the Swivel Angle of the chain is defined in the parent space of its goal. If Start Joint is chosen, then the Swivel Angle will be relative to the parent space of the start joint.
0 - IK Goal.
1 - Start Joint.
This parameter is only used with chains of more than 3 joints, for 3 joints or less the solution is deterministic so it doesn't need iterations. This parameters controls the maximum number of attempts the IK solution will perform before giving up. If your IK animation seems to jitter, try increasing the Iterations. Increasing the Iterations will slow down the computational time, but should produce better results.
This parameter controls when the goal line is displayed.
0 - Never.
1 - When Selected.
2 - Always.
This parameter controls when the target line is displayed.
0 - Never.
1 - When Selected.
2 - Always.
If this parameter is on, the display of the nodes of the solver will change depending on the IKFK state, if the solver is in FK Mode, the IK nodes will be hidden. If the solver is in IK Mode, the FK nodes will be hidden instead. This behaviour only works with Control_Helper Objects.
IKFK_Chain Methods
The FK nodes transformations will be matched to the current solver transformations and the IKFK_Blend value will be set to zero. Same as pressing the FK button in the motion panel when the ikfk chain node is selected.
The IK nodes transformations will be matched to the current solver transformations and the IKFK_Blend value will be set to 100.0. Same as pressing the IK button in the motion panel when the ikfk chain node is selected.
The FK nodes transformations will be matched. The match can be done to the IK transformation if the optional parameter "toIK" is set to true. Otherwise the match is done to the current transformation defined with the .ikfk_blend parameter.
The IK nodes transformations will be matched. The match can be done to the FK transformation if the optional parameter "toFK" is set to true. Otherwise the match is done to the current transformation defined with the .ikfk_blend parameter.
The .manual_stretch parameter is matched to the current stretch defined by the auto stretch behavior.
The preferred rotations are matched to the current rotations of the joints.
IKFK_Control Properties
Contains the IKFK Chain Node.
Defines the type of the IKFK Control.
0 - Joint.
1 - Goal.
2 - Goal_Parent.
3 - Target.
Defines the index of the node along the chain if the type is "Joint".
This parameter stores the controller that controls the preferred rotations. The preferred rotations are used to define in what angles the chain will "prefer" to bend in order to reach the Goal node's position.
This is the main transform sub controller of the node. The local transformations will be stored in this controller. If the node is a Joint, this contains the FK transformations, if the node is a goal, a goal_parent or a target, this controller contains the IK transformations of the respective objects.
IKFK_Link Methods
You can access these methods in the IKFK_Link controller which is stored inside the IKFK_Control of the Goal Node, using the sub anim that has the name "Links".
Returns the number of targets.
Returns the indexed target.
Returns the linking start frame number of the indexed target.
Sets the linking start frame number of the indexed target. Returns true on success.
Appends the specified node to the target list at the specified frame. Returns true on success.
Deletes the indexed node from the target list. Returns true on success.
frameNo default value: -99999.
This method sets "World" as a target at the specified frame.
< Back to main maxscript documentation