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


cacheFileCombine([cacheIndex=boolean], [channelName=string], [connectCache=string], [keepWeights=boolean], [layerNode=boolean], [nextAvailable=boolean], [object=string], [objectIndex=int])

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

cacheFileCombine is undoable, queryable, and editable.

Creates a cacheBlend node that can be used to combine, layer or blend multiple cacheFiles for a given object.

Return value

stringName of created cache layer node(s)

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


cache, file, disk, blend


cacheIndex, channelName, connectCache, keepWeights, layerNode, nextAvailable, object, objectIndex
Long name (short name) Argument types Properties
layerNode(ln) boolean query
A query flag that returns a string array of the existing cacheBlends on the selected object(s). Returns an empty string array if no cacheBlends are found.
nextAvailable(na) boolean query
A query flag that returns the next available index on the selected cacheBlend node.
connectCache(cc) string queryedit
An edit flag that specifies a cacheFile node that should be connected to the next available index on the specified cacheBlend node. As a query flag, it returns a string array containing the cacheFiles that feed into the specified cacheBlend node.

In query mode, this flag can accept a value.

cacheIndex(ci) boolean query
A query only flag that returns the index related to the cache specified with the connectCache flag.
keepWeights(kw) boolean edit
This is a flag for use in combination with the connectCache flag only. By default, the connectCache flag will set all weights other than the newly added cacheWeight to 0 so that the new cache gets complete control. This flag disables that behavior so that all existing blend weights are retained.
object(obj) string query
This flag is used in combination with the objectIndex flag. It is used to specify the object whose index you wish to query.

In query mode, this flag needs a value.

objectIndex(oi) int queryedit
In edit mode, used in conjunction with the connectCache flag to indicate the objectIndex to be connected. In query mode, returns the index related to the object specified with the object flag.
channelName(cnm) string editmultiuse
Used in conjunction with the connectCache flag to indicate the channel(s) that should be connected. If not specified, the first channel in the file is used.

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

# Create a cacheBlend node so that additional caches can be added to
# the shape. This will attach the existing cacheFile on the shape
# to the new cacheBlend node.
cmds.select( 'cachedShape', r=True )
newBlend = cmds.cacheFileCombine()
# attach an additional cacheFile to the cacheBlend node
cmds.cacheFileCombine( newBlend[0], e=True, cc='cacheFile2' )
# query the index of the newly connected cache
cmds.cacheFileCombine( newBlend[0], cc='cacheFile2', query=True, cacheIndex=True )
# When more than one object is driven by the caches connected
# to the cacheBlend node, the -channelName and -objectIndex flags can be
# used to control which is connected.
# Query the objectIndex for the armShape geometry driven by cacheBlend3:
index = cmds.cacheFileCombine('cacheBlend3' ,object='armShape', query=True, objectIndex=True)
# Connect another cache up to drive the armShape
cmds.cacheFileCombine( 'cacheBlend3', channelName='myChannel', objectIndex=index, e=True, cc='cacheFile2' )