this one is fine but I don't have any obj or group nodes in maya scene so 
for example I use this below script in new maya scene 

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:-

doorBell01
doorBell02
doorBell03
doorBell04


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 




On Wednesday, June 24, 2020 at 5:27:13 PM UTC+5:30, Soham Parmar wrote:

> 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")
>
> This will work selection based.
>
> On 24-Jun-2020, at 5:03 PM, Vishal Kadam <[email protected] 
> <javascript:>> wrote:
>
> can this be possible using python or mel 
>
> On Wednesday, June 24, 2020 at 4:23:34 PM UTC+5:30, Vishal Kadam wrote:
>>
>> Need to create Multiple empty groups for the list of names in maya
>>
>> for example I have 
>> doorBell01
>> doorBell02
>> doorBell03
>> doorBell04
>>
>> need all the list names into empty groups in maya as doorBell01_GRP and 
>> if I want to add prefix as prop the first letter for every name should be 
>> capital, and remaining letters as it is  
>> so finally name of the groups should be 
>>
>> propDoorBell01_GRP
>> propDoorBell02_GRP
>> propDoorBell03_GRP
>> propDoorBell04_GRP
>>
>
> -- 
> 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] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/14e44f62-7452-4ef0-8f38-b272e42e30fdo%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/python_inside_maya/14e44f62-7452-4ef0-8f38-b272e42e30fdo%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>

-- 
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/c10894a3-2b40-4493-b884-0baadb8e10b7o%40googlegroups.com.

Reply via email to