Go to: Return value. Related commands. Flags. Examples.

Synopsis

workspace [flags] [workspaceName]

Create, open, or edit a workspace associated with a given workspace file. If no workspaceFile is specified then the current workspace is assumed.

Return value

Dependent upon the requested action/query. Possible return types are: string, string array and none.

Related commands

pwd, chdir, translator

Flags

active, baseWorkspace, create, directory, expandName, fileRule, fileRuleEntry, fileRuleList, fullName, list, listFullWorkspaces, listWorkspaces, newWorkspace, objectType, objectTypeEntry, objectTypeList, openWorkspace, projectPath, renderType, renderTypeEntry, renderTypeList, rootDirectory, saveWorkspace, shortName, update, updateAll, variable, variableEntry, variableList

Long name (short name)[argument types]Properties
-newWorkspace (-n) create
This specifies that a new workspace is being created. If a workspace with this name already exists, the command will fail.
-openWorkspace (-o) querycreate
Open the workspace. The workspace becomes the current workspace.
-active (-act) querycreate
This flag is a synonym for -o/openWorkspace.
-saveWorkspace (-s) createedit
Save the workspace. Workspaces are normally saved when Maya exits but this flag will make sure that the data is flushed to disk.
-baseWorkspace (-bw) queryedit
A workspace may be based on another workspace. This means that all the settings in the base workspace apply to this workspace unless they are explicitly overridden.
-listWorkspaces (-lw) querycreateedit
Returns a list of all the currently defined workspace names.
-listFullWorkspaces (-lfw) querycreateedit
Returns a list of the full path names of all the currently defined workspaces.
-list (-l) querycreateedit
This option will list the current workspace directory. If a path is specified for the "workspaceFile" then the contents of that directory will be listed. Otherwise, the contents of the directory set with the -dir flag will be listed.
-directory (-dir) querycreateedit
This option will set the current workspace directory to the path specified. When queried it will return the current workspace directory. This directory is used as an initial directory for the fileBrowser and is part of the search path used for locating files. It should not be confused with the current working directory as used by the pwd and chdir commands.
-create (-cr) newDirectorycreateedit
Create a new directory. If the directory name is not a full path name, it will be created as a subdirectory of the "current" directory set with the -dir flag.
-rootDirectory (-rd) querycreate
Returns the root directory of the workspace.
-objectType (-ot) objectType locationquerycreateedit
Set/query the default location for a file. The parameters to set a type are the type name and the location. The only objectType automatically defined by Maya is "scene". When queried, it returns a list of strings. The elements of the list alternate between objectType names and the corresponding location.
-objectTypeList (-otl) querycreateedit
Returns a list of the currently defined object types.
-objectTypeEntry (-ote) objectTypequerycreateedit
Return the location for the objectType.
-fileRule (-fr) fileRule locationquerycreateedit
Set the default location for a file. The parameters are the fileRule (dxf, iges, etc) and the location. When queried, it returns a list of strings. The elements of the list alternate between fileRule names and the corresponding location. There is typically one file rule for each available translator.
-fileRuleList (-frl) querycreateedit
Returns a list of the currently defined file rules.
-fileRuleEntry (-fre) fileRulequerycreateedit
Return the location for the fileRule.
-renderType (-rt) renderType locationquerycreateedit
Set the default location for a render file. Available types are: depth, images, iprImages, lights, renderScenes, sourceImages, and textures. When queried, it returns a list of strings. The elements of the list alternate between renderType names and the corresponding location.
-renderTypeList (-rtl) querycreateedit
Return a list of all the available render types.
-renderTypeEntry (-rte) renderType.querycreateedit
Return the location for the renderType.
-variable (-v) string stringquerycreateedit
Set/query the value of a project variable. Project variables are used when expanding names. See the -en/expandName flag below.
-variableList (-vl) querycreateedit
Return a list of all the available variables.
-variableEntry (-ve) variablequerycreateedit
Return the value of the variable
-shortName (-sn) querycreate
Query the short name of the workspace.
-fullName (-fn) querycreate
Return the full name of the workspace.
-expandName (-en) stringquerycreate
Query for the full path location of a the filename name. The name may be a project relative file name, or a full path name. If the name is an empty string, the return value will be the project directory. The return value is always a full path name.
-projectPath (-pp) filePathquerycreate
Convert filePath to a filename that is relative to the project root directory (if possible) and return it. If the filePath is not under the project root directory, a full path name will be returned.
-update (-u) create
This flag reads all the workspace definitions from the project directory. It is used by Maya at startup time to find the avaiable workspaces.
-updateAll (-ua) create
This flag is a synonym for -u/update.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command

Examples

		// Set the current workspace to "alphabet".
		workspace -o alphabet;

		// Save the currently workspace settings (for "alphabet").
		workspace -s;

		// Create a new Workspace named "newWorkspace".
		workspace -n newWorkspace;
  
		// Find the current workspace area.
		workspace -q -dir;
  	// 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 -dir;
  	// Result : /h/userName/maya/projects/default

  	workspace -dir "/h/userName/maya/projects/commercial";
  	pwd;
  	// Result : /tmp