code-google-com / pymel

Automatically exported from code.google.com/p/pymel
0 stars 0 forks source link

Locked node attributes are able to be unlocked, going against the definition of locked nodes. #300

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Describe the problem.
Locked node attributes are able to be unlocked using PyMEL, going against the 
definition of locked nodes and inconsistent with maya.cmds.

What Version of Maya are you using?
Maya 2013 x64 Service Pack 2

On what operating system? (be as specific as possible and include service
packs, 64bit vs 32bit, etc)
Windows 7 64bit

What Version of PyMEL are you using?
1.0.4

What is the expected output? What do you see instead?
If possible, provide a few lines of code to reproduce the problem. It helps us 
if your code will reproduce the problem from a new scene.
import pymel.core as pm
obj = pm.polyCube()[0]
obj.v.lock()
obj.lock()
obj.v.unlock()
# Allows the attribute to be unlocked, going against the definition of a locked 
node. #

Does maya.cmds exhibit the same problem?
#works as expected in maya.cmds
import maya.cmds as cmds
obj = cmds.polyCube()[0]
cmds.setAttr(obj + '.v', lock=True)
cmds.lockNode(obj, lock=True)
cmds.setAttr(obj + 'v', lock=False)
# RuntimeError: setAttr: Attribute 'pCube1.visibility' is from a locked node, 
so it cannot be unlocked. # 

Please provide any additional information below.
Maya's definition of a locked node:
(from 
http://download.autodesk.com/global/docs/maya2013/en_us/CommandsPython/lockNode.
html)
Locks or unlocks one or more dependency nodes. A locked node is restricted in 
the following ways:
It may not be deleted.
It may not be renamed.
Its parenting may not be changed.
Attributes may not be added to or removed from it.
**_Locked attributes may not be unlocked._**
Unlocked attributes may not be locked.

Note that an unlocked attribute of a locked node may still have its value set, 
or connections to it made or broken.

Original issue reported on code.google.com by deadper...@gmail.com on 9 May 2013 at 7:04