Hi !
I’m setting up a workflow for 3delight4maya rendering, and will eagerly hear any guidance on setting up custom deadline plugin.
Currently, 3delight4maya has a limitation, that you can render out only one renderpass when using usual “render.exe” approach.
So I created a simple script that is executed in maya batch mode - this script searches for delight renderpasses in a scene and exports RIBs for those passes. Then maya quits, and renderdl.exe is executed on RIB files(maya creates a .bat file for that). The only way I know to communicate with the script is ENV variables set before mayabatch.exe call. So here is simplified example of rendering invocation from command line:
LISTING A:
//frames chunk:
set dlbr_STARTFRAME=10
set dlbr_ENDFRAME=15
//here maya will write paths to generated RIBs, along with renderdl.exe
set dlbr_RENDERSCRIPT=c:\temp\renderscript.bat
//launch maya and export RIBs
maya -batch -command dlbr_RENDER_ALL_PASSES -file scene.mb
//maya quits, then we renderdl all RIBs
call c:\temp\renderscript.bat
//example c:\temp\renderscript.bat
renderdl.exe c:\temp\rib\scene_passA.0010.rib
renderdl.exe c:\temp\rib\scene_passA.0011.rib
//...
renderdl.exe c:\temp\rib\scene_passA.0015.rib
renderdl.exe c:\temp\rib\scene_passB.0010.rib
renderdl.exe c:\temp\rib\scene_passB.0011.rib
//...
renderdl.exe c:\temp\rib\scene_passB.0015.rib
After this longish introduction, here’s actual question:
How can I setup deadline plugin to support this kind of workflow ?
Actually what I do at the moment, is to create multiple .bat files, each for successive chunk of frames(listing A), and use Deadline’s default CommandLine job type. While this works, it is awkward. There is no relation between actual frame numbers being rendered and those displayed in tasklist (deadline treats each .bat file as single frame and starts counting from 1). Another annoyance is that I have to create .bat files through MEL in interactive maya session so there’s no way to use deadlines usefull options like “change frame range” etc.
I read through documentation showing how to create example plugin for Cinema4D, but this can create only one command for each frame, whereas I need to execute many commands…
I hope I made myself clear, it still boggles my mind
Any thoughts about this? Perhaps I made things too complicated, and there’s easier solution to all this. I gladly accept any suggestions
cheers, Michal
Hi Michal,
To execute multiple commands per task, you can use the advanced plugin architecture. Unfortunately, there isn’t a tutorial for advanced plugins, but you could look at a few of our plugins for a reference:
- DFusion
- Fusion5
- Lightwave
Basically, instead of defining the RenderExecutable/RenderArgument/RenderStartupDir items that get launched for each task, you define StartJob/RenderTasks/EndJob items that get called around the full execution of a job. In our advanced plugins, we use StartJob to start up the rendering application (ie: Fusion), and EndJob to stop the application. StartJob only gets called once by the slave when it initially loads the job, and EndJob gets called when the slave is finished with the job. RenderTasks, as you would expect, can be called multiple times while a job is loaded (each call is for one task).
In your case, I would imagine the StartJob and EndJob scripts to contain next to nothing, since it sounds like you just want to run multiple command lines for each task. In the RenderTasks, you could set it up to run commands using the LaunchProcess function defined here (just search the page for the LaunchProcess function):
franticfilms.com/software/su … ginsdk.php
You could also use the managed program functions which are more complex, but can give you better control over each process.
Because the possibilities for the advanced plugins are almost endless, it’s difficult to give you a full tutorial on how to use them. Instead, we recommend taking a look at the plugins above, and asking specific questions here when you come across them.
Cheers,
Hello Ryan !
Thankyou for your valuable answer, I’ll get to inspecting plugins ASAP
-michal
Hi !
So I started to build up smth. really simple for now. The error I encounter is this:
Scheduler Thread - Plugin loaded in 0 seconds.
0: Loaded job: Untitled (006_060_x_4a2602f3)
0: WARNING: The key SingleFramesOnly was not specified in the plugin configuration, defaulting to false.
0: INFO: Script plugin for Deadline 2.7.29178, built Aug 22 2007 14:02:42 R
0: INFO: >> MayaDelight
0: INFO: job file: c:\deadline\slave\jobsData\006_060_x_4a2602f3.job
0: Plugin rendering frame(s): 10
0: INFO: maya scena: S:\theGame\maya\scenes\fro\delight_jobs_testy\scena_A_104.mb
Scheduler Thread - Render Thread 0 threw an error:
Scheduler Thread - Exception during render: Script called an unknown function "LaunchProcess"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Exception Details
RenderPluginException -- Exception during render: Script called an unknown function "LaunchProcess"
RenderPluginException.Cause: JobError (2)
Exception.TargetSite: Void RenderTasks(Int32, Int32)
Exception.Source: DeadlinePluginLoader
Exception.StackTrace:
at Deadline.Plugins.PluginLoader.RenderTasks(Int32 startTask, Int32 endTask)
at Deadline.Plugins.PluginLoader.RenderTask(Int32 task)
at Deadline.Plugins.Plugin.RenderTask(Int32 frame)
at Deadline.Slaves.SlaveRenderThread.RenderCurrentTask()
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
and here is my MayaDelight.dlinit file:
About=MayaDelight
PluginName=MayaDelight
RenderExecutable=
RenderArgument=
OutputRegEx0=3DL ERROR.*
OutputRule0=FailRender( GetRegExMatch(0) );
StartJob=ExecuteScriptFile( "StartJob.ffs" );
RenderTasks=ExecuteScriptFile( "RenderTasks.ffs" );
EndJob=ExecuteScriptFile( "EndJob.ffs" );
StartJob.ffs and EndJob.ffs are empty files.
RenderTasks.ffs is here:
startFrame= StartFrame();
endFrame= EndFrame();
mayaSceneFile= Trim( GetJobInfoEntry( "mayaSceneFile" ) );
LogInfo("maya scene: " .. mayaSceneFile);
LaunchProcess(-1, "SET PATH=%PATH%;S:\\farmTools\\delight\\CURRENT_PACKAGE\\3Delight\\bin", "", "c:\\temp\\");
LaunchProcess(-1, "SET PATH=%PATH%;S:\\farmTools\\UnxUtils\\usr\\local\\wbin", "", "c:\\temp\\");
LaunchProcess(-1, "SET DELIGHT=S:\\farmTools\\delight\\CURRENT_PACKAGE\\3Delight", "", "c:\\temp\\");
LaunchProcess(-1, "SET dlbr_STARTFRAME=" .. startFrame, "", "c:\\temp\\");
LaunchProcess(-1, "SET dlbr_ENDFRAME=" .. endFrame, "", "c:\\temp\\");
LaunchProcess(-1, "mayabatch.exe", " -batch -script dlbr_TEST -file " .. mayaSceneFile, "c:\\temp\\");
I didn’t find any existing plugin which uses LaunchProcess(). Any hints ?
thanks !
Turns out there is a typo in our documentation. That function should be called LaunchProgram instead of LaunchProcess. Try using LaunchProgram and I’m sure you’ll have better luck.
Cheers,
Thanks !
Now everyting works OK, and I have nice system for multipass renders, and cleaning temp files
I’ll now start adding usefull options…
michal
Id like my plugin to support this functionality:
- Submit Job As Suspended
- TaskTimeOut
- Job Dependencies
Do I have to write code to handle this? Or deadline does it automagically ?
cheers, michal
Those are all handled automatically by Deadline, so you don’t have to add anything special to your plugin. You just need to set those options on submission, or from the Deadline Monitor after submission. For a complete list of options that you can specify on submission, check out this page:
franticfilms.com/software/su … _Info_File
Cheers,