-
-
Save fereria/4a44afbae9d2a09302aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as mc | |
import maya.mel as mm | |
import glob,os.path,re | |
def sourceMelFolder(Path): | |
drivenKeyFile = glob.glob(Path + "/*.mel") | |
if isinstance(drivenKeyFile,list) == True: | |
for keyFile in drivenKeyFile: | |
keyFile = re.sub('\','/',keyFile) | |
print ('sourceFile->'+keyFile) | |
mm.eval('source "' + keyFile + '";') | |
elif isinstance(drivenKeyFile,str) == True: | |
mm.eval('source "' + folderPath + '";') | |
print ('sourceFile->'+keyFile) | |
else: | |
print "file does not exists." | |
def sourceMel(Path): | |
if isinstance(Path,str): | |
mm.eval('source "' + Path + '";') | |
print ('sourceFile->'+Path) | |
elif isinstance(Path,list): | |
for mel in Path: | |
mm.eval('source "' + mel + '";') | |
print ('sourceFile->' + mel) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment