MAXScript Language Reference > 3ds Max Objects > Interfaces > Core Interfaces > Core Interfaces Documentation > L >

# Interface: LockedTracksMan

Interfaces > Core Interfaces > LockedTracksMan

| Core Interfaces - Quick Navigation

The LockedTracksMan Core Interface available in 3ds Max 2010 and higher exposes properties and methods related to animation track locking.

Properties:

    LockedTracksMan.unLockOverride : bool : Read|Write

Get/Set the state of the Override All Locks option.

When set to true, the locked state of locked tracks will be temporarily overridden and their values can be changed.

When set to false, the values of locked tracks cannot be changed.

Methods:

## Get and Set Locks

    <void>LockedTracksMan.SetLocks <bool>lock <&maxObject array>anims <&maxObject array>clients <&index array>subNums <bool>includeChildren

    anims is In and Out parameter
    clients is In and Out parameter
    subNums is In and Out parameter

Sets the locks of the specified tracks to the Boolean value supplied as first argument.

anims is the array of subAnims

clients is the array of parent controllers of the subAnims.

subNums is the array of indices of the subAnims within their clients' children hierarchies.

When includeChildren is passed as true, children tracks will also be locked/unlocked.

EXAMPLE:
    --Initialize three arrays to pass to the setLocks() method
    theAnims = #()
    theClients = #()
    theSubNums = #()
    --Loop through all selected tracks in the current TrackView
    for i in 1 to trackviews.current.numSelTracks() do
    (
    --grab the parent of the current selected track
    local theParent = trackviews.current.getParentOfSelected i
    --if the parent is valid,
    if theParent != undefined do
    (
    append theClients theParent --collecttheparrent
    --grab the sub-number of the subAnim relatively to the parent
    local theSubnum = trackviews.current.getSelectedSubNum i
    --get the subAnim track with that index from the parent
    local theSubanim = getsubAnim theParent theSubnum
    append theAnims theSubanim -- collectthe subanim
    append theSubNums theSubnum -- collect the index
    )--end if parent not undefined
    )--end i loop
    --Finally, set the locks of all selected tracks
    lockedTracksMan.setLocks true theAnims theClients theSubNums false

    <void>LockedTracksMan.  ToggleLocks <&maxObject array>anims <&maxObject array>clients <&index array>subNums <bool>includeChildren

    anims is In and Out parameter
    clients is In and Out parameter
    subNums is In and Out parameter

Toggles the locked state of the given subAnims.

anims is an array of the SubAnims to toggle.

clients is an array of the parents of the SubAnims.

subNums is an array of the indices of the SubAnims within the children hierarchy of their parents.

If includeChildren is passed as true, children of the track will also be toggled.

    <bool>LockedTracksMan.GetLocked <maxObject>anim <maxObject>client <index>subNum <bool>checkOverride

Returns the locked state of the given track.

anim is the subAnim

client is the parent controller of the subAnim.

subNum is the index of the subAnim within the client's children hierarchy

If checkOverride is passed as true, the state of the Lock Overrides will also be respected, returning locked tracks as unlocked if an Override is active.

EXAMPLE:
    --Loop through all selected tracks in the current TrackView
    for i in 1 to trackviews.current.numSelTracks() do
    (
    --grab the parent of the current selected track
    local theParent = trackviews.current.getParentOfSelected i
    --if the parent is valid,
    if theParent != undefined do
    (
    --grab the sub-number of the subAnim relatively to the parent
    local theSubnum = trackviews.current.getSelectedSubNum i
    --get the subAnim track with that index from the parent
    local theSubanim = getsubAnim theParent theSubnum
    --Check if the track is locked, unlocked or locked but overridden
    --and format the information about the track and its locked state:
    if lockedTracksMan.getlocked theSubanim theParent theSubnum true then
    format "LOCKED: % Parent:% Subnum:% \n" theSubanim theParent theSubnum
    else
    format "Not Locked: % Parent:% Subnum:% \n" theSubanim theParent theSubnum
    )--end if parent not undefined
    )--end i loop

    <void>UnlockChildren <&maxObject array>anims <&maxObject array>clients <&index array>subNums

    anims is In and Out parameter
    clients is In and Out parameter
    subNums is In and Out parameter

Unlocks the children of the specified controllers.

Available in 3ds Max 2011 and higher.

## Checking Locks

    <bool>LockedTracksMan.IsLockable <maxObject>anim <maxObject>client <index>subNum

Returns true if the given subAnim can be locked, false if it cannot be locked.

anim is the subAnim to check.

client is the parent controller of the subAnim to check.

subNum is the index of the subAnim within the client's children hierarchy

    <void>LockedTracksMan.FindLockedAnims <bool>locked <bool>checkOverride <maxObject>refTarget <&maxObject array>anims <&maxObject array>clients <&index array>subNums

    anims is In and Out parameter
    clients is In and Out parameter
    subNums is In and Out parameter

Returns the tracks with the given locked state.

locked is the state to search for - either true or false.

checkOverride defined whether to take into account any Overrides or not.

refTarget is the root maxObject to scan for locked/unlocked tracks.

anims is a by-reference array to populated with the SubAnims

clients is a by-reference array to be populated with the parents of the SubAnims

subNums is a by-reference array to be populated with the indices of the SubAnims within the children hierarchy of their parents.

EXAMPLE:
    (
    --Find all unlocked tracks of Box01
    Anims = #()
    Clients = #()
    SubNums = #()
    --Collect the unlocked tracks without taking Overrides into account:
    LockedTracksMan.FindLockedAnims false false $Box01 &Anims &Clients &SubNums

    for i = 1 to a.count do
    format "% % %\n" Anims[i] Clients[i] SubNums[i]
    )
OUTPUT:
    Controller:Position_Rotation_Scale undefined 1
    Controller:Position_XYZ Controller:Position_Rotation_Scale 1
    Controller:Bezier_Float Controller:Position_XYZ 1
    Controller:Bezier_Float Controller:Position_XYZ 2
    Controller:Bezier_Float Controller:Position_XYZ 3
    Controller:Euler_XYZ Controller:Position_Rotation_Scale 2
    Controller:Bezier_Float Controller:Euler_XYZ 1
    Controller:Bezier_Float Controller:Euler_XYZ 2
    Controller:Bezier_Float Controller:Euler_XYZ 3
    Controller:Bezier_Scale Controller:Position_Rotation_Scale 3

    <bool>LockedTracksMan.IsAnimOverrideUnlocked <maxObject>anim

Returns true if the given subAnim track is unlocked via an Override, false otherwise. It will return true if an Override is active even if the subAnim is not locked.

## Uber-Override Stack

    <void>LockedTracksMan.PushUberUnLockOverride()

Pushes an Override on the Uber-Unlock Override stack.

    <void>LockedTracksMan.PopUberUnLockOverride()

Pops an Override from the Uber-Unlock Override stack.

    <boolean>LockedTracksMan.GetUberUnLockOverride()

Returns true if the Uber-Unlock Overrides stack contains any Overrides, false if there are no Overrides on the stack.

## Expose UI

     <void>SetExposedUI <bool>expose <&maxObject array>anims

    anims is In and Out parameter

Sets the Exposed UI state of the anims supplied by the second argument to the Boolean value provided by the first argument.

Available in 3ds Max 2011 and higher.

    <bool>GetExposedUI <maxObject>anim

Returns the Exposed UI state of the controller supplied as argument.

Available in 3ds Max 2011 and higher.