ジャンプ先: 概要. 戻り値. キーワード. フラグ. Python 例.
cacheFile([appendFrame=boolean], [attachFile=boolean], [cacheFileNode=string], [cacheFormat=string], [cacheInfo=string], [cacheableAttrs=string], [cacheableNode=string], [channelIndex=boolean], [channelName=string], [convertPc2=boolean], [createCacheNode=boolean], [creationChannelName=string], [dataSize=boolean], [deleteCachedFrame=boolean], [descriptionFileName=boolean], [directory=string], [doubleToFloat=boolean], [endTime=time], [fileName=string], [format=string], [geometry=boolean], [inAttr=string], [inTangent=string], [interpEndTime=time], [interpStartTime=time], [noBackup=boolean], [outAttr=string], [outTangent=string], [pc2File=string], [pointCount=boolean], [points=string], [pointsAndNormals=string], [prefix=boolean], [refresh=boolean], [replaceCachedFrame=boolean], [replaceWithoutSimulating=boolean], [runupFrames=int], [sampleMultiplier=int], [simulationRate=time], [singleCache=boolean], [startTime=time], [staticCache=boolean], [worldSpace=boolean])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
cacheFile は、取り消し可能、照会可能、および編集可能です。
ディスク上に 1 つまたは複数のキャッシュ ファイルを作成し、フレームのスパン用のアトリビュート データを格納します。キャッシュは、ジオメトリ上のポイント/法線(pts/points または pan/pointsAndNormals フラグを使用)、vectorArray 出力データ(oa/outAttr フラグを使用)、または追加のノード固有のデータ(データをサポートするこれらのノードに cnd/cacheableNode フラグを使用)に対して作成できます。 ia/inAttr フラグを使用すると、ディスク上のデータ ファイルをアトリビュートと関連付ける cacheFile ノードを接続します。 rcf/replaceCachedFrame フラグおよび apf/appendFrame フラグを使用すると、フレームを既存のキャッシュに置き換え/アペンドができます。置き換えられたフレームは絶対に削除されません。これは、f/fileName フラグで指定した名前でオリジナルのキャッシュ ファイルと同じディレクトリに格納されます。ファイル名を指定しないと、cacheFile 名の前に「backup」をつけて後ろに固有の番号を追加した名前になります。 単一のファイル キャッシュは丸ごとバックアップされます。前のバージョンに戻すには、このキャッシュにアタッチするだけです。フレームごとに 1 ファイル キャッシュは、記述ファイルおよび置き換えられたフレームのみをバックアップします。このタイプのキャッシュをリカバリするには、ファイル名をオリジナルの名前に変更する必要があります。| string | 作成されたキャッシュの記述ファイルの名前 |
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
| ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
|---|---|---|---|---|
appendFrame(apf)
|
boolean
|
|
||
|
||||
attachFile(af)
|
boolean
|
|
||
|
||||
cacheFileNode(cfn)
|
string
|
|
||
|
||||
cacheFormat(cf)
|
string
|
|
||
|
||||
cacheInfo(ci)
|
string
|
|
||
|
||||
cacheableAttrs(cat)
|
string
|
|
||
|
||||
cacheableNode(cnd)
|
string
|
|
||
|
||||
channelIndex(chi)
|
boolean
|
|
||
|
||||
channelName(cnm)
|
string
|
|
||
|
||||
convertPc2(pc2)
|
boolean
|
|
||
|
||||
createCacheNode(ccn)
|
boolean
|
|
||
|
||||
creationChannelName(cch)
|
string
|
|
||
|
||||
dataSize(dsz)
|
boolean
|
|
||
|
||||
deleteCachedFrame(dcf)
|
boolean
|
|
||
|
||||
descriptionFileName(dfn)
|
boolean
|
|
||
|
||||
directory(dir)
|
string
|
|
||
|
||||
doubleToFloat(dtf)
|
boolean
|
|
||
|
||||
endTime(et)
|
time
|
|
||
|
||||
fileName(f)
|
string
|
|
||
|
||||
format(fm)
|
string
|
|
||
|
||||
geometry(gm)
|
boolean
|
|
||
|
||||
inAttr(ia)
|
string
|
|
||
|
||||
inTangent(it)
|
string
|
|
||
|
||||
interpEndTime(iet)
|
time
|
|
||
|
||||
interpStartTime(ist)
|
time
|
|
||
|
||||
noBackup(nb)
|
boolean
|
|
||
|
||||
outAttr(oa)
|
string
|
|
||
|
||||
outTangent(ot)
|
string
|
|
||
|
||||
pc2File(pcf)
|
string
|
|
||
|
||||
pointCount(pc)
|
boolean
|
|
||
|
||||
points(pts)
|
string
|
|
||
|
||||
pointsAndNormals(pan)
|
string
|
|
||
|
||||
prefix(p)
|
boolean
|
|
||
|
||||
refresh(r)
|
boolean
|
|
||
|
||||
replaceCachedFrame(rcf)
|
boolean
|
|
||
|
||||
replaceWithoutSimulating(rws)
|
boolean
|
|
||
|
||||
runupFrames(rf)
|
int
|
|
||
|
||||
sampleMultiplier(spm)
|
int
|
|
||
|
||||
simulationRate(smr)
|
time
|
|
||
|
||||
singleCache(sch)
|
boolean
|
|
||
|
||||
startTime(st)
|
time
|
|
||
|
||||
staticCache(sc)
|
boolean
|
|
||
|
||||
worldSpace(ws)
|
boolean
|
|
||
|
||||
import maya.cmds as cmds
# Create a disk cache containing the points of a plane from
# frames 1 - 100. Typically the shape would be deforming.
#
cmds.polyPlane()
cacheFiles = cmds.cacheFile(f='shapeCache', st=1, et=100, points='pPlaneShape1')
# Add a historySwitch node to the history of the shape, and attach the
# newly created cache into the historySwitch node.
#
switch = maya.mel.eval('createHistorySwitch("pPlaneShape1",false)')
cacheNode = cmds.cacheFile(f=cacheFiles[0], cnm='pPlaneShape1', ia='%s.inp[0]' % switch ,attachFile=True)
cmds.setAttr( '%s.playFromCache' % switch, 1 )
# query the files associated with a cacheFile node
#
cmds.cacheFile( cacheNode, query=True, f=True )
# Now use the staticCache flag to indicate that the cache should not be
# created if the object appears to have no animation.
# Since the plane is not animated or deformed, no cache will be created.
#
cmds.polyPlane()
cacheFiles = cmds.cacheFile(f='shapeCache', staticCache=0, st=1, et=100, points='pPlaneShape2')
# Convert a maya cache into pc2 format. The maya cache is named
# pSphereShape1.xml and located in the directory "c:/test/".
#
cmds.cacheFile(pc2=0,pcf='c:/test/mypc2.pc2',f='pSphereShape1',dir='c:/test/')
# Convert a pc2 cache into a maya cache, with the cache data in a single
# file.
#
cmds.cacheFile(pc2=1,pcf='c:/test/mypc2.pc2',f='mayaCache2',dir='c:/test/',format='OneFile')