# CSLMixer Class Reference

`#include <Mixer.h>`

Inheritance diagram for CSLMixer:

List of all members.

## Public Member Functions
| CSLMixer (CSLScene *in_pScene, CSLModel *in_pModel, CdotXSITemplate *in_pTemplate)
virtual SI_Error | Synchronize ()
CSLTemplate::ETemplateType | Type ()
SI_Bool | GetActive ()
SI_Void | SetActive (SI_Bool in_bNew)
SI_Bool | GetAutoTransition ()
SI_Void | SetAutoTransition (SI_Bool in_bNew)
SI_Bool | GetMaintainContinuity ()
SI_Void | SetMaintainContinuity (SI_Bool in_bNew)
SI_Bool | GetNormalize ()
SI_Void | SetNormalize (SI_Bool in_bNew)
SI_Bool | GetQuaternionMixing ()
SI_Void | SetQuaternionMixing (SI_Bool in_bNew)
SI_Bool | GetRemoveSpins ()
SI_Void | SetRemoveSpins (SI_Bool in_bNew)
SI_Error | RemoveAction (SI_Int in_nIndex)
SI_Error | RemoveAction (CSLAction *in_pToRemove)
CSLAction ** | GetActionList ()
SI_Int | GetActionCount ()
virtual CSLAction * | AddAction ()
SI_Error | ClearActions ()
CSLAction * | ConnectAction (CSLAction *in_pNewAction)
CSLAction * | FindAction (SI_Char *in_pActionName)
SI_Error | RemoveTrack (SI_Int in_nIndex)
SI_Error | RemoveTrack (CSLTrack *io_pToRemove)
CSLTrack ** | GetTrackList ()
SI_Int | GetTrackCount ()
CSLTrack * | AddTrack ()
SI_Error | ClearTracks ()
CSLTrack * | ConnectTrack (CSLTrack *in_pNewTrack)

## Detailed Description

The animation mixer provides high-level control over animation (see the XSI_Mixer template reference). The mixer contains a database of short animations called action sources (CSLAction). An action source can be instantiated in the form of an action clip (CSLActionClip) in tracks (CSLTrack) to compose complex animation. You can create an animation mixer with the CSLModel::CreateMixer method.

Note:
  This template is not supported by SI3D.

See also:
  CSLAction

  CSLActionClip

  CSLModel

  CSLTrack

## Constructor & Destructor Documentation

CSLMixer | ( | CSLScene * | in_pScene,
|  | CSLModel * | in_pModel,
|  | CdotXSITemplate * | in_pTemplate |
| ) |  |  |

Constructor

Parameters:

  | in_pScene | Pointer to the scene containing the mixer
  | in_pModel | Pointer to the model containing the mixer
  | in_pTemplate | Pointer to the CdotXSITemplate containing the mixer

## Member Function Documentation

virtual SI_Error Synchronize | ( |  | ) | `[virtual]`

Synchronizes internal data to be coherent with the IO layer

Returns:
  success or failure

Reimplemented from CSLTemplate.

CSLTemplate::ETemplateType Type | ( |  | ) | `[inline, virtual]`

Returns the type of this template

Return values:

  | CSLTemplate::XSI_MIXER |

Implements CSLTemplate.

SI_Bool GetActive | ( |  | ) |

Determines if the animation mixer is active or not

Returns:
  SI_Bool Value of the flag

SI_Void SetActive | ( | SI_Bool | in_bNew | ) |

Toggles the animation mixer evaluation

Parameters:

  | in_bNew | Value of the flag

SI_Bool GetAutoTransition | ( |  | ) |

Determines if inter-clip interpolation is enabled or not

Returns:
  SI_Bool Value of the flag

SI_Void SetAutoTransition | ( | SI_Bool | in_bNew | ) |

Toggles inter-clip interpolation

Parameters:

  | in_bNew | Value of the flag

SI_Bool GetMaintainContinuity | ( |  | ) |

Gets the Maintain Continuity Flag

Return values:

  | True | Maintain Continuity is enabled
  | False | Maintain Continuity is disabled

Note:
  When you select Quaternion for Rotation Mixing, this option generates more continuous rotation curves, especially for operations such as plotting/freezing rotation parameters driven by the animation mixer.

SI_Void SetMaintainContinuity | ( | SI_Bool | in_bNew | ) |

Sets the Maintain Continuity Flag

Parameters:

  | in_bNew | True to enable, false to disable

Note:
  When you select Quaternion for Rotation Mixing, this option generates more continuous rotation curves, especially for operations such as plotting/freezing rotation parameters driven by the animation mixer.

Warning:
  This flag is ignored unless QuaternionMixing is enabled.

See also:
  CSLMixer::SetQuaternionMixing

SI_Bool GetNormalize | ( |  | ) |

Gets how the mix is calculated

Return values:

  | True | Mixes are a weighted averages. The results are mixes that fall in-between the values of the separate clips.
  | False | mixes are additive. The values of the separate clips are added on top of each other.

