Beispiel #1
0
def executeScript(scriptName, module=None):
	if module == None: module = mayaWindow.findChild(QtGui.QDialog, scriptName)
	if module == None:
		importStatement = main.getPyFileFullImportName(sToolFileName)
		module = importlib.import_module(importStatement)

	scriptFunctions = inspector.getModFunctions(module)
	for sf in scriptFunctions:
		if (sf == "run") or (sf.lower() == (scriptName.lower() + "run")):
			getattr(module, sf)()
Beispiel #2
0
def openTool(toolName, module=None):
	if module == None: module = mayaWindow.findChild(QtGui.QDialog, toolName)
	if module == None:
		importStatement = main.getPyFileFullImportName(sToolFileName)
		module = importlib.import_module(importStatement)

	toolFunctions = inspector.getModFunctions(module)
	for tf in toolFunctions:
		if (tf == "run") or (tf.lower() == (toolName.lower() + "run")):
			getattr(module, tf)()