Mayatomr command

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 plug-in, including .mi file export, preview and batch rendering, network rendering and shader management.

Return value

Any

The return value depends on flag

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

Related

convertLightmap

Flags

General purpose flags

-verbosity(-v) uint
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)
-renderVerbosity(-rv) uint
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)
-project(-prj) string
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)
Reload maya.rayrc file to reinitialize mental ray. For internal use only.
-addIncludes(-ai) string
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
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
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)
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)
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)
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)
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)
In fragment mode, additionally translate attached materials for shape/transform nodes found in the current selection. Default: ignore attached materials
-fragmentIncomingShdrs(-fis)
In fragment mode, additionally translate shading nodes which are connected to nodes found in the current selection (driving nodes). Default: ignore connections
-init(-ini)
Perform the initialization steps again for the integrated renderer, including loading startup files and redoing custom link and include commands. For internal use only.
Note: The above flags can appear in Create mode of command.

Rendering flags

-preview(-pv)
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)
Performs rendering in batch mode with integrated mental ray. Only for batch rendering. (Not for interactive rendering) Cannot be specified with pv/preview.
-camera(-cam) string
Use this camera as the render camera for preview rendering. Camera shape name is expected. Default: render globals camera
-previousView(-prv)
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)
Preview render only the current region rectangle of the Maya render window. Default: render whole image
-regionRect(-rr) uint uint uint uint
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) uint
Set the output image x resolution for preview rendering. Default: render globals image width
-yResolution(-y) uint
Set the output image y resolution for preview rendering. Default: render globals image height
-logFile(-log)
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) uint
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
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.
-renderTarget(-rtg) string
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).
-renderNoSlaves(-rns)
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)
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
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
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)
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) string
Obsolete flag.
Note: The above flags can appear in Create mode of command.

mental ray IPR flags

-immediateModeRender(-imr) boolean
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
Used with imr/immediateModeRender. Pause/resume mental ray IPR. If paused, attribute changes still update the internal database.
Note: The above flags can appear in Create mode and Query mode of command.

Export flags

-miStream(-mi)
Export scene to .mi file. Default: off
-file(-f) string
Set the file name and path for .mi export or .mi echo. Default: untitled
-perframe(-pf) uint
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) uint
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) uint
Set the number of space characters used to indent lines in the .mi files. Default: 4
-echo(-e)
Export scene to .mi file by sending scene data to builtin mental ray and executing its echo command. Default: off
-binary(-bin)
Export binary .mi format (write binary vectors in object definitions). Default: off, write ascii format
-exportFilter(-xf) int
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
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)
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
-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: no change.

For example, "-xp aarrararra" will use absolute path for link library, 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"

Note: The above flags can appear in Create mode of 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";