from maya import cmds
def addPrefix(prefix):
for obj in cmds.ls(sl=True):
cmds.rename(obj, prefix + obj)
def addSurfix(surfix):
for obj in cmds.ls(sl=True):
cmds.rename(obj, obj + surfix)
addPrefix("test")
addSurfix("test")
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/14e44f62-7452-4ef0-8f38-b272e42e30fdo%40googlegroups.com.
from maya import cmds
mel.eval("CreateEmptyGroup;")
def addPrefix(prefix):
for obj in cmds.ls(sl=True):
cmds.rename(obj, prefix + obj)
addPrefix("prop")
Result will create a empty group node with prefix like
propnull1
I want the result should be
propNull1
so here prop Will be in lowercase and null1 only First first letter should be caps
I have a list of names in a text file
example:-
so final output should be
propDoorBell01
so in this case only D should be in caps with prop as prefix and remaining should be same
Actually I have a list of names in a text file and I want to rename them by adding prefix and only only first letter should be caps,
I have tried to do this by renaming tools but couldn't find any,
then I thought this could be done with python butI don't know How
I know its confusing Hope you understand what I need
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
from maya import cmds
mel.eval("CreateEmptyGroup;")
def addPrefix(prefix):
for obj in cmds.ls(sl=True):
cmds.rename(obj, prefix + obj.capitalize())
addPrefix("prop")
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/3727d683-2867-49dc-8c38-fd5ccd4ae316o%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/14e44f62-7452-4ef0-8f38-b272e42e30fdo%40googlegroups.com.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/3727d683-2867-49dc-8c38-fd5ccd4ae316o%40googlegroups.com.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/DA57D323-A31B-4D23-8C3D-A1C3CA291B5A%40gmail.com.