SI_Void SetNormalize | ( | SI_Bool | in_bNew | ) |

Sets how the mix is calculated

Parameters:

  | in_bNew | Value of the flag

Note:
  When set to True, mixes are a weighted averages. The results are mixes that fall in-between the values of the separate clips. When set to False, mixes are additive. The values of the separate clips are added on top of each other.

SI_Bool GetQuaternionMixing | ( |  | ) |

Gets the Quaternion Mixing Flag

Return values:

  | True | Rotation values are mixed according to their Quaternion values
  | False | Rotation values are mixed according to their Euler values

Note:
  Quaternions usually result in smoother rotations; however, if you are mixing two or more rotations and using Quaternion, there may be some unexpected flips in the animation. Using Euler will probably solve this problem.

SI_Void SetQuaternionMixing | ( | SI_Bool | in_bNew | ) |

Sets the Quaternion Mixing Flag

Parameters:

  | in_bNew | Value of the flag

Note:
  Controls whether rotation values are mixed according to their Quaternion values (True) or their Euler values (False). Quaternions usually result in smoother rotations; however, if you are mixing two or more rotations and using Quaternion, there may be some unexpected flips in the animation. Using Euler will probably solve this problem.

SI_Bool GetRemoveSpins | ( |  | ) |

Gets the Remove Spins Flag

Returns:
  SI_Bool Value of the flag

SI_Void SetRemoveSpins | ( | SI_Bool | in_bNew | ) |

Sets the Remove Spins Flag

Parameters:

  | in_bNew | Value of the flag

Note:
  When set to True, this option removes extra spinning that may occur in a rotation so that the object's rotation values are only between -180 and 180. For example, you can sometimes get rotation values with extra "spins," such as [-591, 1015, 15]. This option gives you the same rotation but without the spins.

Warning:
  This flag is ignored unless Quaternion Mixing is disabled.

See also:
  CSLMixer::SetQuaternionMixing

SI_Error RemoveAction | ( | SI_Int | in_nIndex | ) |

Removes an action

Parameters:

  | in_nIndex | Index of the CSLAction to remove

Return values:

  | SI_SUCCESS | The element was removed
  | SI_ERR_BAD_ARGUMENT | Invalid index

SI_Error RemoveAction | ( | CSLAction * | in_pToRemove | ) |

Removes an action

Parameters:

  | in_pToRemove | Pointer to the action to remove

Return values:

  | SI_SUCCESS | The element was removed
  | SI_ERR_BAD_ARGUMENT | The element could not be found

CSLAction** GetActionList | ( |  | ) |

Gets the list of all actions

Returns:
  Pointer to the list of pointer of all actions

SI_Int GetActionCount | ( |  | ) |

Get the total number of actions

Returns:
  SI_Int The number of actions

virtual CSLAction* AddAction | ( |  | ) | `[virtual]`

Adds a new action

Returns:
  CSLAction Pointer to the newly added action

Reimplemented in CSLCOLLADAMixer.

SI_Error ClearActions | ( |  | ) |

Removes all actions

Returns:
  SI_Error Whether or not removal was successful

CSLAction* ConnectAction | ( | CSLAction * | in_pNewAction | ) |

Adds a preallocated action to the action list

Parameters:

  | CSLAction | Pointer to the action to add

Returns:
  CSLAction The newly added action or null if it was already added

CSLAction* FindAction | ( | SI_Char * | in_pActionName | ) |

Search for an action with the specifed name in the action list

Parameters:

  | SI_Char* | The action name we're looking for

Returns:
  CSLAction The action found or NULL

SI_Error RemoveTrack | ( | SI_Int | in_nIndex | ) |

Removes a track

Parameters:

  | in_nIndex | Index of the track to remove

Return values:

  | SI_SUCCESS | The element was removed
  | SI_ERR_BAD_ARGUMENT | Invalid index

SI_Error RemoveTrack | ( | CSLTrack * | io_pToRemove | ) |

Removes a track

Parameters:

  | in_pToRemove | Pointer to the track to remove

Return values:

  | SI_SUCCESS | The element was removed
  | SI_ERR_BAD_ARGUMENT | The element could not be found

CSLTrack** GetTrackList | ( |  | ) |

Gets the list of all tracks

Returns:
  Pointer to the list of pointer of all tracks

SI_Int GetTrackCount | ( |  | ) |

Get the total number of tracks

Returns:
  SI_Int The number of tracks

CSLTrack* AddTrack | ( |  | ) |

Adds a new track

Returns:
  CSLTrack Pointer to the newly added track

SI_Error ClearTracks | ( |  | ) |

Removes all Tracks

Returns:
  SI_Error Whether or not removal was successful

CSLTrack* ConnectTrack | ( | CSLTrack * | in_pNewTrack | ) |

Adds a preallocated Track to the Track list

Parameters:

  | CSLTrack | Pointer to the Track to add

Returns:
  CSLTrack The newly added Track or null if it was already added

The documentation for this class was generated from the following file:

- Mixer.h