home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2002 April / maximum-cd-2002-04.iso / Software / Apps / gmax / gmaxinst.exe / gmaxsetup11.cab / Macro_AnimationTools.mcr < prev    next >
Encoding:
Text File  |  2001-09-12  |  34.8 KB  |  1,326 lines

  1. -- Animation Tools MacroScript File
  2. --
  3. -- Created:          May 18 2000
  4. -- Last Updated:     June 9 2000
  5. --
  6. -- Author :   Frank DeLise
  7. -- Version:  3ds max 4
  8. --
  9. -- 
  10. -- This script adds tools for animation control
  11. --***********************************************************************************************
  12. -- MODIFY THIS AT YOUR OWN RISK
  13. -- 
  14. -- June 9, 2000 Added Explicit keys creation and deletion
  15.  
  16. MacroScript Create_Key_Position
  17.     ButtonText:"Create Key Position" 
  18.     Category:"Keyframe Tools" 
  19.     internalCategory:"Keyframe Tools" 
  20.     Tooltip:"Create a Position Key" 
  21.     -- Needs Icon
  22.     --Icon:#("Max_edit_modifiers",1)
  23. (    
  24.  
  25.     On isEnabled return (Try(Selection.count != 0)Catch())
  26.     On isVisible return (Try(Selection.count != 0)Catch()) 
  27.     On Execute Do    
  28.     (
  29.         
  30.             
  31.             For i in 1 to selection.count do
  32.             (
  33.                 Try(AddNewKey Selection[i].pos.controller SliderTime)Catch()
  34.             )
  35.             
  36.     )
  37. )
  38. MacroScript Delete_Key_Position
  39.     ButtonText:"Delete All Keys Position" 
  40.     Category:"Keyframe Tools" 
  41.     internalCategory:"Keyframe Tools" 
  42.     Tooltip:"Delete All Position Keys" 
  43.     -- Needs Icon
  44.     --Icon:#("Max_edit_modifiers",1)
  45. (    
  46.  
  47.     On isEnabled return (Try(Selection.count != 0)Catch())
  48.     On isVisible return (Try(Selection.count != 0)Catch()) 
  49.     On Execute Do    
  50.     (
  51.         
  52.             
  53.             For i in 1 to selection.count do
  54.             (
  55.                 Try(    
  56.                 SelectKeys Selection[i].pos.controller SliderTime
  57.                 DeleteKeys Selection[i].pos.controller #Selection
  58.                 )Catch()
  59.             )
  60.             
  61.     )
  62. )
  63.  
  64.  
  65. MacroScript Create_Key_Position_X
  66.     ButtonText:"Create Key Position X" 
  67.     Category:"Keyframe Tools" 
  68.     internalCategory:"Keyframe Tools" 
  69.     Tooltip:"Create a Position Key on X" 
  70.     -- Needs Icon
  71.     --Icon:#("Max_edit_modifiers",1)
  72. (    
  73.  
  74.     On isEnabled return Filters.Is_PosXYZ()
  75.     On isVisible return Filters.Is_PosXYZ() 
  76.     On Execute Do    
  77.     (
  78.         
  79.             
  80.             For i in 1 to selection.count do
  81.             (
  82.                 If (Classof Selection[i].pos.controller) == Position_list then 
  83.                 (
  84.                     Try(AddNewKey Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].X_Position.controller SliderTime)Catch()
  85.                 )
  86.                 Else
  87.                 (
  88.                     Try(AddNewKey Selection[i].pos.X_Position.controller SliderTime)Catch()
  89.                 )
  90.             )
  91.             
  92.     
  93.     )
  94. )
  95. MacroScript Create_Key_Position_Y
  96.     ButtonText:"Create Key Position Y" 
  97.     Category:"Keyframe Tools" 
  98.     internalCategory:"Keyframe Tools" 
  99.     Tooltip:"Create a Position Key on Y" 
  100.     -- Needs Icon
  101.     --Icon:#("Max_edit_modifiers",1)
  102. (    
  103.  
  104.     On isEnabled return Filters.Is_PosXYZ()
  105.     On isVisible return Filters.Is_PosXYZ()
  106.     On Execute Do    
  107.     (
  108.         
  109.             
  110.             For i in 1 to selection.count do
  111.             (
  112.                 If (Classof Selection[i].pos.controller) == Position_list then 
  113.                 (
  114.                     Try(AddNewKey Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Y_Position.controller SliderTime)Catch()
  115.                 )
  116.                 Else
  117.                 (
  118.                     Try(AddNewKey Selection[i].pos.Y_Position.controller SliderTime)Catch()
  119.                 )
  120.             )
  121.         
  122.             
  123.      
  124.     
  125.     )
  126. )
  127. MacroScript Create_Key_Position_Z
  128.     ButtonText:"Create Key Position Z" 
  129.     Category:"Keyframe Tools" 
  130.     internalCategory:"Keyframe Tools" 
  131.     Tooltip:"Create a Position Key on Z" 
  132.     -- Needs Icon
  133.     --Icon:#("Max_edit_modifiers",1)
  134. (    
  135.  
  136.     On isEnabled return Filters.Is_PosXYZ()
  137.     On isVisible return Filters.Is_PosXYZ() 
  138.     On Execute Do    
  139.     (
  140.         
  141.             
  142.             For i in 1 to selection.count do
  143.             (
  144.                 If (Classof Selection[i].pos.controller) == Position_list then 
  145.                 (
  146.                     Try(AddNewKey Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Z_Position.controller SliderTime)Catch()
  147.                 )
  148.                 Else
  149.                 (
  150.                     Try(AddNewKey Selection[i].pos.Z_Position.controller SliderTime)Catch()
  151.                 )
  152.             )
  153.             
  154.     
  155.     )
  156. )
  157. MacroScript Create_Explicit_Key_Position_X
  158.     ButtonText:"Create Explicit Key Position X" 
  159.     Category:"Keyframe Tools" 
  160.     internalCategory:"Keyframe Tools" 
  161.     Tooltip:"Create Explicit Key Position X" 
  162.     -- Needs Icon
  163.     --Icon:#("Max_edit_modifiers",1)
  164. (    
  165.  
  166.     On isEnabled return Filters.Is_PosXYZ()
  167.     On isVisible return Filters.Is_PosXYZ() 
  168.     On Execute Do    
  169.     (
  170.         
  171.             
  172.             For i in 1 to selection.count do
  173.             (
  174.                 If (Classof Selection[i].pos.controller) == Position_list then 
  175.                 (
  176.                     Try
  177.                         (
  178.                             AddNewKey Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].X_Position.controller SliderTime
  179.                             SelectKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Y_Position.controller SliderTime
  180.                             SelectKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Z_Position.controller SliderTime
  181.                             DeleteKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].controller #Selection
  182.                             
  183.                         )
  184.                         Catch()
  185.                 )
  186.                 Else
  187.                 (
  188.                     Try
  189.                         (
  190.                             AddNewKey Selection[i].pos.X_Position.controller SliderTime
  191.                             SelectKeys Selection[i].pos.Y_Position.controller SliderTime
  192.                             SelectKeys Selection[i].pos.Z_Position.controller SliderTime
  193.                             DeleteKeys Selection[i].pos.controller #Selection
  194.                         )
  195.                         Catch()
  196.  
  197.                 )
  198.             )
  199.     )
  200. )
  201. MacroScript Create_Explicit_Key_Position_Y
  202.     ButtonText:"Create Explicit Key Position Y" 
  203.     Category:"Keyframe Tools" 
  204.     internalCategory:"Keyframe Tools" 
  205.     Tooltip:"Create Explicit Key Position Y" 
  206.     -- Needs Icon
  207.     --Icon:#("Max_edit_modifiers",1)
  208. (    
  209.  
  210.     On isEnabled return Filters.Is_PosXYZ()
  211.     On isVisible return Filters.Is_PosXYZ() 
  212.     On Execute Do    
  213.     (
  214.         
  215.             
  216.             For i in 1 to selection.count do
  217.             (
  218.                 If (Classof Selection[i].pos.controller) == Position_list then 
  219.                 (
  220.                     Try
  221.                         (
  222.                             AddNewKey Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Y_Position.controller SliderTime
  223.                             SelectKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].X_Position.controller SliderTime
  224.                             SelectKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Z_Position.controller SliderTime
  225.                             DeleteKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].controller #Selection
  226.                             
  227.                         )
  228.                         Catch()
  229.                 )
  230.                 Else
  231.                 (
  232.                     Try
  233.                         (
  234.                             AddNewKey Selection[i].pos.Y_Position.controller SliderTime
  235.                             SelectKeys Selection[i].pos.X_Position.controller SliderTime
  236.                             SelectKeys Selection[i].pos.Z_Position.controller SliderTime
  237.                             DeleteKeys Selection[i].pos.controller #Selection
  238.                         )
  239.                         Catch()
  240.  
  241.                 )
  242.             )
  243.     )
  244. )
  245. MacroScript Create_Explicit_Key_Position_Z
  246.     ButtonText:"Create Explicit Key Position Z" 
  247.     Category:"Keyframe Tools" 
  248.     internalCategory:"Keyframe Tools" 
  249.     Tooltip:"Create Explicit Key Position Z" 
  250.     -- Needs Icon
  251.     --Icon:#("Max_edit_modifiers",1)
  252. (    
  253.  
  254.     On isEnabled return Filters.Is_PosXYZ()
  255.     On isVisible return Filters.Is_PosXYZ() 
  256.     On Execute Do    
  257.     (
  258.         
  259.             
  260.             For i in 1 to selection.count do
  261.             (
  262.                 If (Classof Selection[i].pos.controller) == Position_list then 
  263.                 (
  264.                     Try
  265.                         (
  266.                             AddNewKey Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Z_Position.controller SliderTime
  267.                             SelectKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Y_Position.controller SliderTime
  268.                             SelectKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].X_Position.controller SliderTime
  269.                             DeleteKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].controller #Selection
  270.                             
  271.                         )
  272.                         Catch()
  273.                 )
  274.                 Else
  275.                 (
  276.                     Try
  277.                         (
  278.                             AddNewKey Selection[i].pos.Z_Position.controller SliderTime
  279.                             SelectKeys Selection[i].pos.Y_Position.controller SliderTime
  280.                             SelectKeys Selection[i].pos.X_Position.controller SliderTime
  281.                             DeleteKeys Selection[i].pos.controller #Selection
  282.                         )
  283.                         Catch()
  284.  
  285.                 )
  286.             )
  287.     )
  288. )
  289.  
  290.  
  291. MacroScript Delete_Key_Position_X
  292.     ButtonText:"Delete Key Position X" 
  293.     Category:"Keyframe Tools" 
  294.     internalCategory:"Keyframe Tools" 
  295.     Tooltip:"Delete a Position Key on X" 
  296.     -- Needs Icon
  297.     --Icon:#("Max_edit_modifiers",1)
  298. (    
  299.  
  300.     On isEnabled return Filters.Is_PosXYZ()
  301.     On isVisible return Filters.Is_PosXYZ() 
  302.     On Execute Do    
  303.     (
  304.         
  305.             
  306.             For i in 1 to selection.count do
  307.             (
  308.                 If (Classof Selection[i].pos.controller) == Position_list then 
  309.                 (
  310.                     Try
  311.                         (
  312.                             SelectKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].X_Position.controller SliderTime
  313.                             DeleteKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].X_Position.controller #Selection
  314.                         )
  315.                         Catch()
  316.                 )
  317.                 Else
  318.                 (
  319.                     Try
  320.                         (
  321.                             SelectKeys Selection[i].Position.X_Position.controller SliderTime
  322.                             DeleteKeys Selection[i].Position.X_Position.controller #Selection
  323.                         )
  324.                         Catch()
  325.  
  326.                 )
  327.             )
  328.     )
  329. )
  330. MacroScript Delete_Key_Position_Y
  331.     ButtonText:"Delete Key Position Y" 
  332.     Category:"Keyframe Tools" 
  333.     internalCategory:"Keyframe Tools" 
  334.     Tooltip:"Delete a Position Key on Y" 
  335.     -- Needs Icon
  336.     --Icon:#("Max_edit_modifiers",1)
  337. (    
  338.  
  339.     On isEnabled return Filters.Is_PosXYZ()
  340.     On isVisible return Filters.Is_PosXYZ() 
  341.     On Execute Do    
  342.     (
  343.         
  344.             
  345.             For i in 1 to selection.count do
  346.             (
  347.                 If (Classof Selection[i].pos.controller) == Position_list then 
  348.                 (
  349.                     Try
  350.                         (
  351.                             SelectKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Y_Position.controller SliderTime
  352.                             DeleteKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Y_Position.controller #Selection
  353.                         )
  354.                         Catch()
  355.                 )
  356.                 Else
  357.                 (
  358.                     Try
  359.                         (
  360.                             SelectKeys Selection[i].Position.Y_Position.controller SliderTime
  361.                             DeleteKeys Selection[i].Position.Y_Position.controller #Selection
  362.                         )
  363.                         Catch()
  364.  
  365.                 )
  366.             )
  367.     )
  368. )
  369. MacroScript Delete_Key_Position_Z
  370.     ButtonText:"Delete Key Position Z" 
  371.     Category:"Keyframe Tools" 
  372.     internalCategory:"Keyframe Tools" 
  373.     Tooltip:"Delete a Position Key on Z" 
  374.     -- Needs Icon
  375.     --Icon:#("Max_edit_modifiers",1)
  376. (    
  377.  
  378.     On isEnabled return Filters.Is_PosXYZ()
  379.     On isVisible return Filters.Is_PosXYZ() 
  380.     On Execute Do    
  381.     (
  382.         
  383.             
  384.             For i in 1 to selection.count do
  385.             (
  386.                 If (Classof Selection[i].pos.controller) == Position_list then 
  387.                 (
  388.                     Try
  389.                         (
  390.                             SelectKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Z_Position.controller SliderTime
  391.                             DeleteKeys Selection[i].pos.controller[ListCtrl.GetActive Selection[i].pos.controller].Z_Position.controller #Selection
  392.                         )
  393.                         Catch()
  394.                 )
  395.                 Else
  396.                 (
  397.                     Try
  398.                         (
  399.                             SelectKeys Selection[i].Position.Z_Position.controller SliderTime
  400.                             DeleteKeys Selection[i].Position.Z_Position.controller #Selection
  401.                         )
  402.                         Catch()
  403.  
  404.                 )
  405.             )
  406.     )
  407. )
  408.  
  409. MacroScript Create_Key_Rotation
  410.     ButtonText:"Create Key Rotation" 
  411.     Category:"Keyframe Tools" 
  412.     internalCategory:"Keyframe Tools" 
  413.     Tooltip:"Create a Rotation Key" 
  414.     -- Needs Icon
  415.     --Icon:#("Max_edit_modifiers",1)
  416. (    
  417.  
  418.     On isEnabled return (Try(Selection.count != 0)Catch())
  419.     On isVisible return (Try(Selection.count != 0)Catch()) 
  420.     On Execute Do    
  421.     (
  422.         
  423.             
  424.             For i in 1 to selection.count do
  425.             (
  426.                 Try(AddNewKey Selection[i].Rotation.controller SliderTime)Catch()
  427.             )
  428.             
  429.     )
  430. )
  431. MacroScript Delete_Key_Rotation
  432.     ButtonText:"Delete All Keys Rotation" 
  433.     Category:"Keyframe Tools" 
  434.     internalCategory:"Keyframe Tools" 
  435.     Tooltip:"Delete All Rotation Keys" 
  436.     -- Needs Icon
  437.     --Icon:#("Max_edit_modifiers",1)
  438. (    
  439.  
  440.     On isEnabled return (Try(Selection.count != 0)Catch())
  441.     On isVisible return (Try(Selection.count != 0)Catch()) 
  442.     On Execute Do    
  443.     (
  444.         
  445.             
  446.             For i in 1 to selection.count do
  447.             (
  448.                 Try(    
  449.                 SelectKeys Selection[i].Rotation.controller SliderTime
  450.                 DeleteKeys Selection[i].Rotation.controller #Selection
  451.                 )Catch()
  452.             )
  453.             
  454.     )
  455. )
  456.  
  457.  
  458. MacroScript Create_Key_Rotation_X
  459.     ButtonText:"Create Key Rotation X" 
  460.     Category:"Keyframe Tools" 
  461.     internalCategory:"Keyframe Tools" 
  462.     Tooltip:"Create a Rotation Key on X" 
  463.     -- Needs Icon
  464.     --Icon:#("Max_edit_modifiers",1)
  465. (    
  466.  
  467.     On isEnabled return Filters.Is_RotationXYZ()
  468.     On isVisible return Filters.Is_RotationXYZ() 
  469.     On Execute Do    
  470.     (
  471.         
  472.             
  473.             For i in 1 to selection.count do
  474.             (
  475.                 If (Classof Selection[i].Rotation.controller) == Rotation_list then 
  476.                 (
  477.                     Try(AddNewKey Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].X_Rotation.controller SliderTime)Catch()
  478.                 )
  479.                 Else
  480.                 (
  481.                     Try(AddNewKey Selection[i].Rotation.X_Rotation.controller SliderTime)Catch()
  482.                 )
  483.             )
  484.             
  485.     
  486.     )
  487. )
  488. MacroScript Create_Key_Rotation_Y
  489.     ButtonText:"Create Key Rotation Y" 
  490.     Category:"Keyframe Tools" 
  491.     internalCategory:"Keyframe Tools" 
  492.     Tooltip:"Create a Rotation Key on Y" 
  493.     -- Needs Icon
  494.     --Icon:#("Max_edit_modifiers",1)
  495. (    
  496.  
  497.     On isEnabled return Filters.Is_RotationXYZ()
  498.     On isVisible return Filters.Is_RotationXYZ()
  499.     On Execute Do    
  500.     (
  501.         
  502.             
  503.             For i in 1 to selection.count do
  504.             (
  505.                 If (Classof Selection[i].Rotation.controller) == Rotation_list then 
  506.                 (
  507.                     Try(AddNewKey Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Y_Rotation.controller SliderTime)Catch()
  508.                 )
  509.                 Else
  510.                 (
  511.                     Try(AddNewKey Selection[i].Rotation.Y_Rotation.controller SliderTime)Catch()
  512.                 )
  513.             )
  514.         
  515.             
  516.      
  517.     
  518.     )
  519. )
  520. MacroScript Create_Key_Rotation_Z
  521.     ButtonText:"Create Key Rotation Z" 
  522.     Category:"Keyframe Tools" 
  523.     internalCategory:"Keyframe Tools" 
  524.     Tooltip:"Create a Rotation Key on Z" 
  525.     -- Needs Icon
  526.     --Icon:#("Max_edit_modifiers",1)
  527. (    
  528.  
  529.     On isEnabled return Filters.Is_RotationXYZ()
  530.     On isVisible return Filters.Is_RotationXYZ() 
  531.     On Execute Do    
  532.     (
  533.         
  534.             
  535.             For i in 1 to selection.count do
  536.             (
  537.                 If (Classof Selection[i].Rotation.controller) == Rotation_list then 
  538.                 (
  539.                     Try(AddNewKey Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Z_Rotation.controller SliderTime)Catch()
  540.                 )
  541.                 Else
  542.                 (
  543.                     Try(AddNewKey Selection[i].Rotation.Z_Rotation.controller SliderTime)Catch()
  544.                 )
  545.             )
  546.             
  547.     
  548.     )
  549. )
  550. MacroScript Create_Explicit_Key_Rotation_X
  551.     ButtonText:"Create Explicit Key Rotation X" 
  552.     Category:"Keyframe Tools" 
  553.     internalCategory:"Keyframe Tools" 
  554.     Tooltip:"Create Explicit Key Rotation X" 
  555.     -- Needs Icon
  556.     --Icon:#("Max_edit_modifiers",1)
  557. (    
  558.  
  559.     On isEnabled return Filters.Is_RotationXYZ()
  560.     On isVisible return Filters.Is_RotationXYZ() 
  561.     On Execute Do    
  562.     (
  563.         
  564.             
  565.             For i in 1 to selection.count do
  566.             (
  567.                 If (Classof Selection[i].Rotation.controller) == Rotation_list then 
  568.                 (
  569.                     Try
  570.                         (
  571.                             AddNewKey Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].X_Rotation.controller SliderTime
  572.                             SelectKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Y_Rotation.controller SliderTime
  573.                             SelectKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Z_Rotation.controller SliderTime
  574.                             DeleteKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Rotation #Selection
  575.                             
  576.                         )
  577.                         Catch()
  578.                 )
  579.                 Else
  580.                 (
  581.                     Try
  582.                         (
  583.                             AddNewKey Selection[i].Rotation.X_Rotation.controller SliderTime
  584.                             SelectKeys Selection[i].Rotation.Y_Rotation.controller SliderTime
  585.                             SelectKeys Selection[i].Rotation.Z_Rotation.controller SliderTime
  586.                             DeleteKeys Selection[i].Rotation.controller #Selection
  587.                         )
  588.                         Catch()
  589.  
  590.                 )
  591.             )
  592.     )
  593. )
  594.  
  595. MacroScript Create_Explicit_Key_Rotation_Y
  596.     ButtonText:"Create Explicit Key Rotation Y" 
  597.     Category:"Keyframe Tools" 
  598.     internalCategory:"Keyframe Tools" 
  599.     Tooltip:"Create Explicit Key Rotation Y" 
  600.     -- Needs Icon
  601.     --Icon:#("Max_edit_modifiers",1)
  602. (    
  603.  
  604.     On isEnabled return Filters.Is_PosXYZ()
  605.     On isVisible return Filters.Is_PosXYZ() 
  606.     On Execute Do    
  607.     (
  608.         
  609.             
  610.             For i in 1 to selection.count do
  611.             (
  612.                 If (Classof Selection[i].Rotation.controller) == Rotation_list then 
  613.                 (
  614.                     Try
  615.                         (
  616.                             AddNewKey Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Y_Rotation.controller SliderTime
  617.                             SelectKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].X_Rotation.controller SliderTime
  618.                             SelectKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Z_Rotation.controller SliderTime
  619.                             DeleteKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].controller #Selection
  620.                             
  621.                         )
  622.                         Catch()
  623.                 )
  624.                 Else
  625.                 (
  626.                     Try
  627.                         (
  628.                             AddNewKey Selection[i].Rotation.Y_Rotation.controller SliderTime
  629.                             SelectKeys Selection[i].Rotation.X_Rotation.controller SliderTime
  630.                             SelectKeys Selection[i].Rotation.Z_Rotation.controller SliderTime
  631.                             DeleteKeys Selection[i].Rotation.controller #Selection
  632.                         )
  633.                         Catch()
  634.  
  635.                 )
  636.             )
  637.     )
  638. )
  639. MacroScript Create_Explicit_Key_Rotation_Z
  640.     ButtonText:"Create Explicit Key Rotation Z" 
  641.     Category:"Keyframe Tools" 
  642.     internalCategory:"Keyframe Tools" 
  643.     Tooltip:"Create Explicit Key Rotation Z" 
  644.     -- Needs Icon
  645.     --Icon:#("Max_edit_modifiers",1)
  646. (    
  647.  
  648.     On isEnabled return Filters.Is_PosXYZ()
  649.     On isVisible return Filters.Is_PosXYZ() 
  650.     On Execute Do    
  651.     (
  652.         
  653.             
  654.             For i in 1 to selection.count do
  655.             (
  656.                 If (Classof Selection[i].Rotation.controller) == Rotation_list then 
  657.                 (
  658.                     Try
  659.                         (
  660.                             AddNewKey Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Z_Rotation.controller SliderTime
  661.                             SelectKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Y_Rotation.controller SliderTime
  662.                             SelectKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].X_Rotation.controller SliderTime
  663.                             DeleteKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].controller #Selection
  664.                             
  665.                         )
  666.                         Catch()
  667.                 )
  668.                 Else
  669.                 (
  670.                     Try
  671.                         (
  672.                             AddNewKey Selection[i].Rotation.Z_Rotation.controller SliderTime
  673.                             SelectKeys Selection[i].Rotation.Y_Rotation.controller SliderTime
  674.                             SelectKeys Selection[i].Rotation.X_Rotation.controller SliderTime
  675.                             DeleteKeys Selection[i].Rotation.controller #Selection
  676.                         )
  677.                         Catch()
  678.  
  679.                 )
  680.             )
  681.     )
  682. )
  683.  
  684.  
  685. MacroScript Delete_Key_Rotation_X
  686.     ButtonText:"Delete Key Rotation X" 
  687.     Category:"Keyframe Tools" 
  688.     internalCategory:"Keyframe Tools" 
  689.     Tooltip:"Delete a Rotation Key on X" 
  690.     -- Needs Icon
  691.     --Icon:#("Max_edit_modifiers",1)
  692. (    
  693.  
  694.     On isEnabled return Filters.Is_PosXYZ()
  695.     On isVisible return Filters.Is_PosXYZ() 
  696.     On Execute Do    
  697.     (
  698.         
  699.             
  700.             For i in 1 to selection.count do
  701.             (
  702.                 If (Classof Selection[i].Rotation.controller) == Rotation_list then 
  703.                 (
  704.                     Try
  705.                         (
  706.                             SelectKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].X_Rotation.controller SliderTime
  707.                             DeleteKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].X_Rotation.controller #Selection
  708.                         )
  709.                         Catch()
  710.                 )
  711.                 Else
  712.                 (
  713.                     Try
  714.                         (
  715.                             SelectKeys Selection[i].Rotation.X_Rotation.controller SliderTime
  716.                             DeleteKeys Selection[i].Rotation.X_Rotation.controller #Selection
  717.                         )
  718.                         Catch()
  719.  
  720.                 )
  721.             )
  722.     )
  723. )
  724. MacroScript Delete_Key_Rotation_Y
  725.     ButtonText:"Delete Key Rotation Y" 
  726.     Category:"Keyframe Tools" 
  727.     internalCategory:"Keyframe Tools" 
  728.     Tooltip:"Delete a Rotation Key on Y" 
  729.     -- Needs Icon
  730.     --Icon:#("Max_edit_modifiers",1)
  731. (    
  732.  
  733.     On isEnabled return Filters.Is_PosXYZ()
  734.     On isVisible return Filters.Is_PosXYZ() 
  735.     On Execute Do    
  736.     (
  737.         
  738.             
  739.             For i in 1 to selection.count do
  740.             (
  741.                 If (Classof Selection[i].Rotation.controller) == Rotation_list then 
  742.                 (
  743.                     Try
  744.                         (
  745.                             SelectKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Y_Rotation.controller SliderTime
  746.                             DeleteKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Y_Rotation.controller #Selection
  747.                         )
  748.                         Catch()
  749.                 )
  750.                 Else
  751.                 (
  752.                     Try
  753.                         (
  754.                             SelectKeys Selection[i].Rotation.Y_Rotation.controller SliderTime
  755.                             DeleteKeys Selection[i].Rotation.Y_Rotation.controller #Selection
  756.                         )
  757.                         Catch()
  758.  
  759.                 )
  760.             )
  761.     )
  762. )
  763. MacroScript Delete_Key_Rotation_Z
  764.     ButtonText:"Delete Key Rotation Z" 
  765.     Category:"Keyframe Tools" 
  766.     internalCategory:"Keyframe Tools" 
  767.     Tooltip:"Delete a Rotation Key on Z" 
  768.     -- Needs Icon
  769.     --Icon:#("Max_edit_modifiers",1)
  770. (    
  771.  
  772.     On isEnabled return Filters.Is_PosXYZ()
  773.     On isVisible return Filters.Is_PosXYZ() 
  774.     On Execute Do    
  775.     (
  776.         
  777.             
  778.             For i in 1 to selection.count do
  779.             (
  780.                 If (Classof Selection[i].Rotation.controller) == Rotation_list then 
  781.                 (
  782.                     Try
  783.                         (
  784.                             SelectKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Z_Rotation.controller SliderTime
  785.                             DeleteKeys Selection[i].Rotation.controller[ListCtrl.GetActive Selection[i].Rotation.controller].Z_Rotation.controller #Selection
  786.                         )
  787.                         Catch()
  788.                 )
  789.                 Else
  790.                 (
  791.                     Try
  792.                         (
  793.                             SelectKeys Selection[i].Rotation.Z_Rotation.controller SliderTime
  794.                             DeleteKeys Selection[i].Rotation.Z_Rotation.controller #Selection
  795.                         )
  796.                         Catch()
  797.  
  798.                 )
  799.             )
  800.     )
  801. )
  802.  
  803.  
  804. MacroScript Create_Key_Scale
  805.     ButtonText:"Create Key Scale" 
  806.     Category:"Keyframe Tools" 
  807.     internalCategory:"Keyframe Tools" 
  808.     Tooltip:"Create a Scale Key" 
  809.     -- Needs Icon
  810.     --Icon:#("Max_edit_modifiers",1)
  811. (    
  812.  
  813.     On isEnabled return (Try(Selection.count != 0)Catch())
  814.     On isVisible return (Try(Selection.count != 0)Catch()) 
  815.     On Execute Do    
  816.     (
  817.         
  818.             
  819.             For i in 1 to selection.count do
  820.             (
  821.                 Try(AddNewKey Selection[i].Scale.controller SliderTime)Catch()
  822.             )
  823.             
  824.     )
  825. )
  826. MacroScript Delete_Key_Scale
  827.     ButtonText:"Delete All Keys Scale" 
  828.     Category:"Keyframe Tools" 
  829.     internalCategory:"Keyframe Tools" 
  830.     Tooltip:"Delete All Scale Keys" 
  831.     -- Needs Icon
  832.     --Icon:#("Max_edit_modifiers",1)
  833. (    
  834.  
  835.     On isEnabled return (Try(Selection.count != 0)Catch())
  836.     On isVisible return (Try(Selection.count != 0)Catch()) 
  837.     On Execute Do    
  838.     (
  839.         
  840.             
  841.             For i in 1 to selection.count do
  842.             (
  843.                 Try(    
  844.                 SelectKeys Selection[i].Scale.controller SliderTime
  845.                 DeleteKeys Selection[i].Scale.controller #Selection
  846.                 )Catch()
  847.             )
  848.             
  849.     )
  850. )
  851.  
  852.  
  853. MacroScript Create_Key_Scale_X
  854.     ButtonText:"Create Key Scale X" 
  855.     Category:"Keyframe Tools" 
  856.     internalCategory:"Keyframe Tools" 
  857.     Tooltip:"Create a Scale Key on X" 
  858.     -- Needs Icon
  859.     --Icon:#("Max_edit_modifiers",1)
  860. (    
  861.  
  862.     On isEnabled return Filters.Is_ScaleXYZ()
  863.     On isVisible return Filters.Is_ScaleXYZ() 
  864.     On Execute Do    
  865.     (
  866.         
  867.             
  868.             For i in 1 to selection.count do
  869.             (
  870.                 If (Classof Selection[i].Scale.controller) == Scale_list then 
  871.                 (
  872.                     Try(AddNewKey Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].X_Scale.controller SliderTime)Catch()
  873.                 )
  874.                 Else
  875.                 (
  876.                     Try(AddNewKey Selection[i].Scale.X_Scale.controller SliderTime)Catch()
  877.                 )
  878.             )
  879.             
  880.     
  881.     )
  882. )
  883. MacroScript Create_Key_Scale_Y
  884.     ButtonText:"Create Key Scale Y" 
  885.     Category:"Keyframe Tools" 
  886.     internalCategory:"Keyframe Tools" 
  887.     Tooltip:"Create a Scale Key on Y" 
  888.     -- Needs Icon
  889.     --Icon:#("Max_edit_modifiers",1)
  890. (    
  891.  
  892.     On isEnabled return Filters.Is_ScaleXYZ()
  893.     On isVisible return Filters.Is_ScaleXYZ()
  894.     On Execute Do    
  895.     (
  896.         
  897.             
  898.             For i in 1 to selection.count do
  899.             (
  900.                 If (Classof Selection[i].Scale.controller) == Scale_list then 
  901.                 (
  902.                     Try(AddNewKey Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Y_Scale.controller SliderTime)Catch()
  903.                 )
  904.                 Else
  905.                 (
  906.                     Try(AddNewKey Selection[i].Scale.Y_Scale.controller SliderTime)Catch()
  907.                 )
  908.             )
  909.         
  910.             
  911.      
  912.     
  913.     )
  914. )
  915. MacroScript Create_Key_Scale_Z
  916.     ButtonText:"Create Key Scale Z" 
  917.     Category:"Keyframe Tools" 
  918.     internalCategory:"Keyframe Tools" 
  919.     Tooltip:"Create a Scale Key on Z" 
  920.     -- Needs Icon
  921.     --Icon:#("Max_edit_modifiers",1)
  922. (    
  923.  
  924.     On isEnabled return Filters.Is_ScaleXYZ()
  925.     On isVisible return Filters.Is_ScaleXYZ() 
  926.     On Execute Do    
  927.     (
  928.         
  929.             
  930.             For i in 1 to selection.count do
  931.             (
  932.                 If (Classof Selection[i].Scale.controller) == Scale_list then 
  933.                 (
  934.                     Try(AddNewKey Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Z_Scale.controller SliderTime)Catch()
  935.                 )
  936.                 Else
  937.                 (
  938.                     Try(AddNewKey Selection[i].Scale.Z_Scale.controller SliderTime)Catch()
  939.                 )
  940.             )
  941.             
  942.     
  943.     )
  944. )
  945. MacroScript Create_Explicit_Key_Scale_X
  946.     ButtonText:"Create Explicit Key Scale X" 
  947.     Category:"Keyframe Tools" 
  948.     internalCategory:"Keyframe Tools" 
  949.     Tooltip:"Create Explicit Key Scale X" 
  950.     -- Needs Icon
  951.     --Icon:#("Max_edit_modifiers",1)
  952. (    
  953.  
  954.     On isEnabled return Filters.Is_ScaleXYZ()
  955.     On isVisible return Filters.Is_ScaleXYZ() 
  956.     On Execute Do    
  957.     (
  958.         
  959.             
  960.             For i in 1 to selection.count do
  961.             (
  962.                 If (Classof Selection[i].Scale.controller) == Scale_list then 
  963.                 (
  964.                     Try
  965.                         (
  966.                             AddNewKey Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].X_Scale.controller SliderTime
  967.                             SelectKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Y_Scale.controller SliderTime
  968.                             SelectKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Z_Scale.controller SliderTime
  969.                             DeleteKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Scale #Selection
  970.                             
  971.                         )
  972.                         Catch()
  973.                 )
  974.                 Else
  975.                 (
  976.                     Try
  977.                         (
  978.                             AddNewKey Selection[i].Scale.X_Scale.controller SliderTime
  979.                             SelectKeys Selection[i].Scale.Y_Scale.controller SliderTime
  980.                             SelectKeys Selection[i].Scale.Z_Scale.controller SliderTime
  981.                             DeleteKeys Selection[i].Scale.controller #Selection
  982.                         )
  983.                         Catch()
  984.  
  985.                 )
  986.             )
  987.     )
  988. )
  989.  
  990. MacroScript Create_Explicit_Key_Scale_Y
  991.     ButtonText:"Create Explicit Key Scale Y" 
  992.     Category:"Keyframe Tools" 
  993.     internalCategory:"Keyframe Tools" 
  994.     Tooltip:"Create Explicit Key Scale Y" 
  995.     -- Needs Icon
  996.     --Icon:#("Max_edit_modifiers",1)
  997. (    
  998.  
  999.     On isEnabled return Filters.Is_PosXYZ()
  1000.     On isVisible return Filters.Is_PosXYZ() 
  1001.     On Execute Do    
  1002.     (
  1003.         
  1004.             
  1005.             For i in 1 to selection.count do
  1006.             (
  1007.                 If (Classof Selection[i].Scale.controller) == Scale_list then 
  1008.                 (
  1009.                     Try
  1010.                         (
  1011.                             AddNewKey Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Y_Scale.controller SliderTime
  1012.                             SelectKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].X_Scale.controller SliderTime
  1013.                             SelectKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Z_Scale.controller SliderTime
  1014.                             DeleteKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].controller #Selection
  1015.                             
  1016.                         )
  1017.                         Catch()
  1018.                 )
  1019.                 Else
  1020.                 (
  1021.                     Try
  1022.                         (
  1023.                             AddNewKey Selection[i].Scale.Y_Scale.controller SliderTime
  1024.                             SelectKeys Selection[i].Scale.X_Scale.controller SliderTime
  1025.                             SelectKeys Selection[i].Scale.Z_Scale.controller SliderTime
  1026.                             DeleteKeys Selection[i].Scale.controller #Selection
  1027.                         )
  1028.                         Catch()
  1029.  
  1030.                 )
  1031.             )
  1032.     )
  1033. )
  1034. MacroScript Create_Explicit_Key_Scale_Z
  1035.     ButtonText:"Create Explicit Key Scale Z" 
  1036.     Category:"Keyframe Tools" 
  1037.     internalCategory:"Keyframe Tools" 
  1038.     Tooltip:"Create Explicit Key Scale Z" 
  1039.     -- Needs Icon
  1040.     --Icon:#("Max_edit_modifiers",1)
  1041. (    
  1042.  
  1043.     On isEnabled return Filters.Is_PosXYZ()
  1044.     On isVisible return Filters.Is_PosXYZ() 
  1045.     On Execute Do    
  1046.     (
  1047.         
  1048.             
  1049.             For i in 1 to selection.count do
  1050.             (
  1051.                 If (Classof Selection[i].Scale.controller) == Scale_list then 
  1052.                 (
  1053.                     Try
  1054.                         (
  1055.                             AddNewKey Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Z_Scale.controller SliderTime
  1056.                             SelectKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Y_Scale.controller SliderTime
  1057.                             SelectKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].X_Scale.controller SliderTime
  1058.                             DeleteKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].controller #Selection
  1059.                             
  1060.                         )
  1061.                         Catch()
  1062.                 )
  1063.                 Else
  1064.                 (
  1065.                     Try
  1066.                         (
  1067.                             AddNewKey Selection[i].Scale.Z_Scale.controller SliderTime
  1068.                             SelectKeys Selection[i].Scale.Y_Scale.controller SliderTime
  1069.                             SelectKeys Selection[i].Scale.X_Scale.controller SliderTime
  1070.                             DeleteKeys Selection[i].Scale.controller #Selection
  1071.                         )
  1072.                         Catch()
  1073.  
  1074.                 )
  1075.             )
  1076.     )
  1077. )
  1078.  
  1079.  
  1080. MacroScript Delete_Key_Scale_X
  1081.     ButtonText:"Delete Key Scale X" 
  1082.     Category:"Keyframe Tools" 
  1083.     internalCategory:"Keyframe Tools" 
  1084.     Tooltip:"Delete a Scale Key on X" 
  1085.     -- Needs Icon
  1086.     --Icon:#("Max_edit_modifiers",1)
  1087. (    
  1088.  
  1089.     On isEnabled return Filters.Is_PosXYZ()
  1090.     On isVisible return Filters.Is_PosXYZ() 
  1091.     On Execute Do    
  1092.     (
  1093.         
  1094.             
  1095.             For i in 1 to selection.count do
  1096.             (
  1097.                 If (Classof Selection[i].Scale.controller) == Scale_list then 
  1098.                 (
  1099.                     Try
  1100.                         (
  1101.                             SelectKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].X_Scale.controller SliderTime
  1102.                             DeleteKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].X_Scale.controller #Selection
  1103.                         )
  1104.                         Catch()
  1105.                 )
  1106.                 Else
  1107.                 (
  1108.                     Try
  1109.                         (
  1110.                             SelectKeys Selection[i].Scale.X_Scale.controller SliderTime
  1111.                             DeleteKeys Selection[i].Scale.X_Scale.controller #Selection
  1112.                         )
  1113.                         Catch()
  1114.  
  1115.                 )
  1116.             )
  1117.     )
  1118. )
  1119. MacroScript Delete_Key_Scale_Y
  1120.     ButtonText:"Delete Key Scale Y" 
  1121.     Category:"Keyframe Tools" 
  1122.     internalCategory:"Keyframe Tools" 
  1123.     Tooltip:"Delete a Scale Key on Y" 
  1124.     -- Needs Icon
  1125.     --Icon:#("Max_edit_modifiers",1)
  1126. (    
  1127.  
  1128.     On isEnabled return Filters.Is_PosXYZ()
  1129.     On isVisible return Filters.Is_PosXYZ() 
  1130.     On Execute Do    
  1131.     (
  1132.         
  1133.             
  1134.             For i in 1 to selection.count do
  1135.             (
  1136.                 If (Classof Selection[i].Scale.controller) == Scale_list then 
  1137.                 (
  1138.                     Try
  1139.                         (
  1140.                             SelectKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Y_Scale.controller SliderTime
  1141.                             DeleteKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Y_Scale.controller #Selection
  1142.                         )
  1143.                         Catch()
  1144.                 )
  1145.                 Else
  1146.                 (
  1147.                     Try
  1148.                         (
  1149.                             SelectKeys Selection[i].Scale.Y_Scale.controller SliderTime
  1150.                             DeleteKeys Selection[i].Scale.Y_Scale.controller #Selection
  1151.                         )
  1152.                         Catch()
  1153.  
  1154.                 )
  1155.             )
  1156.     )
  1157. )
  1158.  
  1159. MacroScript Delete_Key_Scale_Z
  1160.     ButtonText:"Delete Key Scale Z" 
  1161.     Category:"Keyframe Tools" 
  1162.     internalCategory:"Keyframe Tools" 
  1163.     Tooltip:"Delete a Scale Key on Z" 
  1164.     -- Needs Icon
  1165.     --Icon:#("Max_edit_modifiers",1)
  1166. (    
  1167.  
  1168.     On isEnabled return Filters.Is_PosXYZ()
  1169.     On isVisible return Filters.Is_PosXYZ() 
  1170.     On Execute Do    
  1171.     (
  1172.         
  1173.             
  1174.             For i in 1 to selection.count do
  1175.             (
  1176.                 If (Classof Selection[i].Scale.controller) == Scale_list then 
  1177.                 (
  1178.                     Try
  1179.                         (
  1180.                             SelectKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Z_Scale.controller SliderTime
  1181.                             DeleteKeys Selection[i].Scale.controller[ListCtrl.GetActive Selection[i].Scale.controller].Z_Scale.controller #Selection
  1182.                         )
  1183.                         Catch()
  1184.                 )
  1185.                 Else
  1186.                 (
  1187.                     Try
  1188.                         (
  1189.                             SelectKeys Selection[i].Scale.Z_Scale.controller SliderTime
  1190.                             DeleteKeys Selection[i].Scale.Z_Scale.controller #Selection
  1191.                         )
  1192.                         Catch()
  1193.  
  1194.                 )
  1195.             )
  1196.     )
  1197. )
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203. MacroScript Create_Key_All
  1204.     ButtonText:"Create Key All Transforms" 
  1205.     Category:"Keyframe Tools" 
  1206.     internalCategory:"Keyframe Tools" 
  1207.     Tooltip:"Create a Key for all Transforms" 
  1208.     -- Needs Icon
  1209.     --Icon:#("Max_edit_modifiers",1)
  1210. (    
  1211.  
  1212.     On isEnabled return (Try(Selection.count != 0)Catch())
  1213.     On isVisible return (Try(Selection.count != 0)Catch()) 
  1214.     On Execute Do    
  1215.     (
  1216.         
  1217.             If selection.count != 1 then
  1218.             For i in 1 to selection.count do
  1219.             (
  1220.                 For N in 1 to $[3].numsubs do
  1221.                 (
  1222.                     Try(AddNewKey $[i][3][n].Controller SliderTime)Catch()
  1223.                 )
  1224.             )
  1225.             Else
  1226.             (
  1227.                 For N in 1 to $[3].numsubs do
  1228.                 (
  1229.                     Try(AddNewKey $[3][n].Controller SliderTime)Catch()
  1230.                 )
  1231.             )
  1232.      
  1233.     
  1234.     )
  1235. )
  1236.  
  1237. MacroScript Create_Key_Source_Destination
  1238.     ButtonText:"Creates Source->Destination Keys" 
  1239.     Category:"Keyframe Tools" 
  1240.     internalCategory:"Keyframe Tools" 
  1241.     Tooltip:"Create Keys Based off of a Source" 
  1242.     -- Needs Icon
  1243.     --Icon:#("Max_edit_modifiers",1)
  1244. (    
  1245.     Local SD_Key_Float
  1246.     
  1247.     On isEnabled return (Try(Selection.count != 0)Catch())
  1248.     On isVisible return (Try(Selection.count != 0)Catch()) 
  1249.     On Execute Do    
  1250.     (
  1251.         
  1252.         
  1253.         Rollout SD_Key_Roll "Source --> Destination Key Creation"
  1254.         (
  1255.             
  1256.             
  1257.             Spinner SD_Source "Source Frame:" Across:2 Type:#Integer Width:100 Align:#Left Offset:[30,0] Range:[AnimationRange.Start, AnimationRange.End, SliderTime]
  1258.             EditText SD_Dest "Destination:" Align:#Left Offset:[-30,0] Width:200 Text:((((SliderTime /160) as Integer) + 1) as string)
  1259.             Label SD_A1 "Example: Source:25                   Destination:  0,50,10,24" Align:#Left 
  1260.             Group "Transforms"
  1261.             (
  1262.                 CheckBox SD_Pos "Position" Across:3 Checked:True
  1263.                 CheckBox SD_Rot "Rotation" Checked:True
  1264.                 CheckBox SD_Scale "Scale" Checked:True
  1265.             )
  1266.             Button SD_Create "Create Keys" Height:20 Align:#Center Width:200
  1267.             
  1268.             On SD_Create Pressed do
  1269.             (
  1270.                 SD_Dest_Time = #((SD_Dest.text as integer))
  1271.                 -- Removed Oct 13th 200 by Fred Ruff 
  1272.                 --SD_String = ("SD_Dest_Time = #(" + SD_Dest.text + ")")
  1273.                 --Try (
  1274.                 --Execute SD_String            
  1275.                 
  1276.                 For s in 1 to Selection.count do
  1277.                 (
  1278.                     For i in 1 to SD_Dest_Time.count do
  1279.                     (
  1280.                         
  1281.                         If SD_Pos.checked == True then 
  1282.                         (
  1283.                             AddNewKey Selection[s].pos.controller SD_Dest_Time[i]
  1284.                             Animate on
  1285.                             (
  1286.                                  At time SD_Dest_Time[i] (Selection[s].pos = (at time SD_Source.value (Selection[s].pos)))
  1287.                             )
  1288.                         )
  1289.                         If SD_Rot.checked == True then 
  1290.                         (
  1291.                             AddNewKey Selection[s].Rotation.controller SD_Dest_Time[i]
  1292.                             Animate on
  1293.                             (
  1294.                                 At time SD_Dest_Time[i] (Selection[s].Rotation = (at time SD_Source.value (Selection[s].Rotation)))
  1295.                             )
  1296.                         )
  1297.                         If SD_Scale.checked == True then 
  1298.                         (
  1299.                             AddNewKey Selection[s].Scale.controller SD_Dest_Time[i]
  1300.                             Animate on
  1301.                             (
  1302.                                 At time SD_Dest_Time[i] (Selection[s].Scale = (at time SD_Source.value (Selection[s].Scale)))
  1303.                             )
  1304.                         )
  1305.                     
  1306.                     )
  1307.                 )
  1308.                 --)Catch (MessageBox "Invalid Key Array, Example: 20,50,60")
  1309.             )
  1310.             
  1311.         )
  1312.         
  1313.         -----------------------------------------------------
  1314.         ---------------------
  1315.         --------------
  1316.         
  1317.         --If SD_Key_Roll != undefined then DetroyDialog SD_Key_Roll
  1318.         CreateDialog SD_Key_Roll width:400 height:110
  1319.         --SD_Key_Float = NewRolloutFloater "Create Keyframes" 400 180
  1320.         --AddRollout SD_Key_Roll SD_Key_Float
  1321.         
  1322.     )
  1323.     
  1324.     
  1325. )
  1326.