EagleZ, you're right! It works now...now I understand why my original attempt wasn't working. Thanks!
On Sunday, January 5, 2014 4:45:16 PM UTC-6, Aren Voorhees wrote: > > 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/58b64201-9708-4396-818b-46fa952ea533%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
