Motion Library (motlib)
motlib is the beginnings of a Script Library. All files associated with motlib have a motlib prefix (except for the main file which is simply motlib.msa). All of the functionality of the library is located in motlib.msa. There are Palette Scripts (motlib_SetupToCurrent.msa, motlib_CurrentToSetup.msa and motlib_CurrentToSetupNoUpdate.msa), these scripts exist only to add an icon to the Scripts Palette. There are associated icon files for each of the Palette Scripts. The 'main' function of each of the Palette Scripts just calls one of the functions located in motlib.msa, for example:
motlib_SetupToCurrent.msa calls motlib.SetupToCurrent(
motlib_CurrentToSetup.msa calls motlib.CurrentToSetup( 1
motlib.CurrentToSetup( 0 )
This function will copy the Setup values for each selected item and paste them to the keyframe that exists at the current frame. If a key does not exist at the current frame then nothing happens. This is like hitting Reset->All for each of the selected item, except that this works only on the current frame (not the current key), and it works for all selected items.
This function does the opposite of SetupToCurrent( ). Instead of copying the Setup values to the key at the current frame, this function copies the current transformation values to Setup. This is the same as removing an item from setup (the 'a' icon next to it) and hitting Record->All.
Whenever you change a value in Setup you have the option of updating all keyframes by the amount you changed the value by. If you don't want to update the keys with this function pass it a value of 0. If you want the update of the keys to be determined by the current settings in Setup Mode (i.e. Off, All Keys or Range) then pass a 1.
Chances are you will not want to update the keys when using this function, in which case the Palette Script motlib_CurrentToSetupNoUpdate.msa is just the one for you.
This function uses the GetPrevWorldValue( ) function to calculate the velocity of an item on a given channel. This function will take into account all expression and effects. For it to work properly it should be called after all expressions that affect the object as called. This function is still undergoing testing
|Converted from CHM to HTML with chm2web Pro 2.82 (unicode)|