Yup or even more modular;
import maya.mel as mel
side = "L"
mel.eval('searchReplaceNames "pSphere1" "%s_arm" "all"' % side)

the other cool thing about string formatting this way, is you can do padded
numbers from integers
eg;
'rendername.%04d.png' %12  will result in
'rendername.0012.png'

more info here https://docs.python.org/2/library/stdtypes.html

M.

P.S. Hi Kurian!


On Fri, Sep 18, 2015 at 12:49 PM, Kurian O.S <[email protected]> wrote:

> import maya.mel as mel
> newName = "L_arm"
> mel.eval('searchReplaceNames "pSphere1" "%s" "all"' % newName)
>
>
> On Fri, Sep 18, 2015 at 12:38 PM, Félix CT <[email protected]> wrote:
>
>> searchReplaceNames "side_limb" "L_arm" "all"
>
>
>
>
>
> --
> --:: Kurian ::--
>
> --
> 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/CANEMyhOnWsMyLt%2BFWkTrL1Yb71wDxyCcBS3oL%2BGbYB%3Dsmga5bg%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CANEMyhOnWsMyLt%2BFWkTrL1Yb71wDxyCcBS3oL%2BGbYB%3Dsmga5bg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Mark Stewart

My LinkedIn Profile
<http://www.linkedin.com/profile/view?id=27770423&locale=en_US&trk=tab_pro>

-- 
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/CAKcoZEXt1d1ZteW%2Bhn55BVQcLQwKKBBXz-W%2BYxuOkFPmsYvYjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to