Hey All,
I am just getting started out trying to understand Python (and programming in
general). I'm trying to make a simple script that renames all my selected
objects. Obviously this should be super simple, but when I run what I have so
far, it only renames one object regardless of what is selected.
import maya.cmds as cmds
def renameFun ():
mySel = cmds.ls (selection = True)
newName = "Test_Name"
for i in range (len(mySel)):
cmds.rename(newName + "_%d" % i)
I am calling the function when I run it in Maya. Any help would be very
appreciated!
Aren
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/3de1aeeb-93d6-4d26-a15d-d94e0d43eb0a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.