2

I want to know if there is any difference between:

import maya.cmds as cmds
cmds.polyCube()

and

from maya import cmds
cmds.polyCube()
Di Wang
  • 471
  • 1
  • 8
  • 22

1 Answers1

2

In the current context there's no difference between import maya.cmds as cmds and from maya import cmds. Look at this SO post dated 2009 to know about possible pros and cons.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • 1
    That old post is about a slightly different question, it would be more like the difference between running "from maya.cmds import polyCube; polyCube()" and "from maya import cmds; cmds.polyCube()" (I would def use the latter). As far as I understand there is no difference, although I just had a big argument with bard, which was claiming that "from maya.cmds import cmds" is better, with a long list of made up reasons that didn't make sense. – ninhenzo64 May 18 '23 at 14:20