  | | | MEL: Creating a new file | MEL: Creating a new file 2003-12-08 - By Andrew Chapman
Back Taisuke Tanimura wrote: > I have a MEL script that saves some animation data out to file. I've run > into a problem when I want to save the data out to a new file - there > doesn't seem to be an way in MEL to have the user "pick" a file that > doesn't exist and have the path to that non-existent file returned. The > fileDialog command only returns a string if the user picks an existing > file. I could work around it by popping up a text box and have the user > manually enter the full path and then create the file via fopen, but it > would be nice to use the file picker to do this. Has anyone had similar > problems or know of a workaround? Thanks! >
You could start with a base name, and append increasing numbers to the end until you find one that doesn't exist. Use fopen() in read mode to test for file existence (would be nice if the sysFile command had a -exists flag wouldn't it?).
-- Andrew Chapman 3D Technical Director - Framestore CFC
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-archive: <http://www.highend3d.com/maya/devarchive/>
|
|
 |