Go to: Synopsis. Return value. Flags. Python examples.

Synopsis

internalVar([mayaInstallDir=boolean], [userAppDir=boolean], [userBitmapsDir=boolean], [userHotkeyDir=boolean], [userMarkingMenuDir=boolean], [userPrefDir=boolean], [userPresetsDir=boolean], [userScriptDir=boolean], [userShelfDir=boolean], [userTmpDir=boolean], [userWorkspaceDir=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

internalVar is undoable, NOT queryable, and NOT editable.

This command returns the values of internal variables. No modification of these variables is supported.

Return value

stringThe value of the variable specified by the flag use.

Flags

mayaInstallDir, userAppDir, userBitmapsDir, userHotkeyDir, userMarkingMenuDir, userPrefDir, userPresetsDir, userScriptDir, userShelfDir, userTmpDir, userWorkspaceDir
Long name (short name) Argument types Properties
mayaInstallDir(mid) boolean create
Return the Maya installation directory.
userAppDir(uad) boolean create
Return the user application directory.
userBitmapsDir(ubd) boolean create
Return the user bitmaps prefs directory.
userHotkeyDir(uhk) boolean create
Return the user hotkey directory.
userMarkingMenuDir(umm) boolean create
Return the user marking menu directory.
userPrefDir(upd) boolean create
Return the user preference directory.
userPresetsDir(ups) boolean create
Return the user presets directory.
userScriptDir(usd) boolean create
Return the user script directory.
userShelfDir(ush) boolean create
Return the user shelves directory.
userTmpDir(utd) boolean create
Return a temp directory. Will check for TMPDIR environment variable, otherwise will return the current directory.
userWorkspaceDir(uwd) boolean create
Return the user workspace directory (also known as the projects directory).

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 have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

myScriptDir = cmds.internalVar(userScriptDir=True)