ジャンプ先: 概要. 戻り値. キーワード. フラグ. 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 | 作成されたキャッシュの記述ファイルの名前 |
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
cache, file, disk
appendFrame, attachFile, cacheFileNode, cacheFormat, cacheInfo, cacheableAttrs, cacheableNode, channelIndex, channelName, convertPc2, createCacheNode, creationChannelName, dataSize, deleteCachedFrame, descriptionFileName, directory, doubleToFloat, endTime, fileName, format, geometry, inAttr, inTangent, interpEndTime, interpStartTime, noBackup, outAttr, outTangent, pc2File, pointCount, points, pointsAndNormals, prefix, refresh, replaceCachedFrame, replaceWithoutSimulating, runupFrames, sampleMultiplier, simulationRate, singleCache, startTime, staticCache, worldSpace
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。
|
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')