////////////////////////////////////////////////////////////////////// // written by Michael Munoz // // 3D Artist // // eleazermunoz@hotmail.com // // www.eleazermunoz.com // // // // // // // // This is a incermental Saver. I use a script Job to // // make so it save every 10 mins if your working, meaning if // // your selecting stuff. // // 1.Load script and exicute // // // ////////////////////////////////////////////////////////////////////// int $jobNum = `scriptJob -ct "SomethingSelected" "incSave" -protected`; proc incSave() { // Getting old date and time string $name = `file -query -sceneName -shortName`; string $name = substituteAllString($name, "mb", ""); string $name = substituteAllString($name, ".", ""); string $nameOldDateSting = `match "[0-9]+" $name`; /* print "old date int \n"; print $oldDate; print "\n"; print "save time check \n"; print $saveCheck; print "\n"; print "date string \n"; print $nameOldDateSting ; print "\n"; print "name \n"; print $name ; print "\n"; */ if ($nameOldDateSting == "") { print "save in new format"; //time string $time=`date -format YY.MM.DD.hh.mm`; //conjecting the new name for the save string $newName = $name + $time; print "New Name"; print "\n"; print $newName; file -rename $newName; file -save -type "mayaBinary"; } if ($nameOldDateSting != "") { // getting current time for check string $currentTimeString=`date -format YYMMDDhhmm`; int $currentTime = $currentTimeString; string $nameOldDateSting = `match "[0-9]+" $name`; int $oldDate = $nameOldDateSting; int $saveCheck= $oldDate + 10; if ($currentTime >= $saveCheck) { //incrental save string $name = `file -query -sceneName -shortName`; string $name = substituteAllString($name, "mb", ""); string $name = substituteAllString($name, ".", ""); string $nameOldDateSting = `match "[0-9]+" $name`; string $name = substituteAllString($name, $nameOldDateSting , ""); //time string $time=`date -format YY.MM.DD.hh.mm`; //conjecting the new name for the save string $newName = $name + $time; print "New Name"; print "\n"; print $newName; file -rename $newName; file -save -type "mayaBinary"; } if ($currentTime < $saveCheck) { print "do thing"; } } }