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

Synopsis

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

Mayatomr is undoable, queryable, and NOT 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.

Return value

AnyThe return value depends on flag

In query mode, return type is based on queried flag.

Related

convertLightmap

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, renderNoSlaves, renderTarget, renderThreads, renderVerbosity, tabstop, updateHosts, updateRayrc, verbosity, xResolution, yResolution
Long name (short name) Argument types Properties
mental ray IPR flags
-immediateModeRender(-imr) boolean createquery
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/query, 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 createquery
Used with imr/immediateModeRender. Pause/resume mental ray IPR. If paused, attribute changes still update the internal database.
General purpose flags
-active(-a) create
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
-addIncludes(-ai) string create
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
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.
-fragmentChildDag(-fcd) create
In fragment mode, additionally translate any child DAG graph of transform nodes found in the current selection.
Default: translate just the selected object/instance
-fragmentExport(-fe) create
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
-fragmentIncomingShdrs(-fis) create
In fragment mode, additionally translate shading nodes which are connected to nodes found in the current selection (driving nodes).
Default: ignore connections
-fragmentMaterials(-fem) create
In fragment mode, additionally translate attached materials for shape/transform nodes found in the current selection.
Default: ignore attached materials
-init(-ini) create
Perform the initialization steps again for the integrated renderer, including loading startup files and redoing custom link and include commands.
For internal use only.
-listLinks(-ll) create
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.
-project(-prj) string create
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
-removeLinks(-rl) string create
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.
-renderVerbosity(-rv) uint create
Set the 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)
-updateRayrc(-ur) create
Reload maya.rayrc file to reinitialize mental ray.
For internal use only.
-verbosity(-v) uint create
Set the plug-in 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)
Export flags
-binary(-bin) create
Export binary .mi format (write binary vectors in object definitions).
Default: off, write ascii format
-echo(-e) create
Export scene to .mi file by sending scene data to builtin mental ray and executing its echo command.
Default: off
-exportFilter(-xf) int create
This allows to remove certain types of mental ray entities from exported .mi files. The integer argument is a bit set 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
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
-exportPathNames(-xp) string
Export option for the file references such as : link library, include mi file, texture file, lightmap, etc.
All file references can be forced to be the same with values
abs-absolute rel-relative non-nopath
Alternatively, the string can specify each individual file reference, with each character in the string representing a single file reference entry, with meaning
0-nochange 1-absolute 2-relative 3-nopath, or
0-nochange a-absolute r-relative n-nopath.
The file reference 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, demand load object mi file, and relative path for texture file, lightmap, output image, finalgather map, photon map If the individual file reference string is not fully specified, the last character will be assumed for all remaining file references. So, for example, "-xp aarra" is equivalent to "-xp aarraaaaaa"
-exportStartFile(-xsf) create
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
-file(-f) string create
Set the file name and path for .mi export or .mi echo.
Default: untitled
-miStream(-mi) create
Export scene to .mi file.
Default: off
-padframe(-pad) uint create
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
-perframe(-pf) uint create
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
-tabstop(-tab) uint create
Set the number of space characters used to indent lines in the .mi files.
Default: 4
Rendering flags
-addHosts(-ah) string create
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.
-camera(-cam) string create
Use this camera as the render camera for preview rendering. Camera shape name is expected.
Default: render globals camera
-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.
-license(-lic) string create
Obsolete flag.
-listHosts(-lh) create
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.
-logFile(-log) create
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.
-preview(-pv) create
Perform preview rendering with integrated mental ray. Only for interactive rendering. (Not for batch rendering) Cannot be specified with r/render.
Default: off
-previousView(-prv) create
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
Preview render only the current region rectangle of the Maya render window.
Default: render whole image
-regionRect(-rr) uint uint uint uint create
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
-removeHosts(-rh) string create
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.
-render(-r) create
Performs rendering in batch mode with integrated mental ray. Only for batch rendering. (Not for interactive rendering) Cannot be specified with pv/preview.
-renderNoSlaves(-rns) create
If given it allows to render almost everything on the master machine (where Maya is running), thus reducing the workload on the slave machines.
-renderTarget(-rtg) string create
Render the specified render target. When this flag is set, mental ray will not render the scene. Instead, it will render the image processing graph rooted at the node specified by the target string. The purpose of this flag is to use mental ray for compositing and general image processing tasks. FLAGHEADER Network Rendering flags, used with other rendering flags FLAG renderNoMaster rnm CREATE NO_QUERY NO_EDIT NO_MULTI COMMENT If given it allows to render almost everything on slave machines, thus reducing the workload on the master machine (where Maya is running).
-renderThreads(-rt) uint create
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
-updateHosts(-uh) create
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.
-xResolution(-x) uint create
Set the output image x resolution for preview rendering.
Default: render globals image width
-yResolution(-y) uint create
Set the output image y resolution for preview rendering.
Default: render globals image height

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.

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";