Class IKChainActions

3DS Max Plug-In SDK

Class IKChainActions

See Also: : Class IKCmdOps, Class IIKChainControl

class IKChainActions : public FPStaticInterface

 

Description:

This class is only available in release 5 or later.

 

The program interface to actions on IK chain nodes, which IKCmdOps::CreateIKChain() returns. An macro is defined to obtain a pointer to the interface:

 

 IKChainActions* ikchainAction = GET_IKCHAIN_FP_INTERFACE;

 

It should be a valid pointer provided the IK system is successfully loaded.

 

The methods are mainly designed to connect to the UI and script. However, they can be called programmatically as well. The action methods, those that return FPStatus, assume that a unique IK chain node is currently selected and apply action to it. Before an action method is called, IsSnapEnabled() must be called to test whether a unique IK chain node is being selected. Such as:

 

 if (ikchainAction->IsSnapEnabled())

  ikchainAction->SetPreferredAngles();

 

Methods:

 

Prototype:

virtual FPStatus SetPreferredAngles()

Remarks:

It sets the preferred angles of all bones on the chain to the corresponding joint angles currently in force, which can be FK or IK depending the state of Enabled.

 

Prototype:

virtual FPStatus IKSnapAction()

Remarks:

Applies IK Snapping, which sets IK goal and other parameters, such as the swivel angle, according to the current state of the bone chain. Moreover, it invokes SetPreferredAngles().

 

Prototype:

virtual FPStatus FKSnapAction()

Remarks:

Applies FK Snapping, which assigns the currently active joint angles to the corresponding FK angles. Moreover, it invokes SetPreferredAngles().

 

Prototype:

virtual FPStatus SnapAction()

Remarks:

It applies IKSnapAction() if IK Enabled is currently off, and FKSnapAction() if IK Enabled is on.

 

Prototype:

virtual FPStatus ToggleEnabled()

Remarks:

Toggles IK Enabled state. If the AutoSnap parameter of the IK chain is true, it will invoke SnapAction() before toggling the Enabled state.

 

Prototype:

virtual FPStatus AssumePreferredAngles()

Remarks:

It assigns the preferred angles to the corresponding FK angles and then turn off IK Enabled.