Documentation - Maxscript

< Back to main maxscript documentation

CurveIK_Solver : IK Solver


the CurveIK_Solver constraints a chain of nodes to a bezier curve that can be controlled with helpers. It's a lot better for character rigging than the default spline ik solver because it requires less nodes and behaves like the setups that animators use with bendy limbs of toony characters.

It is composed by two controllers:

CurveIK_Chain
CurveIK_Control

The CurveIK_Control is used by the nodes that compose the chain that follows the curve. And the CurveIK_Chain is used by the control helper, the CurveIK_Control receive its position from the CurveIK_Chain. If the node that holds the CurveIK_Chain is deleted the other curve controllers are removed from the nodes, just like it happens with the other IK solvers.


Creation Methods

<boolean> SmartAnim.CreateCurveIKSolver <node>start_joint <node>end_joint [points_type:<enum>] [num_points:<integer>] [num_bones:<integer>] [bones_controls:<boolean>]

Assigns the Curve IK Solver to a chain of nodes between the start_joint and end_joint nodes. Depending on the parameters provided the function will create several nodes and controllers that the animator can use to manipulate the chain.

The optional points_type parameter can be any of these values:

#BezierCorner
#Bezier
#Corner
#Smooth

The optional parameter num_points defines how many Point Control helpers are going to be created, the animator can use these helpers to control how the curve is being to be deformed.

The optional parameter num_bones defines how many bones are going to be created in the chain, if the user doesn't want to change the number of bones don't provide this parameter, or use a negative number.

If the optional parameter bones_controls is true, additional controllers will be created in order to be able to manipulate the bones independently.

<boolean> SmartAnim.CurveIKSolverDlg <node>start_joint <node>end_joint

Opens the CurveIK Solver Creation Dialog where the user can input the parameters for the creation of the Curve IK solver.


CurveIK_Chain Properties

<CurveIK_Chain>.joints Node Array

This is the list of nodes in the chain, these nodes will contain the CurveIK_Control transform controllers.

<CurveIK_Chain>.points Node Array

This is the list of nodes that control the deformation of the curve of the chain. This nodes don't require any Curve IK controller in particular.

<CurveIK_Chain>.points_types Integer Array

This is array contains the deformation type of every point of the curve, this array should have the same size as the .points array. Their values can be any of the following:

0 - BezierCorner.
1 - Bezier.
2 - Corner.
3 - Smooth.

<CurveIK_Chain>.in_tangents Node Array

This is the list of nodes that control the position of the In Tangents of every point in the curve, these nodes are used when the point is of type BezierCorner. This array should have the same size as the .points array.

<CurveIK_Chain>.out_tangents Node Array

This is the list of nodes that control the position of the Out Tangents of every point in the curve, these nodes are used when the point is of type BezierCorner or Bezier. This array should have the same size as the .points array.

<CurveIK_Chain>.percent Percent default: 0.0

This is the position along the curve at which the chain is placed, as a percent of the overall curve length.

<CurveIK_Chain>.rotation Angle default: 0.0

The rotation amount, how much the joints rotate along their aim axis.

<CurveIK_Chain>.twist Angle default: 0.0

The twist amount, the rotation applied to the end of the chain.

<CurveIK_Chain>.points_twist Angle Array

This array contains twist values for every point of the chain. This array should have the same size as the .points array.

<CurveIK_Chain>.manual_stretch Percent default: 100.0

This parameter controls the stretch of the chain independently from the curve length. A value bigger than 100.0 will increase the length of the chain, and a value lower than 100.0 will deacrease it.

<CurveIK_Chain>.auto_stretch Percent default: 100.0

This parameter controls how much the chain is going to stretch in order to reach the curve'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.

<CurveIK_Chain>.squash Percent default: 0.0

This parameter controls the squash effect when the curve is stretched or contracted.

<CurveIK_Chain>.backwards Percent default: 0.0

If this parameter is 100% the chain will stick at the end of the curve when it's not auto stretched.

<CurveIK_Chain>.slide_joints Percent default: 100.0

If this parameter is 100% the chain will slide along the curve and the joints will try to keep a proportional distance between them. If it's 0% the joints position along the chain will be affected by the curve's points position.

<CurveIK_Chain>.use_wave Boolean default: false

Enables/Disables a wave effect along the curve.

<CurveIK_Chain>.wave_amplitude WorldUnits default: 0.0

Get/set the height of the wave. It is the distance from the centre line (or the still position) to the top of a crest. or to the bottom of a trough.

<CurveIK_Chain>.points_wave_amplitude Percent Array

This array contains multipliers of the wave amplitude for each point. This array should have the same size as the .points array.

<CurveIK_Chain>.wave_length WorldUnits default: 100.0

Get/set the length of the wave, it describes how long the wave is. It is the distance from the "crest" (top) of one wave to the crest of the next wave.

<CurveIK_Chain>.wave_orientation Angle default: 0.0

Get/set the orientation of the wave along the curve.

<CurveIK_Chain>.wave_phase Angle default: 0.0

Get/set the offset of the wave.

<CurveIK_Chain>.steps Integer default: 16

This parameter controls the sub division that the curve has for certain calculations inside the solver. If your IK animation seems to jitter, try increasing the Steps. Increasing the Steps will slow down the computational time, but should produce better results.

