Files
Nexus/2023/scripts/animation_tools/mgpicker/MGPicker_Program/AutoSourced/InitializePython.py
2025-11-23 23:31:18 +08:00

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()