Page 1 of 1

is_locked fucntion

Posted: Thu Jul 27, 2017 5:10 pm
by alynch
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?

Re: is_locked fucntion

Posted: Tue Aug 08, 2017 12:55 am
by louisVottero
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