Go to: Synopsis. Flags. Return value. Related. MEL examples.

Synopsis

Mayatomr [-active] [-addHosts string] [-addIncludes string] [-addLinks string] [-binary boolean] [-camera string] [-echo] [-exportFilter int] [-exportFilterString string] [-exportPathNames string] [-exportStartFile] [-file string] [-fragmentChildDag] [-fragmentExport] [-fragmentIncomingShdrs] [-fragmentMaterials] [-immediateModeRender boolean] [-init] [-layer string] [-license] [-listHosts] [-listLinks] [-logFile] [-miStream] [-padframe int] [-pauseTuning boolean] [-perframe int] [-preview] [-previousView] [-project string] [-region] [-regionRect int int int int] [-removeHosts string] [-removeLinks string] [-render] [-renderNoMaster] [-renderNoSlaves] [-renderThreads int] [-tabstop int] [-updateHosts] [-updateRayrc] [-verbosity int] [-xResolution int] [-yResolution int] [parameters]

Mayatomr is undoable, queryable, and editable.

This mel command provides access to most functionalities of mental ray for maya plugin including .mi file export, preview and batch rendering, network rendering and shader management.

General purpose flags
-v/-verbosity -prj/-project -ur/-updateRayrc -ai/-addIncludes -al/-addLinks
-rl/-removeLinks -ll/-listLinks -a/-active -fe/-fragmentExport -fcd/-fragmentChildDag
-fem/-fragmentMaterials -fis/-fragmentIncomingShdrs

Rendering flags
-pv/-preview -r/-render -cam/-camera -prv/-previousView -rg/-region
-rr/-regionRect -x/-xResolution -y/-yResolution -log/-logFile -rt/-renderThreads
-l/-layer

Network Rendering flags : used with other rendering flags
-rnm/-renderNoMaster -rns/-renderNoSlaves -uh/-updateHosts -ah/-addHosts -rh/-removeHosts
-lh/-listHosts -lic/-license

mental ray IPR flags
-imr/-immediateModeRender -pt/-pauseTuning -rg/-region -rr/-regionRect -q/-query

Export flags
-mi/-miStream -f/-file -pf/-perframe -pad/-padframe -tab/-tabstop
-e/-echo -bin/-binary -xf/-exportFilter -xfs/-exportFilterString -xsf/-exportStartFile
-xp/-exportPathNames

Flags

