Wildcards
Selecting nodes using wildcards in the Input Box
This tutorial originated on the 3D Animation weblog Set Driven Key.
You may already be familiar with the Input Box in Maya. It's a text field on the status line (on the top right of the screen) where you can type in the name of an object in order to select it. Type in "persp" and hit enter, and the perspective camera will be selected.
(Depending on which version of Maya you are using, the Input Box will look like either of the images below.)
A cool function of the Input Box is the ability to use wildcards (? and *) to select multiple objects at once. This makes it a very handy selection tool.
For instance, let's say you have several hundred objects in your scene that have "post" in their name (post1, post2, post3, postLeft, postRight, etc . . . ) and you want to select them all to apply the same shader to them. Simply type *post* into the Input Box, and Maya will select all the objects that have the word post in them.
Another use for wildcards is when you're trying to select a node whose exact name you can't remember. Maybe you're looking for a particular piece of geometry parented deep within your scene somewhere, but you can't quite remember the name. It's called cyclorama_something. (Sphere? Dome? Card? - you can't remember). Just enter cyclorama* into the text field.
The sky's the limit as far as potential uses. Basically, it's a great tool for tracking down objects that are scattered throughout your scene - either for single nodes whose exact names you can't remember or for multiple objects at once.
Here's a quick guide to using the wildcards:
? - designates a single character variable . So if you enter cube?, you might get back
cube1
cube2
cubeF
but not
cubeUpper
icecube
mcube
The ? can appear anywhere in the string. cube?, ?cube, and c?ube are all valid uses.
* - designates a multi-character variable. So if you enter thumb*, you'll get back
thumb4
thumbLeft
thumbRight
You can place the * anywhere in the string. thumb*, *thumb, and th*umb are all valid uses.
Multiple wildcards are allowed in one entry.
eg: If you enter lower*Button? you could get:
lowerLeftButton1
lowerLeftButton2
lowerRightButton1
The Input Box isn't the only place that you can use wildcards. You can also incorporate them into MEL scripts. eg: select "locator*" ;
In fact, used this way, they are a very powerful tool for creating automated batch processes in your scenes. They also add an extra incentive for keeping consistant naming conventions throughout your projects. If all the characters in your scene follow the same naming convention (perhaps they all have root points named charRoot_name), then it becomes easy to select them all in a script to perform some sort of automated task. All it takes is one line of MEL: select "charRoot_*"
That's it for today!
I hope that you enjoyed the lesson. Feel free to email me with any questions or corrections. For more tips and tutorials, check out my weblog: Set Driven Key.
Author: pdipierro
Submitted: 2009-10-02 00:29:06 UTC
Tags: Wildcards, node selection, and mel
Software: Maya
Views: 17,290
Related Items
-
Vray Exterior Lighting Daylight Settings - rendering forest scene 3D Model
$39.99 (USD) -
'The General' Toy Train 3D Model
$115.00 (USD) -
Vray Night Lighting Scene Rendering Modern House 3D Model
$49.99 (USD) -
SUPER GENERAL PORTABLE AC WHITE 3D Model
$14.99 (USD) -
Sconce Light 3D Model
$27.00 (USD) -
Pool Table Light Fixture 3D Model
$19.00 (USD) -
Mandala: A Stable Diffusion renderer 1.1.0 for Maya (maya plugin)
$89.00 (USD) -
Candelabrum Sconce Light 3D Model
$85.00 (USD) -
Batch Studio Renderer for 3dsmax 1.0.0 (3dsmax script)
$20.00 (USD)