[Closed] Max with Maxwell plugin
Hi everyone,
as a complete beginner with Maxscript I try the following:
My aim is to let the PC render a certain amount of time after my work’s end. After that time I want a syncback-Profile (backup software) to be started, which itself is no problem. The way I tried is using a ‘post-render’-script, saying:
sleep 18000
max file save
doscommand “C:\Windows\System32\schtasks.exe /RUN /TN Syncback_ich_geh_jez_heim”
The problem (and therefore my attempt with the “sleep”- thing) is, that Max starts the rendering using the Maxwell render engine as a Plugin and somehow Max thinks the renderjob is finished as soon Maxwell starts rendering.
I have no chance to detect if maxwell’s job is done ??!!
Is the sleep argument correct?
Do you have some other ideas?
thank you VERY much for any helpful answers
############
windows 7 prof. 64bit
3dmax 2010
Maxwell Renderer 2.0.3
Assuming Maxwell is rendering on a different process and does not play well with standard 3dsmax callbacks, I would try to get that process as a dotnet system.diagnostics.process object and set up an event for when that process is terminated.
thank you very much for your fast reply, it really sounds very interesting, but i have no clue, how this object is to be defined or managed, sorry i’m a newbie…
Do you have a link for me where i can learn the basics of Maxscript or can give someone further advice?
For learning maxscript at a beginner level, I find the maxscript help file very effective.
As for your current problem, I don’t have Maxwell to test, so this code is assuming that maxwell starts a process called maxwell.exe, and shuts it down when rendering is completed. The case may be entirely different, it is up to you to find out. the executable name may also be different.
fn renderHasFinished = --this is a function, it is executed only when called
(
print "an instance of the maxwell.exe process has shut down."
-- do your stuff here
)
global MWProcesses = (dotnetClass "System.Diagnostics.Process").getProcessesByName "maxwell" --gets an array of all active maxwell processes
for p in MWProcesses do --iterates over the processes
(
p.EnableRaisingEvents = true --allow the process to raise events
dotnet.AddEventHandler p "Exited" renderHasFinished --call the function whenever one of the MW processes exits.
)
as I’ve just read about Maxwell it has own scripting (python based). So it has to be a way to say MAX that the job was done. The primitive solution is to make a file in some predefined directory. And MAX has to listen this event.
As you are only launching a seperate application when maxwell render finishes, perhaps scripting it in maxwell might be easier:
http://support.nextlimit.com/display/maxwelldocs/Render+events+example
Again, I have no idea how maxwell works and if this is applicable.
edit: hah, jinx!
MAXWELL writes in their help file:
its ECMA (but i’m not a programmer, HELP)
“…
Function: bool isRendering( void );
Description: Returns True if the application is rendering and False if it is not
rendering.
Parameters: No parameters.
Returned Value: Bool (True if the application is rendering and False if it is not
rendering).
…”
I think thats it.
But now i have to learn how i could tell MAX to start MAXWELL rendering with that additional script inside.
Besides: the process “maxwell.exe” is’nt stopped after rendering is finished.
what i have from Maxwell Render site:
[ul]
[li]Network tools: a complete set of network tools (manager, monitor, nodes) to distribute rendering tasks across multiple computers in a single or multi-platform network.[/li][li]Scripting editor: Python-based scripting editor with example scripts to create and edit Maxwell scenes.[/li][/ul]it means that Maxwell has to have command line… yes, it has http://stuff.mit.edu/afs/athena/dept/cron/documentation/Maxwell-Render/maxwell_render_v2_manual.pdf
so everything is easy… you can run Maxwell from MAX, say it to close after job, and use .net process events to check the completion.
i just don’t understand what MAX is doing in this pipeline? Export data to Maxwell format?
the process “maxwell.exe” keeps running after rendering has finished, its “CPU amount” after rendering is – of course 0%, maybe thats a possible point to listen for maxscript. The end of rendering is additionally announced by a little message at the right side of my taskbar which is disappearing after 2 seconds.
I still think its the way to start max with a script, because maxwell is used as a render-plugin, so i can’t really say maxwell to start with a “maxwell-script”. That’s the answer to your question, what Max is doing here?!