Give pymel a shot:

import pymel as pm
for mesh in pm.ls(type='mesh'):
    p = mesh.getParent()
    if p and not p.endswith("_geooo"):
        print 'renaming %s' % p
        p.rename("%s_geooo" % p.name())

It's not doing things much differently from your version really, just a bit
more concise, allowing you to avoid all the long-name/short-name issues that
come up in maya scripting.


On Mon, Nov 24, 2008 at 3:40 PM, Seth Lippman <[EMAIL PROTECTED]> wrote:

>
> Yep, false alarm. Deleting all prefs and envs this code works fine...
> I'll will find the offending code / scriptJob and post it if its
> anything interesting.
>
> But, it the spirit of discussing Python in Maya, is this the most
> efficent way to be renaming things? Is there a better way?
>
> It seems simple enough as it is now..
>
> >
>


-- 


- Ofer
www.mrbroken.com

--~--~---------~--~----~------------~-------~--~----~
Yours,
Maya-Python Club Team.
-~----------~----~----~----~------~----~------~--~---

Reply via email to