MEL MTOR commands:
Standalone mtor executable:
MEL Slim cmds:
Slim parameter expressions (to animate shader attrs):
One of the most useful expressions simply provides a hook into MEL:
[mel "getAttr -size curve1.controlPoints"]
A couple more examples:
[expr 5 * [mattr "sphere.translateX" $f]] $f < 10 ? [mattr "s.translateX" $f] : 0
As an example of running command line mtor, try this:
mtor -scene yourscene.ma % rg camName perspShape % genRib 5 % render 7 % quit [or] mtor -scene river_water.ma -cmd "rg camName perspShape; render 1"
Simple mtor MEL command:
mtor control setvalue -rg pixelSamples -value "4 4";
MEL proc to create appearances, etc.:
// Execute the following in a fresh copy of Maya
global proc slimCmdsSampler()
{
file -f -new;
setAttr "persp.tx" 4.7;
setAttr "persp.ty" 3.5;
setAttr "persp.tz" 4.7;
setAttr "persp.ry" 45.0;
cylinder;
directionalLight;
string $newPal = `slimcmd slim CreatePalette -new -edit`;
slimcmd $newPal SetLabel "FunPalette";
// slimcmd slim ReadSlimFile "/soft/apps/rat/4.5.1m40/lib/slim/shadingmodels.slim";
string $shdrHandle = `slimcmd $newPal CreateInstance -template "pixar,Constant"`;
$shdrID = `slimcmd $shdrHandle GetID`;
select -ne -replace nurbsCylinderShape1;
mtor control attach "surface" $shdrID;
mtor control renderspool;
}// slimCmdsSampler()
ST prim. variables, _Pref ref. geometry:
To associate ST values with CVs, do:
RenderMan->Vertex Variables->st: chord length or RenderMan->Vertex Variables->st: randomTo associate reference geometry (a frozen copy of your deforming geometry which gets associated with each deformed version, to enable you to 'pin' patterns and textures over a deforming surface), do:
RenderMan-> Vertex Variables-> _Pref:freezeOnce you have such ref. geometry traveling with your animating surface, here is a shader to make use of the reference:
surface mySurf (float Sticky = 0;
varying point __Pref = point "object" 0;
)
{
if( Sticky == 0 )
Ci = color noise( P );
else
Ci = color noise( __Pref );
}
Arbitrary prim. variables (mostly useful for per-particle attrs transfer):
RenderMan -> Attributes -> Level of Detail -> Attach LOD ControlNeed to add archivers too.
To create a trace set, do:
RenderMan -> Attributes -> Trace -> Create Trace SetTo use it, type its name in the 'Trace Set' textbox in your raytracing Slim appearance.
RenderMan-> Attributes-> Motion Samples-> AttachCan add archivers too.
RenderMan-> Attributes-> Soft Shadows-> Attach