<CurveIK_Chain>.chain_length WorldUnits

This parameter is used as a reference for the auto stretch functionality.

<CurveIK_Chain>.use_points_rotation Boolean default: false

If this parameter is ON the points nodes rotation will affect the rotation of the chain joints that are close to that point.

<CurveIK_Chain>.use_points_scale Boolean default: false

If this parameter is ON the points nodes scale will affect the scale of the chain joints that are close to that point.

<CurveIK_Chain>.additive_twist Boolean default: false

If this parameter is ON the individual point twist parameters will become additive with each other.

<CurveIK_Chain>.closed_loop Boolean default: false

If this parameter is ON the curve will be a closed loop, or in other words, the first point of the curve will become both the first and the last.

<CurveIK_Chain>.follow_type Integer default: 2

This control how the joints orientation will follow the curve:

0 - None.
1 - Tangent.
2 - Child.

<CurveIK_Chain>.aim_axis Integer default: 0

Get/set the axis that the joints are using to follow the curve.

0 - X.
1 - Y.
2 - Z.

<CurveIK_Chain>.aim_axis_flip Boolean default: false

This parameter flips the axis that is being used to follow the curve.

<CurveIK_Chain>.align_axis Integer default: 0

Get/set the reference axis that is used to build the aim rotation.

0 - X.
1 - Y.
2 - Z.

<CurveIK_Chain>.align_axis_flip Boolean default: false

This parameter flips the align axis.

<CurveIK_Chain>.parent_space Integer default: 1

This parameter defines what criteria is used for inheriting transformations.

0 - World.
1 - Chain Parent.
2 - Node.

<CurveIK_Chain>.parent_space_node Node

Get/set the node used for inheritance of transformation in case .parent_space is set to "Node"

<CurveIK_Chain>.display_curve Integer default: 1

This parameter controls when the curve line is displayed.

0 - Never.
1 - When Selected.
2 - Always.

<CurveIK_Chain>.display_tangents Integer default: 2

This parameter controls when the tangent lines are displayed.

0 - Never.
1 - When Selected.
2 - Always.


CurveIK_Chain Methods

<integer> <CurveIK_Chain>.NumPoints()

Returns the number of point nodes used to control the curve of the Curve IK Solver.

<boolean> <CurveIK_Chain>.AddPoint <node>point [type:<enum>] [in_tangent:<node>] [out_tangent:<node>] [twist:<angle>] [amplitude:<percent>]

Adds a point node to the list of points that controls the curve deformation. The type parameter can be one of the following:

#BezierCorner
#Bezier
#Corner
#Smooth

Returns True on success, False otherwise.

<boolean> <CurveIK_Chain>.RemovePoint <index>index

Removes the specified point node from the list of points. Returns True on success, False otherwise.

<boolean> <CurveIK_Chain>.SetPoint <index>index <node>point

Sets the specified point node in the list of points. Returns True on success, False otherwise.

<node> <CurveIK_Chain>.GetPoint <index>index

Returns the specified point node from the list of points.

<boolean> <CurveIK_Chain>.SetPointType <index>index <enum>type

Sets the specified point type in the list of points. The type parameter can be one of the following:

#BezierCorner
#Bezier
#Corner
#Smooth

Returns True on success, False otherwise.

<enum> <CurveIK_Chain>.GetPointType <index>index

Returns the specified point type from the list of points.

<boolean> <CurveIK_Chain>.SetInTangent <index>index <node>in_tangent

Sets the specified point in tangent node in the list of points. Returns True on success, False otherwise.

<node> <CurveIK_Chain>.GetInTangent <index>index

Returns the specified point in tangent node from the list of points.

<boolean> <CurveIK_Chain>.SetOutTangent <index>index <node>out_tangent

Sets the specified point out tangent node in the list of points. Returns True on success, False otherwise.

<node> <CurveIK_Chain>.GetOutTangent <index>index

Returns the specified point out tangent node from the list of points.

<boolean> <CurveIK_Chain>.SetTwist <index>index <angle>twist

Sets the specified point twist value in the list of points. Returns True on success, False otherwise.

<node> <CurveIK_Chain>.GetTwist <index>index

Returns the specified point twist value from the list of points.

<boolean> <CurveIK_Chain>.SetAmplitude <index>index <percent>amplitude

Sets the specified point amplitude value in the list of points. Returns True on success, False otherwise.

<node> <CurveIK_Chain>.GetAmplitude <index>index

Returns the specified point amplitude value from the list of points.

<void> <CurveIK_Chain>.ResetLength()

The .chain_length property will be reset to the current curve length.


CurveIK_Control Properties

<CurveIK_Control>.curveikchain_node Node : Read Only

Contains the CurveIK Chain Node.

<CurveIK_Control>.index Integer : Read Only

Defines the index of the joint along the chain.

<CurveIK_Control>.percent Percent

Get/set the joint percent position along the curve.

<CurveIK_Control>.squash Percent

Get/set the squash multiplier of the joint.

<CurveIK_Control>.FK_Sub_Control Matrix3

This is the main transform sub controller of the joint. The local transformations will be stored in this controller.


< Back to main maxscript documentation