Unlock

Introduced

v4.0

Description

Unlocks an object and all its children, or a specific parameter.

Scripting Syntax

Unlock( [InputObjs], [Level], [Password], [RemoveAll] );

Parameters

Parameter Type Description
InputObjs String List of objects to lock. Can be objects or parameters.

Default Value: Current selection.

Level siLockLevel The lock level is a bit field value that represent a area that is locked. The maximum level is siLockLevelAll which is all the level combined. One or many level can be set on an object. When the level is 0 (siLockLevelNone) the lock is removed.

Default Value: siLockLevelAll

Password String If the scene locks are protected by a password, the password needs to be supplied to unlock objects.
RemoveAll Boolean Force removing all locks information (all lock masters) on the object and on all its children including the parameters locked.

Note that when this flag is True, any objects (not locked or locked) can be selected. For example if the scene root object is selected then all locks in the scene will be removed. This can be used to clean a scene for example.

Default Value: False

Examples

JScript Example

// JScript example that show how to lock an unlock object and parameters

NewScene(null, null);

CreatePrim("Cone", "MeshSurface", null, null);

CreatePrim("Cube", "MeshSurface", null, null);

// Lock the subdivu parameter on the cone.

Lock("cone.polymsh.geom.subdivu", siLockLevelManipulation);

// Lock the Cube object

Lock("cube", siLockLevelAll);

// Now unlock the parameter.

Unlock("cone.polymsh.geom.subdivu", siLockLevelAll, null, null);

// Display the lock level, (siLockLevelAll)

var oObj = GetValue("cube")

logmessage ("The level of lock for the cube is : " + oObj.LockLevel);

// We can unlock only one of the level and keep the others.

Unlock("cube", siLockLevelManipulation, null, null);

// Display the lock level, (siLockLevelConstruction + siLockLevelAnimation)

var oObj = GetValue("cube")

logmessage ("The level of lock for the cube is : " + oObj.LockLevel);

// then unlock everything

Unlock("cube", siLockLevelAll, null, null);

// Display the lock level, (siLockLevelNone)

var oObj = GetValue("cube")

logmessage ("The level of lock for the cube is : " + oObj.LockLevel);

See Also

Lock InspectLocks ProjectItem.SetLock ProjectItem.UnSetLock Parameter.SetLock Parameter.UnSetLock