Skip to content

Error Codes ​

Maya can localize maya.cmds exception messages based on the OS or Maya UI language. Tool envelopes therefore include stable, locale-independent fields where possible:

json
{
  "success": false,
  "message": "Python execution failed",
  "error": "TypeError('必须为标志「allObjects」传递一个布尔参数')",
  "error_code": "ARG_TYPE_MISMATCH",
  "error_type": "TypeError"
}

Agents should branch on error_code and keep the localized error string for human display.

CodeMeaning
ARG_TYPE_MISMATCHA Maya command flag or argument has the wrong type.
NODE_NOT_FOUNDA referenced Maya node does not exist.
ATTRIBUTE_NOT_FOUNDA referenced node attribute does not exist.
LOCKED_ATTRIBUTEA target attribute is locked or connected.
VERSION_MISMATCHA file, plug-in, or command requires a different Maya/API version.
PLUGIN_NOT_LOADEDA required Maya plug-in is not loaded.
FILE_NOT_FOUNDA required file path does not exist.
PERMISSION_DENIEDThe process cannot read or write the requested path/resource.
UNDO_LOCKEDThe operation is blocked by Maya undo-state restrictions.
EXECUTION_TIMEOUTScript execution exceeded its timeout.
UNKNOWNNo stable classifier matched; inspect error_type and error.

maya_scripting__execute_python also returns context.kind == "tool-timeout" with context.elapsed_secs when its cooperative timeout trips.

Released under the MIT License.