## ActionSource

Object Hierarchy | Related C++ Class: ActionSource

### Inheritance

###

SIObject

ProjectItem

Source

ActionSource

### Introduced

v1.5

### Description

ActionSource objects are a specialized type of Source object, representing sources for action and shape animation clips. These types of sources Action sources are composed of DataSource items (such as FCurves, Expressions, etc.), which you can access as AnimationSourceItems via the ActionSource.SourceItems property. See the siAnimationSourceItemType enum for a list of supported animation source types.
Actions are based on changes to parameters, usually called 'low-level animation' because it is parameter-based. Typically, action components are FCurves, Constraints, StaticSources (static poses), and ShapeKeys. You can bundle these components as action sources using the Model.AddActionSource method.
Shape animation is based on changes to the positions of points, thereby changing the overall shape of the geometry from the reference shape. (The reference shape comprises the results of the modeling operator stack.) These changes to the clusters are saved as ShapeKeys under the Clusters node of the object's Geometry in the UI. In the Mixer, the ShapeKey is instantiated as a ShapeClip.
Note: In action sources, the path to the parameter to which it will be applied by default is always stored as a Relative Name so that sources can be instantiated under any other model without having to necessarily provide a connection mapping template.
Action sources are often tied to the Mixer because of the Mixer's interaction with Clips; however, actions which have never been instantiated or which represent caching in the SimulationEnvironment object may not be associated with any Mixer or Model, but only under the Sources container or the Scene > Environments > Environment > Caches container. In these cases, some of the functionality is limited (for example, calling the base properties SIObject.Parent or ProjectItem.Model will not work since there is no Model that contains these sources.
To get a pointer to an existing action source from its clip, you can use the Clip.Source property. All action sources, whether instantiated or not, are also available as a DataSourceCollection from the Model to which they belong via the Model.Sources property.
Important: Although these sources are available as a DataSourceCollection, when you iterate over them, you are actually getting ActionSource objects, not individual DataSource objects such as FCurves, Expressions, etc. This is important to know because the ActionSource object gives access to a specific set of methods and properties.
To create ActionSource objects using the object model, you can use the Model.AddActionSource method. There is also a variety of scripting commands that also create ActionSource objects by loading presets (LoadActionPreset), storing current low-level animation (SIStoreAction and StoreAction), and by plotting (PlotToActions and PlotAndApplyActions).
Note: If you are working in a version of Softimage older than v4.0, the ActionSource object will not support the Source interface, which means that you cannot access the contents of the source via Clip.Source. Calling the base property SIObject.Parent on an ActionSource returns the Model. If the ActionSource is an environment cache, the parent returned is the SimulationEnvironment.

### Methods

AddCustomOp | AddICEAttribute | AddProperty | AddScriptedOp
AddScriptedOpFromFile | AddSourceItem | AnimatedParameters2 | BelongsTo
EvaluateAt | GetICEAttributeFromName | IsA | IsAnimated2
IsClassOf | IsEqualTo | IsKindOf | IsLocked
IsSelected | LockOwners | Offload | PartialOffload
Reload | RemoveICEAttribute | SetAsSelected | SetCapabilityFlag
SetLock | TaggedParameters | UnSetLock |

### Properties

Application | BranchFlag | Capabilities | Categories
EvaluationID | Families | FullName | Help
HierarchicalEvaluationID | ICEAttributes | LockLevel | LockMasters
LockType | Model | Name | NestedObjects
ObjectID | Origin | OriginPath | Owners
PPGLayout | Parameters | Parent | Parent3DObject
Properties | Selected | SourceItems | Type

### Examples

#### VBScript Example

    '

    ' This example illustrates how to create a simple actionsource from position animation. The

    ' AnimationSourceItem.Source property will be used to get the fcurve source and modify the keys.

    '

    NewScene , false

    set oRoot = Application.ActiveProject.ActiveScene.Root

    ' These commands were cut and pasted from scripting history and modified to work in a script.

    ' They create a simple actionsource from animation on the null's position

    set oNull = GetPrim( "Null" )

    strPosParams = oNull & ".kine.local.posx," & oNull & ".kine.local.posy," & oNull & ".kine.local.posz"

    Translate oNull, -8.153, 7.015, -0.702, siRelative, siView, siObj, siXYZ

    SaveKey strPosParams, 1.000

    Translate oNull, 8.350, -8.935, 0.894, siRelative, siView, siObj, siXYZ

    SaveKey strPosParams, 50.000

    Translate oNull, 9.413, 8.935, -0.894, siRelative, siView, siObj, siXYZ

    SaveKey strPosParams, 100.000

    StoreAction oRoot, strPosParams, 2, "StoredFcvAction", True, 1, 100

    ' Get the actionsource from the model

    set oActionSource = oRoot.Sources("StoredFcvAction")

    ' Find animation source item with posx and mute it

    for each oSourceItem in oActionSource.SourceItems

    	if instr(1,CStr(oSourceItem.Target),"posx",vbTextCompare)<>0 then

    		logmessage "muting " & oSourceItem.Target

    		oSourceItem.Active = False

    		exit for

    	end if

    next

    ' Apply actionsource with muted posx

    ApplyAction oActionSource, oNull

    ' Output of above script:

    'INFO : muting null.kine.local.posx

### See Also

Clip.Source Model.Sources Model.AddActionSource ImportAction LoadActionPreset SIStoreAction StoreAction PlotToActions PlotAndApplyActions CreateEnvironmentCache StoreEnvironmentCacheToMixer