ジャンプ先: 概要. 戻り値. 関連項目. フラグ. MEL 例.
file [-activate]
[-activeProxy] [-anyModified] [-applyTo string] [-buildLoadSettings] [-channels boolean] [-cleanReference string] [-command string string] [-compress] [-constraints boolean] [-constructionHistory boolean]
[-copyNumberList] [-defaultExtensions boolean]
[-defaultNamespace] [-deferReference boolean] [-editCommand string] [-errorStatus] [-executeScriptNodes boolean]
[-exists] [-expandName] [-exportAll] [-exportAnim] [-exportAnimFromReference]
[-exportAsReference]
[-exportAsSegment] [-exportSelected] [-exportSelectedAnim] [-exportSelectedAnimFromReference]
[-exportSelectedNoReference]
[-exportUnloadedReferences]
[-expressions boolean]
[-flushReference string]
[-force] [-groupLocator] [-groupName string] [-groupReference] [-ignoreVersion] [-import] [-importReference] [-lastFileOption] [-lastTempFile] [-list] [-loadAllDeferred boolean]
[-loadAllReferences]
[-loadNoReferences] [-loadReference string] [-loadReferenceDepth string]
[-loadSettings string]
[-location] [-lockContainerUnpublished
boolean] [-lockFile
boolean] [-lockReference]
[-mapPlaceHolderNamespace
string string] [-mergeNamespacesOnClash]
[-modified boolean] [-moveSelected] [-namespace string] [-newFile] [-open]
[-options string] [-parentNamespace] [-postSaveScript string] [-preSaveScript string] [-preserveName] [-preserveReferences] [-prompt boolean] [-proxyManager string] [-proxyTag string] [-reference] [-referenceDepthInfo uint]
[-referenceNode string]
[-removeDuplicateNetworks]
[-removeReference] [-rename string] [-renameAll boolean] [-renameToSave boolean] [-renamingPrefix string] [-renamingPrefixList] [-replaceName string string] [-resetError] [-returnNewNodes] [-save] [-saveDiskCache string] [-saveReference] [-saveReferencesUnloaded]
[-saveTextures string]
[-sceneName] [-segment string] [-selectAll] [-shader
boolean] [-sharedNodes
string] [-sharedReferenceFile] [-shortName] [-strict
boolean] [-swapNamespace
string string] [-type string]
[-uiConfiguration
boolean] [-unloadReference string]
[-unresolvedName] [-usingNamespaces] [-withoutCopyNumber] [-writable] string
file は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。
ファイルのオープン、インポート、エクスポート、参照、保存、名前の変更を行う このコマンドには、実行するアクションを指定するメイン フラグが 1 つ必要です。 一部のメイン フラグには、そのアクションを修正するオプションの 2 次フラグが続くものもあります。 メインフラグを以下に示します。| cr | ea | ean | ear | eas | er | esa | es |
| esn | ex | fr | i | ir | l | lr | |
| loc | ltf | mf | new | o | op | ot | pmt |
| r | rdi | rn | rr | rts | s | sa | sdx |
| st | stx | typ | uc | ur | w |
| f | lad | lad | lnr | rnn |
| ch | chn | con | exp | sh |
| dns | dr | gr | gl | gn | ns | rfn | rpr | sns | srf | shd | rnn |
| dns | dr | gr | gn | pr | ra | rdn | rnn | rpr | sns |
| f |
| ns | rpr |
| f | pr |
| f |
| f | rfn |
| amf | ch | chn | con | dr | err | ex | exn |
| exp | l | loc | ltf | mf | ns | op | ot |
| pmt | pns | r | rfn | rpl | rpr | rts | sdc |
| sh | sn | stx | typ | uc | w |
| rfn |
| un | shn | wcn |
| string | 大部分のアクションでは、指定したファイルの名前です。returnNewNodes フラグを使用すると、読み込まれたノードの名前を示す文字配列が返されます。 |
戻り値の型は照会モードでは照会フラグが基になります。
| ロング ネーム(ショート ネーム) | 引数型 | プロパティ | ||
|---|---|---|---|---|
-activeProxy(-ap) |
||||
|
||||
-anyModified(-amf) |
||||
|
||||
-buildLoadSettings(-bls) |
||||
|
||||
-command(-c) |
string string |
|||
|
||||
-constructionHistory(-ch) |
boolean |
|||
|
||||
-channels(-chn) |
boolean |
|||
|
||||
-copyNumberList(-cnl) |
||||
|
||||
-constraints(-con) |
boolean |
|||
|
||||
-cleanReference(-cr) |
string |
|||
|
||||
-editCommand(-ec) |
string |
|||
|
||||
-defaultExtensions(-de) |
boolean |
|||
|
||||
-defaultNamespace(-dns) |
||||
|
||||
-errorStatus(-err) |
||||
|
||||
-deferReference(-dr) |
boolean |
|||
|
||||
-exportAll(-ea) |
||||
|
||||
-exportAnim(-ean) |
||||
|
||||
-exportSelectedAnim(-eas) |
||||
|
||||
-exportAnimFromReference(
-ear) |
||||
|
||||
-exportAsReference(-er) |
||||
|
||||
-exportSelected(-es) |
||||
|
||||
-exportSelectedAnimFromReference(
-esa) |
||||
|
||||
-executeScriptNodes(-esn) |
boolean |
|||
|
||||
-exists(-ex) |
||||
|
||||
-expandName(-exn) |
||||
|
||||
-expressions(-exp) |
boolean |
|||
|
||||
-force(-f) |
||||
|
||||
-flushReference(-fr) |
string |
|||
|
||||
-groupLocator(-gl) |
||||
|
||||
-groupName(-gn) |
string |
|||
|
||||
-groupReference(-gr) |
||||
|
||||
-ignoreVersion(-iv) |
||||
|
||||
-lockReference(-lck) |
||||
|
||||
-lockFile(-lf) |
boolean |
|||
|
||||
-lockContainerUnpublished(
-lcu) |
boolean |
|||
|
||||
-import(-i) |
||||
|
||||
-importReference(-ir) |
||||
|
||||
-list(-l) |
||||
|
||||
-loadReferenceDepth(-lrd) |
string |
|||
|
||||
-mergeNamespacesOnClash(
-mnc) |
||||
|
||||
-loadAllDeferred(-lad) |
boolean |
|||
|
||||
-loadAllReferences(-lar) |
||||
|
||||
-loadNoReferences(-lnr) |
||||
|
||||
-location(-loc) |
||||
|
||||
-loadReference(-lr) |
string |
|||
|
||||
-loadSettings(-ls) |
string |
|||
|
||||
-lastTempFile(-ltf) |
||||
|
||||
-modified(-mf) |
boolean |
|||
|
||||
-newFile(-new) |
||||
|
||||
-namespace(-ns) |
string |
|||
|
||||
-open(-o) |
||||
|
||||
-options(-op) |
string |
|||
|
||||
-lastFileOption(-lfo) |
||||
|
||||
-prompt(-pmt) |
boolean |
|||
|
||||
-parentNamespace(-pns) |
||||
|
||||
-preserveReferences(-pr) |
||||
|
||||
-exportUnloadedReferences(
-eur) |
||||
|
||||
-preSaveScript(-prs) |
string |
|||
|
||||
-postSaveScript(-pos) |
string |
|||
|
||||
-proxyManager(-pm) |
string |
|||
|
||||
-proxyTag(-pt) |
string |
|||
|
||||
-reference(-r) |
||||
|
||||
-renameAll(-ra) |
boolean |
|||
|
||||
-referenceDepthInfo(-rdi) |
uint |
|||
|
||||
-referenceNode(-rfn) |
string |
|||
|
||||
-rename(-rn) |
string |
|||
|
||||
-returnNewNodes(-rnn) |
||||
|
||||
-renamingPrefixList(-rpl) |
||||
|
||||
-renamingPrefix(-rpr) |
string |
|||
|
||||
-removeReference(-rr) |
||||
|
||||
-renameToSave(-rts) |
boolean |
|||
|
||||
-save(-s) |
||||
|
||||
-saveReference(-sr) |
||||
|
||||
-compress(-cmp) |
||||
|
||||
-preserveName(-pn) |
||||
|
||||
-removeDuplicateNetworks(
-rdn) |
||||
|
||||
-resetError(-rer) |
||||
|
||||
-selectAll(-sa) |
||||
|
||||
-saveDiskCache(-sdc) |
string |
|||
|
||||
-shader(-sh) |
boolean |
|||
|
||||
-sharedNodes(-shd) |
string |
|||
|
||||
-shortName(-shn) |
||||
|
||||
-sceneName(-sn) |
||||
|
||||
-swapNamespace(-sns) |
string string |
|||
|
||||
-sharedReferenceFile(-srf) |
||||
|
||||
-saveReferencesUnloaded(
-sru) |
||||
|
||||
-strict(-str) |
boolean |
|||
|
||||
-saveTextures(-stx) |
string |
|||
|
||||
-type(-typ) |
string |
|||
|
||||
-uiConfiguration(-uc) |
boolean |
|||
|
||||
-usingNamespaces(-uns) |
||||
|
||||
-unresolvedName(-un) |
||||
|
||||
-unloadReference(-ur) |
string |
|||
|
||||
-writable(-w) |
||||
|
||||
-withoutCopyNumber(-wcn) |
||||
|
||||
-segment(-seg) |
string |
|||
|
||||
-activate(-a) |
||||
|
||||
-exportAsSegment(-exs) |
||||
|
||||
-exportSelectedNoReference(
-esr) |
||||
|
||||
-moveSelected(-ms) |
||||
|
||||
-applyTo(-at) |
string |
|||
|
||||
-mapPlaceHolderNamespace(
-mns) |
string string |
|||
|
||||
-replaceName(-rep) |
string string |
|||
|
||||
// save the current scene to an ascii file named "fred.ma"
//
file -rename "fred.ma"; file -save -type "mayaAscii";
// save the current scene to an ascii file without the ".ma" extension
//
file -rename "tmp"; file -save -de 0 -type "mayaAscii";
// open the file fred.ma, using the default load settings. Any references will
// be brought in in the same state they were in when fred.ma was last saved.
//
file -o "fred.ma";
// reference the file wilma.ma
//
file -r "C:/mystuff/wilma.mb";
// reference the file barney.mb into a namespace called "rubble".
//
file -r -type "mayaAscii" -namespace "rubble" "C:/maya/projects/default/scenes/barney.ma";
// change the namespace containing barney.mb.
//
file -e -namespace "purpleDinosaur" "C:/maya/projects/default/scenes/barney.ma";
// retrieve a string array of all files referenced in the scene
//
file -q -l;
// Result: C:/maya/projects/default/scenes/fred.ma C:/mystuff/wilma.mb C:/maya/projects/default/scenes/barney.ma
// Select "betty" and export betty to a separate file called "betty.mb".
// Reference the new betty file into this scene, replacing the
// previous betty object from this scene with the reference to betty.
//
file -type "mayaBinary" -namespace "rubble" -er "c:/mystuff/betty.mb";
// Select all the objects associated with file betty.mb
//
file -sa "c:/mystuff/betty.mb";
// Result: rubble:betty
// Remove the reference file betty.mb. All nodes in betty.mb will
// be removed from the scene
file -rr "c:/mystuff/betty.mb";
// Query whether the file named "foo.mb" exists on disk
//
file -q -ex "foo.mb";
// Result: 0 //
// Query whether the reference node "rubble:betty is deferred loaded.
// Note, -rfn flag has to come before -q flag.
file -rfn rubble:betty -q -dr;
// Query the last temp file during file save
//
file -q -lastTempFile;
/////////////////////////////////////////////////////////////////////////
/// Example for the '-buildLoadSettings' and '-loadSettings' flags ///
/////////////////////////////////////////////////////////////////////////
// Build load settings for "ref.ma"
file -o -buildLoadSettings "ref.ma"
// Edit those settings, to indicate that some reference should
// be brought in unloaded.
// Note: the following command is primarily intended for internal
// use. It may not be easy to determine the numeric ID of a given
// reference ("2" in this case) .
file -loadSettings -e -deferReference 1 "2"
// Use the edited settings when opening the file
file -o -loadSettings "implicitLoadSettings" "ref.ma";
/////////////////////////////////////////////////////////////////////////
/// Example for the '-cleanReference' and '-editCommand' flags ///
/////////////////////////////////////////////////////////////////////////
// Create a simple reference to a sphere
//
file -f -new;
polySphere;
file -rename "ref.ma";
file -f -type "mayaAscii" -save;
file -f -new;
file -r -ns "ref" "ref.ma";
// Scale the sphere
//
setAttr ref:pSphere1.s 5 5 5;
getAttr ref:pSphere1.s;
// Result: 5 5 5 //
// The 'cleanReference' and 'editCommand' flags only work on
// unloaded references.
//
file -unloadReference "refRN";
// Query the setAttr edits:
//
reference -rfn "refRN" -q -editCommand;
// Result: setAttr ref:pSphere1.s -type "double3" 5 5 5 setAttr ref:lightLinker1.lnk -s 2 //
// Remove all setAttr edits on refRN:
//
file -cleanReference "refRN" -editCommand "setAttr";
reference -rfn "refRN" -q -editCommand;
// Note that nothing is returned
file -loadReference "refRN";
getAttr ref:pSphere1.s;
// Result: 1 1 1 //
// Note that scale has returned to 1 1 1
// apply the edit file to a reference
file -r -applyTo "refRN" "translateSphere.editMA";
// Result: maps <main> to refRN's namespace
// apply the edit file to nodes in the main scene
file -i -applyTo ":" "translateSphere.editMA";
// Result: maps <main> to the root namespace
// apply the edit file to a reference, but it also has connections between two refs
file -r -applyTo "refRN" -mapPlaceholderNamespace "<otherRef>" "otherRefRN" "connectionsBetweenRefs.editMA";
// Result: maps <main> to refRN's namespace and <otherRef> to otherRefRN's namespace
// Change the modified state of the file.
file -modified true;