tbaypaul
01-27-2007, 01:03 AM
I have created a folder called python in my maya user directory.
I have created a python path to it in my Maya.env.
I have my userSetup.py importing the maya.cmds on start up.
In my python folder I have the ubiquious helloWorld.py from Cory's blog on the area.
import maya.cmds as mc
def helloMaya():
'''a simple function to say hello maya. a user will see
whatever you put here when they ask for help on the function '''
print 'hello maya!'
From the maya docs I understand that to mimic the mel global behavior you import the file and call the def as a function.......eg
import helloWorld
helloWorld.helloWorld()
results in.....
# ImportError: No module named helloWorld #
# NameError: name 'helloWorld' is not defined #
the bonus tools house generator python script generated this echo when the command is
selected in the interface menu
python "from houseGenerator import *";python "houseGenerator()";
from houseGenerator import*
houseGenerator()
I have created a python path to it in my Maya.env.
I have my userSetup.py importing the maya.cmds on start up.
In my python folder I have the ubiquious helloWorld.py from Cory's blog on the area.
import maya.cmds as mc
def helloMaya():
'''a simple function to say hello maya. a user will see
whatever you put here when they ask for help on the function '''
print 'hello maya!'
From the maya docs I understand that to mimic the mel global behavior you import the file and call the def as a function.......eg
import helloWorld
helloWorld.helloWorld()
results in.....
# ImportError: No module named helloWorld #
# NameError: name 'helloWorld' is not defined #
the bonus tools house generator python script generated this echo when the command is
selected in the interface menu
python "from houseGenerator import *";python "houseGenerator()";
from houseGenerator import*
houseGenerator()
