
Originally Posted by
tchoa
Good catch ionblue!
My mistake! I wrote this too quickly, working with an existing .ma file goz linked... (stupid me)
So the code should be the one, as we want to unlock the file before delete and rewrite it if it already exists:
Code:
// Then exports it to a Maya file. $maFileName = $GoZProjectPath + $gozName + ".ma";
if (`filetest -r $maFileName`)
python ("import os, stat\nmaFile = '" + $maFileName + "'\nos.chmod(maFile, stat.S_IWRITE)");
sysFile -delete $maFileName;
file -f -op "v=0;" -typ "mayaAscii" -es $maFileName;
python ("import os, stat\nmaFile = '" + $maFileName + "'\nos.chmod(maFile, stat.S_IREAD)");
But maybe it's not necessary to unlock the file before deleting it... anyway that should be ok now.
Hey, I'm having the same problem but when I try the code fix I get a "Windows Error"
Code:
# Error: file: C:/Users/Public/Pixologic/GoZApps/Maya/GoZBrushFromMaya.mel line 493: WindowsError: file line 3: 3 #