Hi,
I am a newbe to Python… I am trying to find a simple way to open a maya scene with python in windows,
depending on his modification date,
as an example i wrote this code who is a mix between python, maxscript and mal…if someone know how to translate it in python, it would be wonderfull!
by advance thanks for help,
# Find all files in a directory with extension .ma in Python
import glob
for f in glob.iglob("G:/ProjectPath/241/*/001/LGT/*.ma"):
print f
print count(f)
# if several maya scenes founded, find the last one by modification date:
if f.count > 1:
filesModDateArr = for i in f collect (getFileModDate i)
lastModifiedDate = amax filesModDateArr
index = findItem filesModDateArr lastModifiedDate
lastModifiedFile = filesArr[index]
# open last maya scene founded:
file -f -options "v=0;p=17;f=0" -ignoreVersion -typ "mayaAscii" -o lastModifiedFile ;addRecentFile( lastModifiedFile, "mayaAscii");