Workspaces

Maya Workspace

getCurrentMayaWorkspace()

Returns the current project directory

Return projectDirectoryPath:

the path of the current Maya project directory

Rtype projectDirectoryPath:

str

getProjSubDirectory(sudDirectory='scenes', message=True)

Returns the path of the current Maya project sub directory Eg:

/scenes/ or /sourceImages/ etc

Note: If not found will default to the home directory of your OS.

Parameters:
  • sudDirectory (str) – The subDirectory of the project directory, can be multiple directories deep

  • message (bool) – Warn the user if the path wasn’t found?

Return directoryPath:

The path of the directory

Rtype directoryPath:

str

switchWorkspace(path)

Switch workspace to path. Displays a message box before showing.

If it’s the same workspace, nothing will happen.

Parameters:

path

Returns:

findWorkspaceFromScene(path, maxDepth=999)

Find workspace from maya scene path

“C:/maya_project/scenes/hello.ma” -> “C:/maya_project/”

Parameters:

path

Returns:

setProject(path)

Sets the maya project to path.

Parameters:

path

Returns: