Thank you very mutch, you are my hero!
import maya.cmds as cmds
ShaderNames = cmds.ls ('phong*', mat=True)
NewNames = ('Name1', 'Name2','Name3','Name4','Name5',)
for i in xrange(len(ShaderNames)):
cmds.rename (ShaderNames[i] , NewNames[i])
That is my final resoult.
Am Donnerstag, 23. Februar 2017 18:53:08 UTC+1 schrieb Michał Frątczak:
>
> smth like this...
>
> for i in xrange(len(ShaderNames)):
> rename ShaderNames[i] NewNames[i]
>
>
> W dniu 2017-02-23 o 17:14, denis hoffmann pisze:
>
> Hey guys,
>
> I want to rename all shaders with names from a list.
>
> so I make a list of all shaders and a var with all names I want to have.
>
> ShaderNames = [u'Shader0', u'Shader1', u'Shader2', u'Shader3', u'Shader4',
> u'Shader5']
>
> NewNames = ['Name1', 'Name2', 'Name3', 'Name4', 'Name5']
>
>
> what is the solution if I want to have my "Shader0" new name is "Name1"
>
> Thank You very mutch!!!
>
>
>
>
>
--
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/eb75ed5c-b026-4918-a96d-fe639c8d7bb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.