/
getModules
getModules
Description
Returns an array of all modules currently in the scene
The getModules command is useful in script procedures for automatically identifying the modules in the scene. The flags provide options for narrowing results based upon selection status, or module type.
The results of the command are saved to a module array which may in turn be passed to a subsequent command or procedure.
Functional area
Data retrieval
Command syntax
Syntax
getModules [-type string] [-primary] [-selected] [-fullPath] [-nameOnly] |
Arguments
None
Flags
Name | Flag arguments | Argument type | Exclusive to | Comments |
---|---|---|---|---|
type | 1 | string | — | Return only modules of the named type. |
primary | 0 | — | selected | Return only the current primary selection. |
selected | 0 | — | primary | Return only modules that are currently selected. |
fullPath | 0 | — | nameOnly | — |
nameOnly | 0 | — | fullPath | — |
Return value
string array
Examples
string $mds[] = `getModules -type BoneNode`; int $i; for( $i = 0; $i < $mds.getCount(); $i += 1 ) { print( $mds[$i] ); } print ($mds.getCount()); // In this small procedure, a module array called "$mds" is declared // and all scene modules of the type BoneNode are assigned to it. // The for loop iterates through the elements of the array and // prints each one to the interface. The last line prints the value // of $mds.getCount, an integer describing the number of modules // that were found in this instance.
Additional information
Related commands
, multiple selections available,