26 lines
650 B
Python
26 lines
650 B
Python
import os
|
|
import sys
|
|
|
|
# To-Do: Maya calls need to be removed for non-maya mode.
|
|
from maya import mel
|
|
|
|
|
|
def initializePythonModules():
|
|
def _addToSysPath(pathStr, label):
|
|
if not os.path.isdir(pathStr):
|
|
print(
|
|
"Error initializing MGPicker {}, as the directory does not exist: {}".format(
|
|
label, pathStr
|
|
)
|
|
)
|
|
return
|
|
|
|
if not sys.path.count(pathStr):
|
|
sys.path.append(pathStr)
|
|
|
|
_addToSysPath(mel.eval("MGP_GetPythonAPIDir"), "python API")
|
|
_addToSysPath(mel.eval("MGP_GetAutoLoaderDir"), "autoLoaders")
|
|
|
|
|
|
initializePythonModules()
|