Olarn's DevBlog
Shorthand for importing standard maya command modules.
Bantukul Olarn
    
Nov 05 2016 15:38
  

Shorthand for importing standard maya command modules.

Maya cmds and pymel command module are traditionally imported in every script by statement such as:

import maya.cmds as cmds
import pymel.core as pm
import pymel.core.nodetypes as nodetypes
import maya.OpenMaya
## and so on..

However, using a single import all statement

from pymel.all import *

Will import all pymel wrapped python command, pymel nodetypes ui types, pymel utilities and vanilla Maya "cmds" module to global variable scope in a single statement.

Moreover, it is also possible to import all such module to global variable scope automatically every startup to avoid having to write standard import statement over and over by placing all custom import statement(including the aforementioned pymel.all) to userSetup.py under any of the MAYA_SCRIPT_PATH folder.

Tags: