This script takes an input and output pattern and applies it to the
selection This allows you to have much more control over renaming
objects than Maya normally provides. You can also add incremental
numbers anywhere in the name, not just at the end of the name.
Features:
-
Capture part(s) of a name and reorder them.
-
Replace
-
Increment and de-increment numbers anywhere in the name
-
Changeremoveadd prefix, suffix, and in between.
-
Rename is optional, return a list of new names to use elsewhere.
$1 - $9: Captures text into a variable to be used elsewhere
#: In the output filter this inserts a number that increment positively or negatively
Example: selected name = ['lf_index_ctrl_4', 'rt_index_ctrl_2', 'rt_middle_ctrl_1']
Input Filter = '$1_$2_ctrl_$3'
Output Filter = '$1_fk#Ctrl$3_$2'
Starting Number = 5
Add/Subtract = 'subtract'
The renamed list would look like this.
['lf_fk5Ctrl4_index', 'rt_fk4Ctrl2_index', 'rt_fk3Ctrl1_middle'].