ジャンプ先: 概要. 戻り値. 関連. フラグ. MEL 例.
file [-activate] [-activeProxy] [-add] [-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] [-loadReferencePreview string] [-loadSettings string] [-location] [-lockContainerUnpublished boolean] [-lockFile boolean] [-lockReference] [-mapPlaceHolderNamespace string string] [-mergeNamespaceWithParent] [-mergeNamespaceWithRoot] [-mergeNamespacesOnClash] [-modified boolean] [-moveSelected] [-namespace string] [-newFile] [-open] [-options string] [-parentNamespace] [-postSaveScript string] [-preSaveScript string] [-preserveName] [-preserveReferences] [-preview] [-prompt boolean] [-proxyManager string] [-proxyTag string] [-reference] [-referenceDepthInfo uint] [-referenceNode string] [-relativeNamespace 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 は、取り消し可能、照会可能、および編集可能です。
cr | ea | ean | ear | eas | er | esa | es |
esn | ex | fr | i | ir | l | lr | lrp |
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 | mnc | ns | rfn | rpr | sns | srf | shd | rnn |
dns | dr | gr | gn | mnc | 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 フラグを使用すると、読み込まれたノードの名前を示す文字配列が返されます。 |
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
---|---|---|---|---|
-activate(-a)
|
|
|||
|
||||
-activeProxy(-ap)
|
|
|||
|
||||
-add(-add)
|
|
|||
|
||||
-anyModified(-amf)
|
|
|||
|
||||
-applyTo(-at)
|
string
|
|||
|
||||
-buildLoadSettings(-bls)
|
|
|||
|
||||
-channels(-chn)
|
boolean
|
|||
|
||||
-cleanReference(-cr)
|
string
|
|||
|
||||
-command(-c)
|
string string
|
|||
|
||||
-compress(-cmp)
|
|
|||
|
||||
-constraints(-con)
|
boolean
|
|||
|
||||
-constructionHistory(-ch)
|
boolean
|
|||
|
||||
-copyNumberList(-cnl)
|
|
|||
|
||||
-defaultExtensions(-de)
|
boolean
|
|||
|
||||
-defaultNamespace(-dns)
|
|
|||
|
||||
-deferReference(-dr)
|
boolean
|
|||
|
||||
-editCommand(-ec)
|
string
|
|||
|
||||
-errorStatus(-err)
|
|
|||
|
||||
-executeScriptNodes(-esn)
|
boolean
|
|||
|
||||
-exists(-ex)
|
|
|||
|
||||
-expandName(-exn)
|
|
|||
|
||||
-exportAll(-ea)
|
|
|||
|
||||
-exportAnim(-ean)
|
|
|||
|
||||
-exportAnimFromReference(-ear)
|
|
|||
|
||||
-exportAsReference(-er)
|
|
|||
|
||||
-exportAsSegment(-exs)
|
|
|||
|
||||
-exportSelected(-es)
|
|
|||
|
||||
-exportSelectedAnim(-eas)
|
|
|||
|
||||
-exportSelectedAnimFromReference(-esa)
|
|
|||
|
||||
-exportSelectedNoReference(-esr)
|
|
|||
|
||||
-exportUnloadedReferences(-eur)
|
|
|||
|
||||
-expressions(-exp)
|
boolean
|
|||
|
||||
-flushReference(-fr)
|
string
|
|||
|
||||
-force(-f)
|
|
|||
|
||||
-groupLocator(-gl)
|
|
|||
|
||||
-groupName(-gn)
|
string
|
|||
|
||||
-groupReference(-gr)
|
|
|||
|
||||
-ignoreVersion(-iv)
|
|
|||
|
||||
-import(-i)
|
|
|||
|
||||
-importReference(-ir)
|
|
|||
|
||||
-lastFileOption(-lfo)
|
|
|||
|
||||
-lastTempFile(-ltf)
|
|
|||
|
||||
-list(-l)
|
|
|||
|
||||
-loadAllDeferred(-lad)
|
boolean
|
|||
|
||||
-loadAllReferences(-lar)
|
|
|||
|
||||
-loadNoReferences(-lnr)
|
|
|||
|
||||
-loadReference(-lr)
|
string
|
|||
|
||||
-loadReferenceDepth(-lrd)
|
string
|
|||
|
||||
-loadReferencePreview(-lrp)
|
string
|
|||
|
||||
-loadSettings(-ls)
|
string
|
|||
|
||||
-location(-loc)
|
|
|||
|
||||
-lockContainerUnpublished(-lcu)
|
boolean
|
|||
|
||||
-lockFile(-lf)
|
boolean
|
|||
|
||||
-lockReference(-lck)
|
|
|||
|
||||
-mapPlaceHolderNamespace(-mns)
|
string string
|
|||
|
||||
-mergeNamespaceWithParent(-mnp)
|
|
|||
|
||||
-mergeNamespaceWithRoot(-mnr)
|
|
|||
|
||||
-mergeNamespacesOnClash(-mnc)
|
|
|||
|
||||
-modified(-mf)
|
boolean
|
|||
|
||||
-moveSelected(-ms)
|
|
|||
|
||||
-namespace(-ns)
|
string
|
|||
|
||||
-newFile(-new)
|
|
|||
|
||||
-open(-o)
|
|
|||
|
||||
-options(-op)
|
string
|
|||
|
||||
-parentNamespace(-pns)
|
|
|||
|
||||
-postSaveScript(-pos)
|
string
|
|||
|
||||
-preSaveScript(-prs)
|
string
|
|||
|
||||
-preserveName(-pn)
|
|
|||
|
||||
-preserveReferences(-pr)
|
|
|||
|
||||
-preview(-pv)
|
|
|||
|
||||
-prompt(-pmt)
|
boolean
|
|||
|
||||
-proxyManager(-pm)
|
string
|
|||
|
||||
-proxyTag(-pt)
|
string
|
|||
|
||||
-reference(-r)
|
|
|||
|
||||
-referenceDepthInfo(-rdi)
|
uint
|
|||
|
||||
-referenceNode(-rfn)
|
string
|
|||
|
||||
-relativeNamespace(-rns)
|
string
|
|||
|
||||
-removeDuplicateNetworks(-rdn)
|
|
|||
|
||||
-removeReference(-rr)
|
|
|||
|
||||
-rename(-rn)
|
string
|
|||
|
||||
-renameAll(-ra)
|
boolean
|
|||
|
||||
-renameToSave(-rts)
|
boolean
|
|||
|
||||
-renamingPrefix(-rpr)
|
string
|
|||
|
||||
-renamingPrefixList(-rpl)
|
|
|||
|
||||
-replaceName(-rep)
|
string string
|
|||
|
||||
-resetError(-rer)
|
|
|||
|
||||
-returnNewNodes(-rnn)
|
|
|||
|
||||
-save(-s)
|
|
|||
|
||||
-saveDiskCache(-sdc)
|
string
|
|||
|
||||
-saveReference(-sr)
|
|
|||
|
||||
-saveReferencesUnloaded(-sru)
|
|
|||
|
||||
-saveTextures(-stx)
|
string
|
|||
|
||||
-sceneName(-sn)
|
|
|||
|
||||
-segment(-seg)
|
string
|
|||
|
||||
-selectAll(-sa)
|
|
|||
|
||||
-shader(-sh)
|
boolean
|
|||
|
||||
-sharedNodes(-shd)
|
string
|
|||
|
||||
-sharedReferenceFile(-srf)
|
|
|||
|
||||
-shortName(-shn)
|
|
|||
|
||||
-strict(-str)
|
boolean
|
|||
|
||||
-swapNamespace(-sns)
|
string string
|
|||
|
||||
-type(-typ)
|
string
|
|||
|
||||
-uiConfiguration(-uc)
|
boolean
|
|||
|
||||
-unloadReference(-ur)
|
string
|
|||
|
||||
-unresolvedName(-un)
|
|
|||
|
||||
-usingNamespaces(-uns)
|
|
|||
|
||||
-withoutCopyNumber(-wcn)
|
|
|||
|
||||
-writable(-w)
|
|
|||
|
フラグはコマンドの作成モードで表示できます | フラグはコマンドの編集モードで表示できます |
フラグはコマンドの照会モードで表示できます | コマンド内でフラグを複数回使用できます。 |
// 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 -defaultExtensions 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 -open "fred.ma"; // reference the file wilma.mb // file -reference "C:/mystuff/wilma.mb"; // get the name of the reference node for wilma.mb file -q -referenceNode "C:/mystuff/wilma.mb" // Result: wilmaRN // // does the wilmaRN reference node represent a deferred reference? file -referenceNode wilmaRN -q -deferReference; // Result: 0 // // reference the file barney.mb into a namespace called "rubble". // file -reference -type "mayaAscii" -namespace "rubble" "C:/maya/projects/default/scenes/barney.ma"; // change the namespace containing barney.mb. // file -edit -namespace "purpleDinosaur" "C:/maya/projects/default/scenes/barney.ma"; // retrieve a string array of all files such as main scene and reference files in the scene // file -query -list; // 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" -exportAsReference "c:/mystuff/betty.mb"; // Select all the objects associated with file betty.mb // file -selectAll "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 -removeReference "c:/mystuff/betty.mb"; // Query whether the file named "foo.mb" exists on disk // file -query -exists "foo.mb"; // Result: 0 // // Query whether the reference node "rubble:betty is deferred loaded. // Note, -referenceNode flag has to come before -query flag. file -referenceNode rubble:betty -query -deferReference; // Query the last temp file during file save // file -query -lastTempFile; ///////////////////////////////////////////////////////////////////////// /// Example for the '-buildLoadSettings' and '-loadSettings' flags /// ///////////////////////////////////////////////////////////////////////// // Build load settings for "ref.ma" file -open -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 -edit -deferReference 1 "2" // Use the edited settings when opening the file file -open -loadSettings "implicitLoadSettings" "ref.ma"; ///////////////////////////////////////////////////////////////////////// /// Example for the '-cleanReference' and '-editCommand' flags /// ///////////////////////////////////////////////////////////////////////// // Create a simple reference to a sphere // file -force -new; polySphere; file -rename "ref.ma"; file -force -type "mayaAscii" -save; file -force -new; file -reference -namespace "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 -referenceNode "refRN" -query -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 -referenceNode "refRN" -query -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 -reference -applyTo "refRN" "translateSphere.editMA"; // Result: maps <main> to refRN's namespace // apply the edit file to nodes in the main scene file -import -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 -reference -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; //Set the file options file -force -save -options "v=1;p=17" -type "mayaAscii"; //Result:The saved file uses full names for attributes on nodes and flags in command.Also the precision of values in file is 17. // Load Reference Preview // Create a nested reference with a child reference under a parent reference. file -force -new; polySphere; file -rename "child.ma"; file -force -type "mayaAscii" -save; file -force -new; file -reference -namespace "child_namespace" "child.ma"; file -rename "parent.ma"; file -force -type "mayaAscii" -save; // Preview the unloaded child reference under the unloaded parent reference. file -force -new; file -reference -namespace "parent_namespace" "parent.ma"; file -unloadReference "parent_namespaceRN"; file -loadReferencePreview "parent.ma"; // // Example for '-mergeNamespacesOnClash' // // Create a reference file -force -new; namespace -add "bar"; namespace -set "bar"; polySphere; file -rename "ref.ma"; file - force -type "mayaAscii" -save; // Create a scene with some namespaces and objects file -force -new; namespace -add "ref:foo:bar"; namespace -set "ref:foo:bar"; polySphere; // Merge into root file -reference -mergeNamespacesOnClash true -namespace ":" "ref.ma"; // Import and merge into nested namespace file -import -mergeNamespacesOnClash true -namespace ":ref:foo" "ref.ma"; // Don't merge namespace file -reference -mergeNamespacesOnClash false -namespace ":ref:foo" "ref.ma"; // Now edit the namespace of the reference and merge it file -edit -mergeNamespacesOnClash true -namespace ":ref:foo" "ref.ma"; ///////////////////////////////////////////////////////////////////////// /// Example for export with relativeNamespace /// ///////////////////////////////////////////////////////////////////////// // Create a scene with the following namespace structure: // :A:sphereA // :A:B:sphereB // :A:B:C:sphereC // :D:sphereC // file -f -new; sphere -n ":A:sphereA"; sphere -n ":A:B:sphereB"; sphere -n ":A:B:C:sphereC"; sphere -n ":D:sphereD"; // Select all the spheres. // select -r ":A:sphereA"; select -add ":A:B:sphereB"; select -add ":A:B:C:sphereC"; select -add ":D:sphereD"; // Export all these spheres with -relativeNamespace flag. // file -force -relativeNamespace ":A:B" -typ "mayaAscii" -exportSelected "exp.ma"; // The result in the exported file: // :A:sphereA // :C:sphereC // :D:sphereD // :sphereB //