ジャンプ先: 概要. 戻り値. 関連. フラグ. MEL 例.
 workspace [-active] [-baseWorkspace string] [-create string] [-directory string] [-expandName string] [-fileRule string string] [-fileRuleEntry string] [-fileRuleList] [-filter] [-fullName] [-list] [-listFullWorkspaces] [-listWorkspaces] [-newWorkspace] [-objectType string string] [-objectTypeEntry string] [-objectTypeList] [-openWorkspace] [-projectPath string] [-removeFileRuleEntry string] [-removeVariableEntry string] [-renderType string string] [-renderTypeEntry string] [-renderTypeList] [-rootDirectory] [-saveWorkspace] [-shortName] [-update] [-updateAll] [-variable string string] [-variableEntry string] [-variableList] 
[string]
      
workspace は、取り消し可能、照会可能、および編集不可能です。
指定したワークスペース ファイルに従って、ワークスペースを生成したり、開いたり、編集したりします。 この文字列引数はワークスペースを表します。ワークスペースが指定されていない場合、現在のワークスペースが指定されたものとみなされます。 ワークスペースは Maya プロジェクトの基本となる定義を提供します。各プロジェクトには workspace.mel という関連付けされたワークスペース ファイルがあり、プロジェクトのルート ディレクトリに保存されています。ワークスペース ファイルは、ファイル タイプをルート ディレクトリに対して相対的または絶対的な保存場所にマップする一連の規則を定義します。この規則は、実行時にファイル パスを解決する際に使用されます。 ワークスペース コマンドは、定義の基本ファイルへの読出し、変更、保存時には、ワークスペースの低レベルの定義で直接動作します。このコマンドを使用する必要はほとんどありません。通常は、プロジェクト定義の変更はユーザ インタフェースのプロジェクト ウィンドウを介して行うことをお勧めします。| string | |
| string[] | 
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
| ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
|---|---|---|---|---|
| -newWorkspace(-n) |  |   | ||
| 
 | ||||
| -openWorkspace(-o) |  |    | ||
| 
 | ||||
| -active(-act) |  |    | ||
| 
 | ||||
| -saveWorkspace(-s) |  |   | ||
| 
 | ||||
| -baseWorkspace(-bw) | string |   | ||
| 
 | ||||
| -listWorkspaces(-lw) |  |    | ||
| 
 | ||||
| -listFullWorkspaces(-lfw) |  |    | ||
| 
 | ||||
| -list(-l) |  |    | ||
| 
 | ||||
| -directory(-dir) | string |    | ||
| 
 | ||||
| -create(-cr) | string |   | ||
| 
 | ||||
| -rootDirectory(-rd) |  |   | ||
| 
 | ||||
| -objectType(-ot) | string string |    | ||
| 
 | ||||
| -objectTypeList(-otl) |  |    | ||
| 
 | ||||
| -objectTypeEntry(-ote) | string |    | ||
| 
 | ||||
| -fileRule(-fr) | string string |    | ||
| 
 | ||||
| -fileRuleList(-frl) |  |    | ||
| 
 | ||||
| -fileRuleEntry(-fre) | string |    | ||
| 
 | ||||
| -removeFileRuleEntry(-rfr) | string |   | ||
| 
 | ||||
| -renderType(-rt) | string string |    | ||
| 
 | ||||
| -renderTypeList(-rtl) |  |    | ||
| 
 | ||||
| -renderTypeEntry(-rte) | string |    | ||
| 
 | ||||
| -variable(-v) | string string |    | ||
| 
 | ||||
| -variableList(-vl) |  |    | ||
| 
 | ||||
| -variableEntry(-ve) | string |    | ||
| 
 | ||||
| -removeVariableEntry(-rve) | string |   | ||
| 
 | ||||
| -shortName(-sn) |  |    | ||
| 
 | ||||
| -fullName(-fn) |  |    | ||
| 
 | ||||
| -expandName(-en) | string |    | ||
| 
 | ||||
| -projectPath(-pp) | string |    | ||
| 
 | ||||
| -update(-u) |  |   | ||
| 
 | ||||
| -updateAll(-ua) |  |   | ||
| 
 | ||||
| -filter(-f) |  | |||
| 
 | ||||
