## AddFileCacheSource

### Introduced

v7.0

### Description

Loads a file cache sequence onto the mixer. The file cache sequence has to be generated first using either the CacheOnFileNode node in an ICE Tree, or by running the CacheObjectsIntoFile command and then the CacheObjectsIntoFileDialog command.
This command creates a new FileCacheSource object, and can additionally create the FileCache track on the mixer and deploy the FileCache clip onto that track.
Note: This command uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference so you need to use the best workaround for your situation:
For scripting languages this command returns an ISIVTCollection which you can use to get the output arguments.
For C# you can use the XSIApplication.ExecuteCommand method to call this command. ExecuteCommand packs the output arguments into a C# System.Object containing an Array of the output arguments (see Calling Commands from C#).

### Scripting Syntax

    AddFileCacheSource( [InputObj], [FileName], [DeployInMixer], [Source] );

### Parameters

Parameter | Type | Description
--- | --- | ---
InputObj | String | The object to be linked to the file cache Default Value: Current selection
FileName | String | Full path of the new file cache source. Default Value: User is prompted to select a file
DeployInMixer | Boolean | True to make available in the animation mixer. Default Value: True
Source | CollectionItemLegacy | The new file cache source.

### Examples

#### Python Example

    app = Application

    True = 1

    False = 0

    app.NewScene("", False)

    # First set the caching preferences

    app.SetValue("preferences.simulation.cachetemplatefilename", "[object]_[version]_[frame].icecache")

    app.SetValue("preferences.simulation.cachetemplateprojectpath", "[project path]/simulation/[model]/[object]/")

    # Create a grid deformed by a wave

    app.CreatePrim("Grid", "MeshSurface")

    app.GetPrimWave()

    # Cache this deformation into a file sequence

    app.CacheObjectsIntoFile("grid", 0, 1, 100, 1, True, True, "PointPosition", "Wave")

    # Delete the wave deform

    app.DeleteObj("wave")

    # Load the deformation file sequence onto the mixer

    rtn = app.AddFileCacheSource("grid", "Simulation\Scene_Root\grid\grid_Wave_[1..100].icecache")

    src = rtn.Value("Source")

    app.LogMessage("The newly created %s is: %s" % (src.Type, src.FullName))

    # INFO : The newly created FileCacheSource is: Mixer.grid_Wave__1__100__icecache

    # Now hit Playback

    app.PlayForwards()

### See Also

CacheObjectsIntoFile CacheObjectsIntoFileDialog Source