cb109 / maxjob

:loudspeaker: Whiteboxed maxscript execution from the commandline.
5 stars 0 forks source link

Improve maxscript log procedure #3

Open cb109 opened 8 years ago

cb109 commented 8 years ago

Currently the maxscript log is redirected to a file and flushed by a timer in a given interval (~1 sec). This does not reliably catch ALL messages everytime.

We can possibly improve this by making use of 3ds Max's callback system, e.g. #preSystemShutdown, #postSystemShutdown.

cb109 commented 8 years ago

There also seems to be an issue with the maxscript log file not being reset properly: The amount of maxscript log lines differs whether the file already exists or not. Maybe a hard reset helps.

cb109 commented 8 years ago

Logging is also pretty often mixed up (I thought we fixed that :sob:), here is an example:

<mxs>     ___________________________________________
<mxs>                           _              _
<mxs>      _ __ ___   __ ___  _| |_ ___   ___ | |___
<mxs>     | '_ ` _ \ / _` \ \/ / __/ _ \ / _ \| / __|
<stdout> maxjob_backend initialized.
<mxs>     | | | | | | (_| |>  <| || (_) | (_) | \__ \
<mxs>     |_| |_| |_|\__,_/_/\_\__\\___/ \___/|_|___/
<mxs> 
<mxs>     _____________________________ version 2.1.21
<mxs> "importing C:\jenkins\workspace\pipeline-maxtools\maxtools\maxscripts\Logger.ms"
<mxs> "importing C<mxs> "importing C:\jenkins\workspace\pipeline-maxtools\maxtools\maxscripts\std\StringFunctions.ms"<mxs> "importing C:\jenkins\workspace\pipeline-maxtools\maxtools\maxscripts\VRayStripe.ms"<mxs> "importing C:\jenkins\workspace\pipeline-maxtools\maxtools\maxscripts\site.ms"
<mxs> "importing C:\jenkins\workspace\pipeline-maxtools\maxtools\maxscripts\Logger.ms"<mxs> "importing C:\jenkins\workspace\pipeline-maxtools\maxtools\maxscripts\std\TimeFunctions.ms"
<mxs> "importing C:\jenkins\workspace\pipeline-maxtools\maxtools\maxscripts\std\utils.ms"

Since the weak point is most likely the flushing/logging from withing 3dsmax, we probably need a more robust handling of it, e.g. check if the diff we get ends with a newline, otherwise wait for the rest. That however would mean we need to differentiate between sources inside the queue handler...