Say I have a python shell that knows absolutely 0% about Maya and I run
import sys
sys.path.append("path/to/maya2016/pythonX.X/site-packages")
import maya.cmds as cmds
cmds.file("some/file/path/foo.ma, o=True)
that should open a maya file but in linux, I get the following error:
AttributeError: ‘module’ object has no attribute ‘file’
Running the following:
import inspect
inspect.getmembers(cmds, inspect.isfunction)
returns [], which means that the module imported with no methods (aka, I did it incorrectly or something else is amiss)
I get the same problem in windows. I navigated to the actual maya/cmds folder and it only has an empty init.py inside of it so my question is how does Maya actually load its own modules and how can I take advantage of that so I can properly import maya.cmds from outside of the Maya GUI?