On Sat, Oct 29, 2016 at 1:46 PM <[email protected]> wrote:

> Hi
>
> I have a question. I want to create in pymel a 'while True' loop
> how can I add variable to my rename object?
>
> example
>
> i = 1
> while True:
>    pm.rename('group' i '|old_name, 'new_name')
>
>
>
> so for example i = 1 so my 'group' should be 'group1'. I am not sure how
> can I make it. How to add variable input into the name of the object?
>

You can use string formatting, to create a string with variable values:

    pm.rename('group{0}'.format(i), '|old_name, 'new_name')

Out of curiousity, what breaks you out of your 'while True' loop? Or was
this only a partial example of what you intend to do?



> --
> 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/debb1b4e-9e16-46d5-8f8b-f5c6a5003b38%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPGFgA3n5-LeYiPCExWMSd5q9_geHNsn_oTtErwDzk0dS8BEZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to