PDA

View Full Version : Any way to record warnings from the script editor?


sheffdog
10-24-2007, 06:10 PM
I'm currently working on a UI that needs to display certain errors from the script editor when someone is using the tool.

I know how to "catch" an error or warning, but that is just a 1 or 0. I actually need to query the warning/error text and display it somewhere else.

Is there any way to do this other than writing to a text file and reading it back in?

scriptEditorInfo command seems to not have any output query.

Any help is appreciated,
Thanks!

ashishdantu
10-27-2007, 02:45 AM
hi sheffdog,

have a look at environment variable :MAYA_CMD_FILE_OUTPUT

from the help docs -
"This variable enables the cmdFileOutput command during startup so the content in the script editor automatically outputs to a designated file. If no file name is specified, then errors are sent to the standard error output, for example the Terminal window. This feature is useful for tracking down error messages when Maya crashes upon startup"

in your mel script where you think you have the catch statements or at the beginning of you script, use

cmdScrollFieldReporter -e -clear $gCommandReporter; // clear the history
scriptEditorInfo -wh 1 -historyFilename "c:/myScriptEditorLog.txt";

this will enable the commandWindow to write the history to the specified txt file.
and then at the end of your script have :
scriptEditorInfo -wh 0; to disable the writing to this txt file.

this way you capture only the required history and then you can read this txt file, process for only warnings or error statements for later viewing.

CGTalk Moderation
10-27-2007, 02:46 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.