This section displays various assorted advanced information, especially on adjusting Python and MEL scripts for FurryBall in Maya.
Autodesk Maya can be configured to launch from the command line, without the GUI (graphical user interface). In order to render sequences using FurryBall in such setting, you will need to prepare a very simple script that will tell Maya what to do.
Command to run Maya in command line is following:
maya -prompt -noAutoloadPlugins -file "FILE_TO_RENDER" -command "COMMANDS"
See Maya documentation for understanding. In short:
For FurryBall rendering you must have created FurryBall Global Settings Node in each scene (this node is created automatically when FurryBall plugin is loaded). If you want to set some attributes like output filename, you must set it before this command by:
setAttr -type "string" furryBallGlobalSettings.fbOutFileName "C:/outputFiles#";
For rendering you must call:
python("fbRenderSequence('furryBallGlobalSettings')");
After rendering, you can close Maya by:
quit -f;
The whole command line command is following:
maya -prompt -noAutoloadPlugins -file "C:/testScene.mb" -command "setAttr -type \"string\" furryBallGlobalSettings.fbOutFileName \"C:/outputFiles#\";python(\"fbRenderSequence('furryBallGlobalSettings')\");quit -f;"
Note that character " (double quote) in command must be replaced by \" (backslash + double quote) because it is inside other quotes.
Following is a list of Python FurryBall functions, which are exposed to Maya users after initializing the plug-in.
def fbRenderSequence(node):
- Function for rendering to file.
- Parameter node must be existing and valid name of FurryBall Global Settings Node (see Render Settings for details).
- Example:
fbRenderSequence('furryBallGlobalSettings')
def fbRender(node, renderParams = fbRenderParams()):
- Function for rendering to file.
- Parameter node must be existing and valid name of FurryBall Global Settings Node (see Render Settings for details).
- Parameter renderParams is optional and must be type of fbRenderParams (see class fbRenderParams for details).
- Example:
renderParams = fbRenderParams() # new class instance
renderParams.startFrame = 10 # override start frame to frame 10
renderParams.endFrame = 20 # override end frame to frame 20
fbRender('furryBallGlobalSettings', renderParams)
def fbExportSequence(node):
- Function for exporting into standalone file format.
- Parameter node must be existing and valid name of FurryBall Global Settings Node (see Render Settings for details).
- Example:
fbExportSequence('furryBallGlobalSettings')
def fbExport(node, renderParams = fbRenderParams()):
- Function for exporting into standalone file format.
- Parameter node must be existing and valid name of FurryBall Global Settings Node (see Render Settings for details).
- Parameter renderParams is optional and must be type of fbRenderParams (see class fbRenderParams for details).
- Example:
renderParams = fbRenderParams() # new class instance
renderParams.startFrame = 10 # override start frame to frame 10
renderParams.endFrame = 20 # override end frame to frame 20
fbExport('furryBallGlobalSettings', renderParams)
class fbRenderParams():
- Class for overriding attributes in FurryBall Global Settings Node (see Render Settings for more details). If some class member is set to None, it will use value from FurryBall Global Settings Node, otherwise the adjusted value.
- All members are set to None by default.
- Members:
startFrame - float value with start frame of sequence.
endFrame - float value with end frame of sequence.
byFrame - float value with frame step.
skipExistingFrames - boolean value says if will be existing frames skipped or replaced.
renumberFrames - boolean value says if will be frame number renumbered.
startNumber - float value with start number of sequence if renumberFrames is enabled.
byNumber - float value with frame number step if renumberFrames is enabled.
padding - int value with frame number padding in output file name.
cameras - array of dictionary with cameras to be rendered. Each dictionary item must have keys 'name' with camera object name and boolean 'alpha' indicates if alpha is rendered into image. For example:
all = cmds.ls(type = "camera")
cameras = []
for cam in all:
if cmds.getAttr(cam + ".renderable"):
camera = {}
camera['name'] = cam
camera['alpha'] = cmds.getAttr(cam + ".mask")
cameras.append(camera)
width - integer value with screen width.
height - integer value with screen height.
renderRegion - boolean value says if will be rendered only into region, not in full resolution.
renderRegionLeft - integer value with left position of region for region rendering.
renderRegionTop - integer value with top position of region for region rendering.
renderRegionWidth - integer value with maximum width of region for region rendering.
renderRegionHeight - integer value with maximum height of region for region rendering.
renderRegionFullSizeFrame - boolean value says if will be output image rendered in full resolution with black background or with region resolution.
channels - integer value with index to Channels enum field:
0 = RGBA
1 = RGB
2 = RG
3 = R
imageFormat - integer value with index to Image Format enum field:
0 = 32 bit float
1 = 16 bit float
2 = 16 bit unorm
3 = 8 bit unorm
fileFormat - integer value with index to File Format enum field:
0 = OpenEXR (.exr)
1 = RGBE (.hdr)
2 = PNG (.png)
3 = DDS (.dds)
4 = JPEG (.jpg)
fileName - string value with output file path.
passes - array of tuples of passes to be rendered. Each tuple must contain 5 values: pass index, render settings node name, Channels enum number, Image Format enum number, File Format enum number.
Available pass indices:
0 = Beauty
1 = Depth
2 = Direct Diffuse
3 = Direct Specular
4 = Indirect Diffuse
5 = Indirect Specular
6 = Reflections
7 = Transparency
8 = Subsurface Scattering
9 = Shadows
10 = Alpha
11 = Normals
12 = Wireframe
13 = UVs
14 = Matte
15 = World Position
16 = Ambient Occlusion
17 = Surface Color
For example:
passes = []
passes.append((0, getActiveRenderNode(), 0, 0, 0)) # it means: Beauty Pass, active render node, RGBA, 32 bit float, OpenEXR
doBackup - boolean value says if will be saved previously rendered frames to backup folder.
backupFolder - string value with path to the backup directory.