MayaMan Help Contents

# Scripting MayaMan

All MayaMan attributes are regular MEL attributes, and can thus be scripted just like Maya attributes.

#### Accessing Global Attributes

This is best explained through an walkthrough/example

#### Accessing Per Model Attributes

This is also best explained through an walkthrough/example

#### MayaManInfo/MayaManSetData Commands

If you are using MayaMan in your production pipelines, you might also like to know about the MayaManInfo and MayaManSetData commands.

These commands exist to help move data between MayaMan's internals, and external MEL scripts. As these are largely used internally, we won't document them fully here.

If you feel you need more scripting control over MayaMan, refer to the included MEL scripts that use these commands, or type 'help MayaManInfo' and 'help MayaManSetData' in the Maya script editor (with the MayaMan plugin loaded of course)

In the Script/Options Management section the first string argument used to select the attribute to operate on can be in one of two forms. If it's a MayaManNugget attribute then just use the name of the attribute, ie: "UserRibOptions". If it's the name of an attribute on a model or light attributes node then the fully qualified name must be used, ie: "MayaManAttributes1.mmma_UserRib".

#### MayaManInfo Details

Long Flag Name | Short Flag Name | Arguments | Purpose
-version | -v |  | Returns the mayaman version
-buildtime | -bt |  | Returns the time of the mayaman build
-rendererguinames | -rg |  | The names of the renderers as they appear in the GUI
-rendererinternalnames | -ri |  | The names of the renderers as they are stored internally
-searchpaths | -sp | "shader"|"archive"|"texture"|"display"|"procedural" | Get the indicated type of search paths
-netrenderhosts | -nrh |  | Gets the list of hosts to use for netrender
-pathmapnt | -pmn |  | Gets the list of path mappings for NT
-pathmapunix | -pmu |  | Gets the list of path mappings for linux
-getrendercameraname | -cam |  | Get the name of the camera mayaman will render through
-getvalue | -get | string | Returns the indicated mayaman internal value
-getrawstring | -grs | string | Returns the indicated mayaman internal value
-getarraysize | -gta | string | Returns the size of the array of values for the indicated mayaman internal value
-getminmaxstep | -mms | string | Gets the range of a mayaman internal value, for bounded scalars
-getlabels | -lbl | string | Gets the labels associated with a mayaman internal value (ie: for enum attributes)
-expandvariable | -exv | string | Get the expanded value for a single mayaman symbolic value, ie: PROJECTDIR
-expandvariables | -evs | string | Expand environment variables and other mayaman specific symbolic notations in the passed string
-hashstring | -hss | string | Compute a hash value for a string, same algorithm is used to decorate path names for uniqueness.
-getmodelattsobjs | -gmd | string | Returns the node that is connected to the passed node's mayamanAttributes attribute
-getmaterialattsobjs | -gmt | string | Returns the node that is connected to the passed node's mayamanMaterialAttributes attribute
-getlightattsobjs | -glg | string | Returns the node that is connected to the passed node's mayamanLightAttributes attribute
-createFurDescAtts | -cfd |  | Add mayaman specific attributes to furDescription objects
-archiveBound | -ab | string | Find the bounding box for an archive, only works with archives created by mayaman.
-vertexBlurSamples | -vbs | float | Returns the time values at which geometry will be sampled, argument is a frame number. NB: when 'linear blur' mode is enabled the value here will be the same as for motion blur
-vertexBlurBegin | -vbb | float | Returns the time values which will appear in MotionBegin blocks for geometry. NB: when 'linear blur' mode is enabled the value here will be the same as for motion blur
-motionBlurSamples | -mbs | float | Returns the time values at which transforms will be sampled, argument is a frame number
-motionBlurBegin | -mbb | float | Returns the time values at which will appear in MotionBegin blocks for transforms
-loadPreset | -lpr | string | Load the indicated preset file
-savePreset | -spr | string | Save the current mayaman state as a preset file
-registryall | -ra | string | windows only, get the indicated registry value from the 'all' section
-registryuser | -ru |  | windows only, get the indicated registry value from the 'user section
-activesetting | -as | string | Gets a value from the env or registry
-envvar | -ev | string | Gets a value from the env
-admin | -ad |  | windows only, Returns a value that indicates if mayaman is running with admin priviledges
-operatingsystem | -os |  | Returns the name of the operating system
-isPreviewing | -ip |  | Returns true if MayaMan is currently doing a preview operation

Script/Option management flags
-addToStringUnique | -ats | string string integer | Make sure the attribute indicaetd by the first string contains a line equivalent to the second string, if it is not present then it is inserted at the index indicated by the 3rd argument, use -1 to insert at the end of the list.
-removeFromString | -rfs | string string | If the attribute indicated by the first string contains a line equivalent to the second string then the matching line is removed.
-enableInString | -eis | string string integer | If the attribute indicated by the first string contains a line equivalent to the second string then the matching line is disabled in the script by inserting a comment flag apropos for the language. Language is selected with the 3rd argment, 0 = MEL, 1 = SHELL, 2 = RIB
-disableInString | -dis | string string integer | If the attribute indicated by the first string contains a line equivalent to the second string then the matching line (ignoring any disabling prefix) is enabled in the script by removing the comment flag apropos for the language. Language is selected with the 3rd argment, 0 = MEL, 1 = SHELL, 2 = RIB
-indexOfString | -ios | string string | If the attribute indicated by the first string contains a line equivalent to the second string then return the line number of the match, or -1 if there is no match.

MayaMan Help Contents