OK, couple of things happening here, which are stopping this from working for you.
Autodesk changed the encoding type of StdOut/Err coming from the 3dsmaxcmd.exe process in 3ds Max 2016 and onwards. Autodesk made this change. You can see a few patterns if you compare it to older StdOut/Err being generated by 3dsmaxcmd.exe from < 2016. Firstly, there is now a BLANK line between each string message and the Deadline StdOutHandlers no longer were catching or recognising the strings, as we were always expecting utf-8, which pretty much everyone else uses in their cout.
To resolve this issue, sometime ago we added in Deadline 9.0.7 a new setting in our FranticX class:
docs.thinkboxsoftware.com/produ … 23b29d4efc
ManagedProcess.StdOutEncoding
In the case of a vanilla copy of the CommandLine.py plugin file, you would add the above line in the “InitializeProcess()” function of the ManagedProcess you invoke, like this:
def InitializeProcess( self ):
self.PluginType = PluginType.Advanced
self.StdoutHandling = True
self.StdOutEncoding = "utf-16"
Now for your second issue. Deadline’s “RunProcess” is an unmanaged process (fire and forget missile), you really want a Tomahawk “guided” missle, which comes in the form of a “ManagedProcess”. StdOut/Err is NOT captured in an unmanaged process, hence you stdout handler not working. We make a comment about this in our CommandLine.py code at line: #61 (Deadline 10.0.14)
# StdOut/Err will NOT be captured here as unmanaged process
So, the way to solve this 2nd issue is to create another class (or re-use the class in the CommandLine plugin), remove the parts which force it to be invoked through whatever SHELL a user wants, instead target your RenderExecutable and then invoke it via line: #66, as we do already:
self.ShProcess = ShellManagedProcess( self, arguments, startupDir )
self.RunManagedProcess( self.ShProcess )
as it then runs as a Deadline “ManagedProcess” it will be able to capture and track any StdOut/Err and then combined with you simply setting the
self.StdOutEncoding = "utf-16"
in the
InitializeProcess()
function of this ManagedProcess class, it will also be able to handle the unique difference that Autodesk tweaked about their Stdout as I explained above.
Yes, you could possibly use “subprocess” in py lib but you would be in charge of handling the management of the process, encoded StdOut/Err handling and you would also not be able to use the Deadline “Run As User” switching feature if that is something you rely on. Personally, when in Deadline, I avoid the use of subprocess for render-time execution of processes on the Slave side. Using subprocess for client side operations within the context of job submission/modification is a separate thread. 
Finally, as per Bobo’s comment about licensing advantages…? Perhaps, Thinkbox should dev this plugin if its going to be useful for users.
Hope that helps?