|  フラグはコマンドの作成モードで表示できます |  フラグはコマンドの編集モードで表示できます | 
|  フラグはコマンドの照会モードで表示できます |  コマンド内でフラグを複数回使用できます。 | 
// Set the current workspace to "alphabet"
workspace -openWorkspace alphabet;
/ Save the current workspace settings (for "alphabet").
workspace -saveWorkspace;
// Create a new workspace named "newWorkspace".
workspace -newWorkspace newWorkspace;
// The settings of "newWorkspace" are based on "default" workspace
workspace -baseWorkspace default;
// Return the list of existing workspaces
workspace -listWorkspaces ;
// Result: default   newWorkspace
// Add a scriptJob to run on workspaceChanged events
global proc workspaceChangedCallback()
{
    print "My workspaceChangedCallback was called";
}
int $workspaceChangedID = `scriptJob -event workspaceChanged workspaceChangedCallback`;
// add a file rule to the current workspace
workspace -fileRule "newFileRuleName" "newFileRuleValue";
My workspaceChangedCallback was called            //workspaceChangedCallback was called
// look up the value of the file rule entry
workspace -q -fileRuleEntry "newFileRuleName";
// Result: newFileRuleValue
// remove specified file rule entry
workspace -removeFileRuleEntry "newFileRuleName";
My workspaceChangedCallback was called            //workspaceChangedCallback is called
// kill the scriptJob with the number
scriptJob -kill $workspaceChangedID;
// The following example shows how to expand environment and workspace variables
// expand a path value to be a full path relative to the project directory
// relative path example
workspace -expandName "relativePathName";
// Result: /h/userName/maya/projects/newWorkspace/relativePathName/
// full path example
workspace -expandName "/h/userName/maya/projects/default/";
// Result: /h/userName/maya/projects/default/
// The following examples show various formats for expanding workspace and
// environment variables
// add a variable to the current workspace
workspace -variable "newVariableName" "newVariableValue";
workspace -expandName "%newVariableName%";
// Result: /h/userName/maya/projects/newWorkspace/newVariableValue/
// add an environment variable
putenv "newEnvVariableName" "newEnvVariableValue";
workspace -expandName "%newEnvVariableName%";
// Result: /h/userName/maya/projects/newWorkspace/newEnvVariableValue/
// The following example shows how conflicting names in both workspace
// and environment variables are resolved.
// Add an environment variable with the same as the workspace variable
putenv "newVariableName" "newEnvVariableValue"
// maya considers workspace variables first before matching environment variables
workspace -expandName "%newVariableName%";
// Result: /h/userName/maya/projects/newWorkspace/newVariableValue/
// However when a tilde is used, maya will only consider the environment varible, not
// the workspace variable.
workspace -expandName "~%newVariableName%";
// Result: /h/userName/maya/projects/newWorkspace/~newEnvVariableValue/
// The following example shows how to set multiple paths into a fileRule value
workspace -fileRule 'newMultiPathFileRuleName' '/h/userName/maya/projects/default;newFileRuleValue';
string $multipath = `workspace -q -fileRuleEntry 'newMultiPathFileRuleName'`;
// Result : /h/userName/maya/projects/default;newFileRuleValue
// The following will only return the first expanded path.
workspace -expandName $multipath;
// Result : /h/userName/maya/projects/default
// Note that white space at the beginning and the end of each path is significant
// Add a file rule that uses multiple paths with the white space at the beginning and the end
// of each path
workspace -fileRule 'newMultiPathFileRuleName' ' /h/userName/maya/projects/default ; newFileRuleValue ';
// Querying and expanding the path value shows the white space is still included
string $multipath = `workspace -q -fileRuleEntry 'newMultiPathFileRuleName'`;
// Result :  /h/userName/maya/projects/default ; newFileRuleValue
// Find the current workspace area.
workspace -q -directory;
// Result : /h/userName/maya/projects/default
// Note that the "current working directory" as defined by the
// 'pwd' and 'chdir' commands is unrelated to the directories
// used by the workspace command.
//
pwd;
// Result : /usr/tmp
chdir "/tmp";
pwd;
// Result : /tmp
workspace -q -directory;
// Result : /h/userName/maya/projects/default
workspace -directory "/h/userName/maya/projects/commercial";
pwd;
// Result : /tmp