I have a "direct path" to controller that I want to lock (CAT's timewarp) which is something like this:
How in the world do I lock that controller with this taken from maxscript help?
<void>LockedTracksMan.SetLocks <bool>lock <&maxObject array>anims <&maxObject array>clients <&index array>subNums <bool>includeChildren
This function needs an array of the track(s) to lock, an array of their parents and another array of indices of the tracks within their parents.
For example, if you create a Teapot and want to lock its Position and Rotation controllers including their sub-controllers, you would say
tp = teapot()
lockedTracksMan.setLocks true #(tp, tp) #(tp, tp) #(1,2) true
This creates the teapot, writes it to variable tp, then locks the sub-anims tp (position track) and tp (rotation track) which have both as parents tp (one entry each in the second array). The third array contains the indices of the sub-anims within their respective parents (first and second sub-anim of Transform track). The last flag says that all their sub-controllers (X,Y,Z position and rotation sub-anims) should also be locked. The first argument (true) tells the function you want to set the flag, false unlocks, but the children unlocking doesn't seem to work, at least in Max 2010, so you have to go through all the sub-controllers one by one.
This is equivalent to
lockedTracksMan.setLocks true #(tp.position.controller, tp.rotation.controller) #(tp.transform.controller, tp.transform.controller) #(1,2) true
So in your case you would say something like
lockedTracksMan.setLocks true #($.controller.layers.controller.timewarp.controller) #($.controller.layers.controller) #(2) false
because the timewarp controller is the second sub-anim of $.controller.layers.controller. I created a simple CAT character, added two layers and when I executed the above, the Timewarp track of the second layer got locked...
01-04-2011, 07:52 AM
Thanks a lot Mr. Bobo, it works great.
Also thanks for the extra explanation.
01-04-2011, 07:52 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.