Python Maya, handy renaming script using python

preview_player
Показать описание
#Python #Maya #Rename
Рекомендации по теме
Комментарии
Автор

For everyone as lazy as me here is the renameTool script:


def myRenameFunc(a_name, a_padding, a_suffix):
listObj = cmds.ls(selection=True)
for count, obj in enumerate (listObj):
cmds.rename (obj, a_name +"_"+ str(count + 1).zfill(a_padding) +"_"+ a_suffix )


when ready to use:


import renameTool

, how many digits you want, "suffix" )


thank you this helped me out a lot xD

Lupuscrafter
Автор

You'd better don't enumerate list and use cmds.ls(sl=True)[number]. It helps avoiding errors in complex hierarchy.

FormJune
Автор

can you create count the numbers in maya?

MS.Mems
Автор

How to select different object type? is is possible to make a simple UI for this?

emadtayefeh
Автор

hi awesome, where can i found the script?

catitayay
welcome to shbcf.ru