Multitude Manager

Introduction

The Multitude Manager is a new editor that helps you when dealing with large numbers of objects within Maya.

It is normally very difficult to specify changes to multiple objects at once, and TDs working on large scenes would commonly resort to writing small MEL scripts directly into Maya's Script Editor in order to achieve what they need. Hopefully this tool will avoid a large amount of that, but there will always be cases where you can't beat a hand crafted script.

The Multitude Manager has multiple tabs, each containing a different function as outlined below.

Affect Nodes

You must first specify which nodes in your scene you wish to consider.

You can have the functions in the Multitude Manager deal with all nodes in your scene or restrict it to only affect nodes of a particular type (e.g. transform, joint, mySuperCoolCustomNode), or only nodes within your current selection.

Using the 'Selection' mode is a good way of whittling down to a more specific group of nodes. For example, if you had a scene with hundreds of lights you might first select all your spotlight nodes, then within that selection choose a percentage (30% of all spotLights) or select a sub-set based on their attribute values (e.g. if their intensity is set to 2).

Select Percentage

Here you can simply dial in a percentage (0 to 100) and that approximately that proportion of your nodes will be selected (the more nodes you have the more accurate this proportion becomes).

This simple function is a great way of "mixing up" a section of CG objects. For example, if you create 100 cubes they will all look identical, but you can select say 30% of them and assign a different shader. Then select 60% of them and rotate them to a different angle, rinse, repeat, until everything is nicely broken up.

Each time you run this function it will pick a different random selection. So, if you run it once and it makes a selection you don't like (say, if it is too clumpy or linear) then simply undo, and run it again for a new set.

An easy way of selecting all nodes of a particular type (e.g. all locators in your scene) is to set the tool to affect only nodes of the type (e.g. "locator") and then select 100 percent of them.

When a selection is made a message will be printed in Maya's command feedback area telling you how many nodes were matched.

Select by Attributes

This function allows you to pick nodes in your scene that have attribute values matching one or more rules.

On the left side of a rule you type in the name of the attribute to query, and in the field on the right the value you wish to test against. Between the fields you choose from the dropdown menu the type of test: equals, includes, greater/less than, exists or wildcard match (uses same syntax as the gmatch MEL command), and also their negative predicates. You can add more rules than the default one, and each additional rule can then be a logical AND or OR rule.

When you have set up your rules you can click the button to add any matching nodes to your current selection or to have them replace your current selection.

When a selection is made a message will be printed in Maya's command feedback area telling you how many nodes were matched.

Set Attribute

This function allows you to set an attribute on multiple nodes at once. You can already do this in Maya to a limited extent by selecting your nodes and changing a value in the channel editor - it will then be propagated to them all.

However, this function in the Multitude Manager allows you to set attributes that do not appear in the channel editor (or cannot appear there, like string attributes).

Also, you can tick the 'Evaluate value as MEL expression' checkbox and enter a small MEL expression in the value text field, which will be run separately for each node. For example, you might type in rand(40,80) as the value, which will set the given attribute to have a value between 40 and 80 on each node.

Run Expression

The Run Expression tab allows you to enter a small MEL expression which will be run independently on each of your nodes.

This function makes available some special variables which you can use to easily refer to the nodes from within your expression. The variable $node refers to the current node being operated on from your selection, $parent refers to its parent node in the hierarchy, and $shape refers to its shape node if it is not itself a shape node (in which case this will be an empty string). See notes below on dealing with transform/shape nodes.

So, the MEL you type in here will be run once per matching node (i.e. All, of type, or in selection) with $node replaced by the full path of the node that the expression is being applied to.

The possibilities for modifying your scene with this function are limited only by your own knowledge of MEL scripting. This function doesn't do anything particularly special, but is a handy and more accessible alternative to writing lots of little throwaway scripts when manipulating large numbers of objects in Maya.

Transform and Shape Nodes

The attributes on your objects can be divided between the transform node and the shape node. For example, the position of an object is on the transform node (.translateX, .translateY and .translateZ) whereas anything specific to the kind of object (e.g. .intensity on a light, or .rate on a particle emitter) will be on the shape node.

It is a common problem to be trying to set shape attributes on a transform, or vice versa. If you have a selection of shape nodes and you wish to set an attribute on their transform nodes you have two choices. Firstly, you can press the up arrow key within a Maya viewport, which will walk your selection one step up in the hierarchy (i.e. each selected node will now have its parent selected, which from a shape node is its transform). The second option is to use the Run Expression function, which provides you with variables for easily accessing both the transform and shape nodes.

Saved Settings

When you successfully execute a function, the settings you use will be stored in your Maya profile so that when you next open the same tab the Multitude Manager (even after closing and reopening Maya) they will still be there. These settings are all saved into your userPrefs.mel file, with names beggining with 'multitudeManager', should you wish to remove them for any reason.

The exception to this is that any additional rules you specify in the 'Select by Attribute' function will not be retained.

Contact

The Multitude Manager is written by Andrew Chapman. Please email chapman@technolumiere.com with comments or questions.


Last Updated: 02/10/2003