# MappedItem Class Reference

Related Scripting Object: MappedItem

A mapped item specifies the value driven by a specific clip instance (for example, an object's parameter or its geometry). More...

`#include <xsi_mappeditem.h>`

Inheritance diagram for MappedItem:

List of all members.

## Public Member Functions
| MappedItem ()
| ~MappedItem ()
| MappedItem (const CRef &in_ref)
| MappedItem (const MappedItem &in_obj)
bool | IsA (siClassID in_ClassID) const
siClassID | GetClassID () const
MappedItem & | operator= (const MappedItem &in_obj)
MappedItem & | operator= (const CRef &in_ref)
CRef | GetAnimationSource () const
CRef | GetDestination () const
ClipEffectItem | GetClipEffectItem () const

## Detailed Description

A mapped item specifies the value driven by a specific clip instance (for example, an object's parameter or its geometry).

You can get the MappedItem from Clip::GetMappedItems.

In order to know exactly which type of AnimationSourceItem you are dealing with you can use SIObject::GetType which returns a value contained in the XSI::siAnimationSourceItemType enum.

See also:
  Clip::GetMappedItems

Since:
  4.0

Example:
  Demonstrates how to use mapped item to look for a specific animation channel. Once this channel is found a clip effect is added onto it.

            using namespace XSI;

            Application app;
            Model root = app.GetActiveSceneRoot();

            X3DObject myCube;
            root.AddGeometry( L"Cube", L"MeshSurface", L"", myCube );

            // Create the first animation source
            CValueArray args(9);
            CValue      outArg;
            args[0] = root;
            args[1] = L"cube.kine.local.posx,cube.kine.local.posy,cube.kine.local.posz";
            args[3] = L"StoredStaticPose";
            args[4] = true;
            args[7] = false;
            args[8] = false;
            app.ExecuteCommand( L"StoreAction", args, outArg );

            Source mySource(outArg);

            // Create the first clip
            CValueArray addClipArgs(6);
            addClipArgs[0] = root;
            addClipArgs[1] = mySource.GetFullName();
            addClipArgs[5] = L"MyClip1";
            app.ExecuteCommand( L"AddClip", addClipArgs, outArg );

            Clip myClip(outArg);
            CRefArray mappedItems = myClip.GetMappedItems();
            // Find the mapped item on which we want to add an effect.
            // We are looking for the local.posy parameter
            LONG i;
            MappedItem currItem;
            for(i = 0; i < mappedItems.GetCount(); ++i)
            {
                currItem = mappedItems[i];
                Parameter param = currItem.GetDestination();
                if(param.GetFullName().IsEqualNoCase(L"cube.kine.local.posy"))
                {
                    CValueArray mappingRuleArgs(4);
                    mappingRuleArgs[0] = myClip.GetFullName() + L".ActionClip";
                    mappingRuleArgs[1] = param;
                    mappingRuleArgs[2] = L"frame";
                    mappingRuleArgs[3] = (LONG)(i + 1);

                    app.ExecuteCommand(L"SetMappingRule", mappingRuleArgs, outArg);
                    break;
                }
            }

            ClipEffectItem effectItem(currItem.GetClipEffectItem());
            app.LogMessage(L"The expression associated with the posy item is >> " +
                            effectItem.GetExpression());

## Constructor & Destructor Documentation

MappedItem | ( |  | ) |

Default constructor.

~MappedItem | ( |  | ) |

Default destructor.

MappedItem | ( | const CRef & | in_ref | ) |

Constructor.

Parameters:

  | in_ref | constant reference object.

MappedItem | ( | const MappedItem & | in_obj | ) |

Copy constructor.

Parameters:

  | in_obj | constant class object.

## Member Function Documentation

bool IsA | ( | siClassID | in_ClassID | ) | const`[virtual]`

Returns true if a given class type is compatible with this API class.

Parameters:

  | in_ClassID | class type.

Returns:
  true if the class is compatible, false otherwise.

Reimplemented from SIObject.

siClassID GetClassID | ( |  | ) | const`[virtual]`

Returns the type of the API class.

Returns:
  The class type.

Reimplemented from SIObject.

MappedItem& operator= | ( | const MappedItem & | in_obj | ) |

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:

  | in_obj | constant class object.

Returns:
  The new MappedItem object.

MappedItem& operator= | ( | const CRef & | in_ref | ) |

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:

  | in_ref | constant class object.

Returns:
  The new MappedItem object.

Reimplemented from SIObject.

CRef GetAnimationSource | ( |  | ) | const

Returns the object which is driving the action or shape animation. This function is not available for compound clips. You can test to see whether the clip is a compound clip by testing if SIObject::GetClassID() == siClipContainerID on the Clip object.

Warning:
  In the case of Expressions or Constraints, this property will return an invalid CRef, because the MappedItem object does not contain the full Expression or Constraint objects.

Returns:
  A reference to either a ShapeKey, FCurve or StaticSource.

See also:
  MappedItem::Source2

CRef GetDestination | ( |  | ) | const

Returns the parameter which is driven by the mapped item. If the mapped item is a shape animation this function returns the cluster on which the shape key is located.

Returns:
  A reference to either a Parameter or a Cluster.

ClipEffectItem GetClipEffectItem | ( |  | ) | const

For all items driven by a clip there could be an associated clip effect which would affect the value after the evaluation of the animation source. This function returns the specific item in the ClipEffect which is associated to this mapped item.

Returns:
  The associated ClipEffectItem.

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

- xsi_mappeditem.h