RenderFarmΒΆ
class RenderFarm
An empty renderfarm interface. To override in plugin.
RenderFarm is the interface which must be inherited and overloaded in order to connect Guerilla to a render manager system and its render farm.
See the submit method for detailed information on implementing a RenderFarm interface
Hierarchy
class RenderFarm < class Node
Members
| gettemplate | ( ) | Return a property template table to be displayed in the property sheet |
| submit | (
|
Submit a list of jobs with options to the renderfarm |
| declare | (
|
Declare a new render farm interface. |
| get | (
|
Get a RenderFarm interface by its name |
| getlocal | ( ) | Get the batch or local RenderFarm interface |
| getmain | ( ) | Get the current active RenderFarm interface |
Inherited from class Node
string | Name | RW | The node name |
| belongstoreference | (
|
Tells if the node belongs to the reference, or a sub reference |
| delete | ( ) | Delete a node |
| eval | (
|
Called by the framework when plug (a node's plug) must be evaluated |
| findchild | (
|
Find a child node or plug using a path |
| findparent | (
|
Find the first parent Node of this Node of a specific class |
| getchild | (
|
Get a child node by its name |
| getname | ( ) | Get the Node name in its parent |
| getparent | ( ) | Get the parent Node of this Node |
| getpath | ( ) | Returns the node path as a string that can be reused with findchild |
| getreference | ( ) | Returns the reference node it is connected to |
| getreferences | (
[
|
Returns the references in the document sorted depth first. |
| getstringcopy | ( ) | Return a copy of the node and its content as a string to be pasted |
| iseditable | ( ) | Indicates if the node can be edited by the user in the UI |
| ismoveable | ( ) | Tells if the node can be moved |
| isparent | (
|
Tells if this node is parent of the potential child |
| isreference | ( ) | Tells if a node comes from a reference project |
| isselected | ( ) | Tell if the node is selected |
| loadfile | (
|
load a file content in this node. |
| loadtemplate | (
|
load a template file |
| move | (
|
Move a node to a new parent |
| onpathchanged | ( ) | Called by the framework when the name of this node or of one of its parent is modified |
| pastestringcopy | (
|
Paste a string copy into this node |
| rename | (
|
Rename a node |
| savefile | (
|
load a node to a file |
| seteditable | (
|
Change the editable state of the node |
| setflags | ( ) | Set the node flags |
Documentation
Return a property template table to be displayed in the property sheet
table
Submit a list of jobs with options to the renderfarm
This method is called by Guerilla when the user renders frames on the render farm.
The first argument is a list of jobs to execute in order. A job can be either a preprocess (such as baking a shadowmap once for a sequence of frames), a frame process (rendering frames) or a postprocess (building a movie of final frames.)
Submitted jobs can dependent on one another. It is the minimum requirement for a job scheduler to implement dependencies. For instance, a frame job may be dependent on a shadowmap baking, and eventually the final movie job is dependent on the rendering of the frame job.
A job is a simple Lua task containing the following data:
- number JobId: a unique integer id
- string Type: "frame", "pre" or "post"
- boolean Array: the job is an array of frames
- table Dependencies: the list of job ids this job is dependent on
- string Script: the template path of the Lua job script to execute at each frame
- string Name: the template name of the job
Additionally, jobs contain the following methods:
- string getscriptfile (number frame): get the actual file name of the job script file for a given frame
- string getscriptname (number frame): get the actual name of the job for a given frame
The second argument is a table of options. Options are set either by Guerilla or by the caller of the render function. Usual options are:
- string Name: a human readable name for the jobs to submit, default to the project name
- string FrameRange: the list of frames to render, see rangetonumbers function for details on the format of the string
- string ProjectDirectory: the directory of the current project, default to "$(SCENE_PATH)"
- string JobsDirectory: the directory where job scripts are written, default to "$(JOBS)"
- string RibsDirectory: the directory where rib files are written, default to "$(RIBS)"
A pseudocode RenderFarm implementation looks like:
-- Subclass RenderFarm
class ("MyFarm", "RenderFarm")
-- Construct MyFarm
function MyFarm:construct ()
LocalPlug ("MyFarmSettings", self, 0, types.string, "")
LocalPlug ("MyFarmOtherSettings", self, 0, types.int{min=10,max=20}, 15)
end
-- Generate the property template for MyFarm
function MyFarm:gettemplate ()
return {"MyFarm",
{
{ "Settings", self.MyFarmSettings },
{ "Other Settings", self.MyFarmOtherSettings },
}
}
end
-- Submit jobs to MyFarm
function MyFarm:submit (jobs, options)
local frames = rangetonumbers (options.FrameRange)
local guerilla = "/usr/local/guerilla"
-- A simple way to submit jobs is to submit them in order, and make sure
-- the next job waits for the previous to finish
for k, job in ipairs (jobs) do
print ("Submit job "..job.Name)
if job.Array then
-- execute this single job
-- TODO: replace this with your own scheduler submission command!
os.execute ("echo running "..job:getscriptname (1))
os.execute (guerilla.."/lua '"..job:getscriptfile (1).."'")
else
-- execute all frames on this job
-- TODO: replace this with your own schedulere submission command!
for k, frame in ipairs (frames) do
os.execute ("echo running "..job:getscriptname (frame))
os.execute (guerilla.."/lua '"..job:getscriptfile (frame).."'")
end
end
end
end
jobs The list of jobs to submitoptions The submission options
success Return true if submission is successful
Declare a new render farm interface.
interface An instance of the RenderFarm derived class.
Get a RenderFarm interface by its name
name The RenderFarm class name
Get the batch or local RenderFarm interface
Get the current active RenderFarm interface