View Single Post
# 3 25-11-2006 , 02:31 AM
enhzflep's Avatar
Subscriber
Join Date: Oct 2006
Location: Melbourne
Posts: 313
Read your post before. Just had no idea at that stage - but your clarification is good-value.

Haven't gone that far myself yet, but after reading your pos i've just done some reading in the maya help files. Mainly because I didn't know anything about maya's fle i/o capabilities were.

So anyway, In answer to your three q's.

Yup.
Nope. (For both software developer's kit and setting driven keys)
Don't know.

Have noticed, you'll often get the function name echoed in the script editor after executing any function. If not, open the script editor and toggle the Script->Echo All Commands menu option to on. This can often be a quick way of finding out how to do something, rather than looking it up.

The info's probly all there in the maya help files. But I guess the first step's to read the input file.
Reading from Help -> Using Maya -> MEL and Expressions ->I/O and interaction -> Reading and writing files, there's an ex given to read and print the lines of a file. You can try it by entering the following into the script editor

// Read a file one line at a time
string $exampleFileName = "C:/Demo.txt";
$fileId=fopen($exampleFileName,"r");
string $nextLine = `fgetline $fileId`;
while ( size( $nextLine ) > 0 ) {
print ( $nextLine );
$nextLine = `fgetline $fileId`;
};

Just remember to create a text file and save it to
C:\Demo.txt