Go to: Synopsis. Return value. Keywords. Flags. Python examples.

Synopsis

cacheFileMerge([endTime=time], [geometry=boolean], [startTime=time])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

cacheFileMerge is undoable, queryable, and editable.

If selected/specified caches can be successfully merged, will return the start/end frames of the new cache followed by the start/end frames of any gaps in the merged cache for which no data should be written to file. In query mode, will return the names of geometry associated with the specified cache file nodes.

Return value

float[]The start and end times of merged cache followed by start/end of any gaps
string[]Names of geometry associated with specified cache in query mode.

In query mode, return type is based on queried flag.

Keywords

cache, file, merge, disk

Flags

endTime, geometry, startTime
Long name (short name) Argument types Properties
geometry(g) boolean query
Query-only flag used to find the geometry nodes associated with the specified cache files.
startTime(st) time create
Specifies the start frame of the merge range. If not specified, will figure out range from the times of the caches being merged.
endTime(et) time create
Specifies the end frame of the merge range. If not specified, will figure out range from times of caches being merged.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Find associated geometry nodes
#
geom = cmds.cacheFileMerge('cache1', 'cache2' ,query=True, geometry=True)
# Validate merging of caches and find out start/end times.
# This will give a warning if there is a gap letting you know that
# simulation data will fill the gap.
#
startEndTimes = cmds.cacheFileMerge('cache1', 'cache2')
# Result: { 0, 20, 5, 10 }
start = startEndTimes[0]
end = startEndTimes[1]
gapStart = startEndTimes[2]
gapEnd = startEndTimes[3]
# Create a new merged cache, using simulation data to fill in
# any gaps between cache1 and cache2.
#
cacheFiles = cmds.cacheFile(fileName='mergedCache', startTime=start, endTime=end, points=geom[0])
switch = maya.mel.eval('createHistorySwitch("pPlaneShape1", false)');
cmds.cacheFile( attachFile=True, f=cacheFiles[0], ia='%s.inp[0]' % switch)
cmds.setAttr( '%s.playFromCache' % switch, 1 )
# Alternatively, can use append to make sure that we interpolate
# for the frames in the gap between cache1 and cache2.
#
cacheFiles = cmds.cacheFile(fileName='mergedCache', startTime=start, endTime=gapStart, points=geom[0])
switch = maya.mel.eval('createHistorySwitch("pPlane1", false)');
cmds.cacheFile( attachFile=True, f=cacheFiles[0], ia='%s.inp[0]' % switch)
cmds.setAttr( '%s.playFromCache' % switch, 1 )
cmds.cacheFile( replaceCachedFrame=True, startTime=gapEnd, endTime=end, points=geom[0] )