View Full Version : Capturing Output Window spew?

04 April 2006, 06:23 PM
I'm using some functions that use printf, stdout, and the like, that are printed in the Output Window. Is there a function like cmdFileOutput that gets those messages, or one that will echo them to the script editor?

This will be easier than editing the functions to write all those messages to a log.txt.


Robert Bateman
04 April 2006, 09:32 AM
freopen() on stdout, and set it somewhere else (file, memstream etc). You should be able to wang those into the script editor, though it probably wont be too nice.

of course, if you are on linux or mac, you could just start maya with

maya > log.txt &

and it will pipe stdout into log.txt.

Alternatively, you could just write your own printf func using vsprintf which writes the stuff into the script editor.

The other way would be to do something very unpleasant in the win32 api by retrieving the handle to the output window, and then piping the contents of the scroll field into the script editor.

afaik, mel has no way of redirecting those stdout calls (though you can use the mel command trace to output to stdout from mel). Generally though, if you want to write something to the script editor, then use the functions provided, using printf probably isn't all that helpful....

CGTalk Moderation
04 April 2006, 09:32 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.