alynch
Posts: 11
Joined: Mon Feb 15, 2016 11:15 pm

is_locked fucntion

I am trying to use the function attr.is_locked() but i keep getting a error.

Code: Select all

from vtool.maya_lib import attr

cmds.polySphere(name='testSphere')
cmds.setAttr('testSphere.translate', lock=True)
attr.is_locked('testSphere.translateX')

# Error: AttributeError: file <maya console> line 5: 'module' object has no attribute 'is_locked' # 
Is this no longer supported?
louisVottero
Site Admin
Posts: 202
Joined: Sat Aug 29, 2015 8:50 am

Re: is_locked fucntion

Hey alynch

I just checked the latest code and is_locked is there under the attr module.

What version of Vetala are you using?

Btw, here is the code for the is_locked function, in case it helps:

Code: Select all

if cmds.getAttr(node_and_attribute, l = True):
    return True
else:    
    return False

Return to “Help”