Search code examples
pythonlistmayagetattr

how to get or set object's attribute from a list in maya python?


list = cmds.ls(sl = True)

How to get or set Attr e.g translateY for objects in list.


Solution

  • If you use pymel it's a lot simpler...

    sel = selected()
    
    for i in sel:
        print i.ty.get()
        i.ty.set(i.ty.get() + 1)