active, addHosts, addIncludes, addLinks, binary, camera, echo, exportFilter, exportFilterString, exportPathNames, exportStartFile, file, fragmentChildDag, fragmentExport, fragmentIncomingShdrs, fragmentMaterials, immediateModeRender, init, layer, license, listHosts, listLinks, logFile, miStream, padframe, pauseTuning, perframe, preview, previousView, project, region, regionRect, removeHosts, removeLinks, render, renderNoMaster, renderNoSlaves, renderThreads, tabstop, updateHosts, updateRayrc, verbosity, xResolution, yResolution
Long name (short name) [argument types] Properties
-verbosity(-v) int create
General option. Set the plug-in and mental ray message verbosity level. The value can range from 0 to 6, setting the verbosity to none, fatal, error, warning, info, progress, and details, respectively. Default: render globals settings (warning level)
-project(-prj) string create
General option. Set the project root directory to be used by the plug-in. Affects the default output directory as well as handling of file references in project subdirectories not addressed with full file path, like textures. Default: none for file export, default project directory for preview
-updateRayrc(-ur) create
General option. Reload maya.rayrc file to reinitialize mental ray. For internal use only.
-addIncludes(-ai) string create
General option. Include the specified .mi file interactively. Must be used after mental ray is properly initialized; after an image is rendered for example. For internal use only.
-addLinks(-al) string create
General option. Links the specified shader library interactively. Must be used after mental ray is properly initialized; after an image is rendered for example. For internal use only.
-removeLinks(-rl) string create
General option. Unlink the specified shader library interactively. Must be used after mental ray is properly initialized; after an image is rendered for example. For internal use only.
-listLinks(-ll) create
General option. List shader libraries currently linked. Must be used after mental ray is properly initialized; after an image is rendered for example. For internal use only.
-active(-a) create
General option. Translate active scene elements only to create the final scene. This includes just selected geometry, together with all shading nodes that these objects reference, all lights and render camera(s). This ensures that always a renderable scene is generated. This mode can be combined with the export filter. Default: translate whole scene
-fragmentExport(-fe) create
General option. Enable fragment .mi file export. This just translates the selected nodes of any supported type. Further options allow to extend the translation to consider related or connected nodes as well, see below. This mode allows to create .mi files that only contain the intended piece of information, which usually results in non-renderable .mi files. Note, for a geometric object, the export will always contain both the object and its instance, regardless if just the shape node or its parent transform is selected. Default: translate whole scene
-fragmentChildDag(-fcd) create
General option. In fragment mode, additionally translate any child DAG graph of transform nodes found in the current selection. Default: translate just the selected object/instance
-fragmentMaterials(-fem) create
General option. In fragment mode, additionally translate attached materials for shape/transform nodes found in the current selection. Default: ignore attached materials
-fragmentIncomingShdrs(-fis) create
General option. In fragment mode, additionally translate shading nodes which are connected to nodes found in the current selection (driving nodes). Default: ignore connections
-preview(-pv) create
Rendering option. Perform preview rendering with integrated mental ray. Only for interactive rendering. (Not for batch rendering) Cannot be specified with -r/-render. Default: off
-render(-r) create
Rendering option. Performs rendering in batch mode. Cannot be specified with -pv/-preview.
-camera(-cam) string create
Rendering option. Use this camera as the render camera for preview rendering. Camera shape name is expected. Default: render globals camera
-previousView(-prv) create
Rendering option. Use render camera from a previous run for preview rendering, if no explicit camera has been given on the same command line. Default: first renderable camera found in the scene
-region(-rg) create
Rendering option. Preview render only the current region rectangle of the Maya render window. Default: render whole image
-regionRect(-rr) int int int int create
Rendering option. If region is enabled this sets a custom rectangular region for preview rendering. The four integer values specify the left, bottom, right, and top bounds, in this order. Default: render window region
-xResolution(-x) int create
Rendering option. Set the output image x resolution for preview rendering. Default: render globals image width
-yResolution(-y) int create
Rendering option. Set the output image y resolution for preview rendering. Default: render globals image height
-logFile(-log) create
Rendering option. Write mental ray render messages to a file called 'mentalray.log' located in the current directory. Additionally, these messages are still written to the output or parent shell window.
-renderThreads(-rt) int create
Rendering option. It allows to reduce the number of render threads used in mental ray for the current rendering. Accepts values from 1 to 4. Default: 4
-layer(-l) string create
Render the specified render layer. Only this render layer will be rendered, regardless of the renderable attribute value of the render layer. The layer name will be appended to the output image file name. The specified render layer becomes the current render layer before rendering, and remains as current render layer after the rendering.
-renderNoMaster(-rnm) create
Network rendering option. If given it allows to render almost everything on slave machines, thus reducing the workload on the master machine (where Maya is running).
-renderNoSlaves(-rns) create
Network rendering option. If given it allows to render almost everything on the master machine (where Maya is running), thus reducing the workload on the slave machines.
-updateHosts(-uh) create
Network rendering option. Reload the maya.rayhosts file and update the list of host machines (slave machines) accordingly. Must be used after mental ray is properly initialized; after an image is rendered for example. For internal use only.
-addHosts(-ah) string create
Network rendering option. Add the given machine name to the host list. (Attach the given host.) Must be used after mental ray is properly initialized; after an image is rendered for example. For internal use only.
-removeHosts(-rh) string create
Network rendering option. Remove the given machine name from the host list. (Detach the given host.) Must be used after mental ray is properly initialized; after an image is rendered for example. For internal use only.
-listHosts(-lh) create
Network rendering option. List machine names in the host list. Must be used after mental ray is properly initialized; after an image is rendered for example. For internal use only.
-license(-lic) create
Satellite license option for batch rendering only. Accepts "mc"/"complete" and "mu"/"unlimited". Default is "unlimited" : use the best available option. The order of check is, unlimited nodelock, mrfm unlimited floating, complete nodelock, mrfm complete floating. The number of satellite CPUs depends on the selected license. (8 for unlimited, 2 for complete) If "complete", mental ray for maya searches for complete license first and unlimited last. The number of satellite CPUs is always 2. This is for batch rendering only. Unlimited interactive maya uses the best available satellite license. Complete interactive maya searches complete satellite license first.
-immediateModeRender(-imr) boolean create
(Q) Rendering option. Interactive rendering only. Begins/stops mental ray immediate mode render (IPR). Can be followed by -pt/-pauseTuning, -rg/-region, -rr/-regionRect. If comes with query flag -q, returns true if mental ray IPR is running, false otherwise. Only a subset of options will be accepted if mental ray IPR is turned on.
-pauseTuning(-pt) boolean create
Rendering option. Used with -imr. Pause/resume mental ray IPR. If paused, attribute changes still update the internal database.
-miStream(-mi) create
Export option. Export scene to .mi file. Default: off
-file(-f) string create
Export option. Set the file name and path for .mi export or .mi echo. Default: untitled
-perframe(-pf) int create
Export option. Controls per-frame .mi file export of animations. Supported values are: 0 (single .mi file containing the whole animation, exploiting incremental changes), values greater 0 export one .mi file per frame not using incremental changes, with different naming scheme: 1 (name.ext.#), 2 (name.#.ext), 3 (name.#). Default: 0
-padframe(-pad) int create
Export option. Set frame number padding (fixed field width) used to generate file name extensions during per-frame .mi file export of animations. Default: 0, no padding
-tabstop(-tab) int create
Export option. Set the number of space characters used to indent lines in the .mi files. Default: 4
-echo(-e) create
Export option. Export scene to .mi file by sending scene data to builtin mental ray and executing its echo command. Default: off
-binary(-bin) boolean create
Export option. Export binary .mi format (write binary vectors in object definitions). Default: off, write ascii format
-exportFilter(-xf) int create
Export option. This allows to remove certain types of mental ray entities from exported .mi files. The integer argument is basically a bitmap where each bit represents a single filter entry.
This is the complete list:
value pos value
FilterLink 0 1
FilterInclude 1 2
FilterVersion 2 4
FilterTextures 3 8
FilterObject 4 16
FilterGroup 5 32
FilterLight 6 64
FilterCamera 7 128
FilterMaterial 8 256
FilterOptions 9 512
FilterFunction 10 1024
FilterFuncDecl 11 2048
FilterPhenDecl 12 4096
FilterUserData 13 8192
FilterInstObject 14 16384
FilterInstGroup 15 32768
FilterInstLight 16 65536
FilterInstCamera 17 131072
FilterInstFunction 18 262144
FilterRender 19 524288
FilterCustomText 20 1048576
FilterCustomShader 21 2097152
FilterCustomPhen 22 4194304

The integer values in this list determine the bit position in the pattern. MEL has no bit shift operation, but instead the command:
pow 2 pos
can be used to compute the final integer value. Any combination of filter entries is supported, the final filter integer is the sum of the individual values. Example: to not write (cut out) 'link' and 'include' statements you would give
Mayatomr -mi -file fileName -exportFilter 3
A convenient MEL function miExportFilterValue(string $entries[]) is available which calculates the final integer argument based on supplied descriptive type names, like "link", "include", and so on. The list of supported type names can be found in the file mentalrayUI.mel. Default: no filter
-exportFilterString(-xfs) string create
Export option. Set the export filter using a string argument where every character in the string marks the corresponding bit position in the above pattern. Default: no filter
-exportStartFile(-xsf) create
Export option. Include the currently used startup file maya.rayrc into the exported .mi file. Startup file statements need not be given again from within the scene file (via custom text) in this case Default: off
-init(-ini) create
General option. Perform the initialization steps again for the integrated renderer, including loading startup files and redoing custom link and include commands. For internal use only.
-exportPathNames(-xp) string edit
Export option for the file references such as : ink library, include mi file, texture file, lightmap, etc.
The string can specifies an for individual file refs, with each character in the string representing a single file ref entry, with meaning
0-nochange 1-absolute 2-relative 3-nopath, or
0-nochange a-absolute r-relative n-nopath.
The file ref entry is specified in this order :
link library, include mi file, texture file, lightmap, light profile, output image, shadow map, finalgather map, photon map, demand load object mi file. Default: nochange
For example, "-xp aarrararra" will use absolute path for link libray, include file, light profile, shadow map, demapd load object mi file, and relative path for texture file, lightmap, output image, finalgather map, photon map

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command

Return value

None

Related

convertLightmap

MEL examples

// Render the lower left corner of the image to the render view with
// progress messages. persp camera is used to render the image.
Mayatomr -preview -v 5 -region -rr 0 0 300 300 -camera perspShape;

// Batch render occlusionLayer with occlusionCamera, with 1k square
// resolution.
Mayatomr -render -layer occlusionLayer -xResolution 1024 -yResolution 1024;

// Export the scene to test.mi file with tabstop value 8.
// Texture files exported with absolute path, and all other file entries
// are exported with no path.
Mayatomr -mi -tabstop 8 -xp "3313333333" -file "test.mi";