import maya.cmds as cmds
# Get a list of all nodes that end with '_M'
nodes_to_rename = cmds.ls("*:*_M")
# Rename each node to end with '_Mocap_M'
for node in nodes_to_rename:
new_name = node.replace("_M", "_Mocap_M")
cmds.rename(node, new_name)
nodes_to_rename = cmds.ls("*:*_L")
for node in nodes_to_rename:
new_name = node.replace("_L", "_Mocap_L")
cmds.rename(node, new_name)
nodes_to_rename = cmds.ls("*:*_R")
for node in nodes_to_rename:
new_name = node.replace("_R", "_Mocap_R")
cmds.rename(node, new_name)
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme