I'm trying to write a MEL script that randomly generates a series of coordinates, and then writes those numbers out to an external text file.
The numbers will generally look like this:
1 2 3
4 5 6
7 8 9
What command do I want to use? Fwrite? And if so, what would be the proper syntax. I've tried to consult the Maya Command Reference, but it doesn't explain what each thing in the example code does.
Generally, I want the script to do th following:
open a file to write
execute the following loop 100 times
$x = rand(-10,10);
$y = rand(-10,10);
$z = rand(-10,10);
read $x, $y, and $z out to the file
start a new line
end of loop
close the file
If anybody can show me how to do this, I'd appreciate it.