home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2002 April / GSSH42002.iso / EDITOREN / DS / gmax / gmaxinst_1-1.exe / gmaxsetup11.cab / Macro_Bones.mcr < prev    next >
Text File  |  2002-02-13  |  4KB  |  128 lines

  1. -- Easy Bones Creation MacroScript File
  2. --
  3. -- Created:          April 18 2000
  4. -- Last Updated:     June 21 2000
  5. --
  6. -- Author :   Frank DeLise
  7. -- Version:  3ds max 4
  8. --
  9. -- IK tools
  10. -- This script increases workflow on Bones and IK.
  11. --***********************************************************************************************
  12. -- MODIFY THIS AT YOUR OWN RISK
  13.  
  14.  
  15. MacroScript New_Bones
  16.  
  17. ButtonText:"Create Bones"
  18. Category:"Inverse Kinematics" 
  19. internalCategory:"Inverse Kinematics" 
  20. Tooltip:"Create Bones System" 
  21. Icon:#("MainToolbar",49)
  22.  
  23. (
  24.     StartObjectCreation Bones
  25. )
  26.  
  27. MacroScript Auto_Bones
  28.  
  29. ButtonText:"Bone Options"
  30. Category:"Inverse Kinematics" 
  31. internalCategory:"Inverse Kinematics" 
  32. Tooltip:"Bone Options" 
  33. Icon:#("MainToolbar",49)
  34.  
  35. (
  36.  
  37.     On Execute do
  38.     (
  39.         If ABone_Roll != undefined then Try(DestroyDialog ABone_Roll)Catch() 
  40.         Rollout ABone_Roll "Bone Options"
  41.         (
  42.             CheckBox ABone_ON "Bone On\Off" Across:2 Checked:False
  43.             Button ABone_ReAlign "ReAlign" Width:80 Align:#Right 
  44.             CheckBox ABone_Auto "Auto Align" Across:2 Enabled:False Checked:False
  45.             Button ABone_ResetStretch "Reset Stretch" Width:80 Offset:[5,0] Enabled:False
  46.             CheckBox ABone_Freeze "Freeze Length" Enabled:False Checked:False
  47.             RadioButtons ABone_ScaleType Labels:#("Scale", "Squash", "None") Enabled:False
  48.             CheckBox ABone_SLinks "Show Links" Across:2 Checked:False
  49.             CheckBox ABone_LinksOnly "Show Links Only" Across:2 Checked:False Offset:[-10,0]
  50.             Button ABone_Sel "Update Selected" Width:150
  51.             Label ABone_1 "----" 
  52.         
  53.             
  54.         
  55.             fn Eval_ABone = 
  56.             (
  57.                 Try(
  58.                 For i in 1 to Selection.count do
  59.                 (
  60.                     Selection[i].SetBoneEnable ABone_On.Checked SliderTime
  61.                     Selection[i].BoneAutoAlign = ABone_Auto.Checked
  62.                     Selection[i].BoneFreezeLength = ABone_Freeze.Checked
  63.                     Selection[i].ShowLinks = ABone_SLinks.Checked
  64.                     Selection[i].ShowLinksOnly = ABone_LinksOnly.Checked
  65.                     
  66.                     Case ABone_ScaleType.State of
  67.                     (
  68.                         1:(Selection[i].BoneScaleType = #Scale)
  69.                         2:(Selection[i].BoneScaleType = #Squash) 
  70.                         3:(Selection[i].BoneScaleType = #None)  
  71.                     )
  72.                     ABone_1.text = ("Auto Boned " + i as string + " Object(s)")
  73.                 )
  74.                 If Selection.Count == 0 then ABone_1.text = ("No Objects Selected")
  75.                 )
  76.                 Catch()
  77.             ) 
  78.             
  79.             On ABone_SLinks Changed State do (Eval_ABone();completeRedraw()  )
  80.             On ABone_LinksOnly Changed State do (Eval_ABone();completeRedraw()  )
  81.             
  82.             On ABone_Sel Pressed Do (Eval_ABone())
  83.             On Abone_On Changed State Do
  84.             (
  85.                 ABone_Auto.Enabled = State
  86.                 ABone_ResetStretch.Enabled = State
  87.                 ABone_Freeze.Enabled = State
  88.                 ABone_ScaleType.Enabled = State
  89.                 ABone_1.Enabled = State
  90.                 Eval_ABone ()
  91.             )
  92.             On ABone_Freeze Changed State Do (Eval_ABone())
  93.             On ABone_ScaleType Changed State Do (Eval_ABone())
  94.             On ABone_Auto Changed State Do (Eval_ABone())
  95.             On ABone_ReAlign Pressed do 
  96.             (    
  97.                 For i in 1 to Selection.count do
  98.                 (
  99.                     Try(
  100.                     Selection[i].ReAlignBoneToChild ()
  101.                     ABone_1.text = ("ReAligned " + i as string + " Object(s)")
  102.                     )Catch()
  103.                 )
  104.                 If Selection.Count == 0 then ABone_1.text = ("No Objects Selected")
  105.             )
  106.             On ABone_ResetStretch Pressed do 
  107.             (
  108.                 
  109.                 For i in 1 to Selection.count do
  110.                 (
  111.                     Try(
  112.                     Selection[i].ResetBoneStretch ()
  113.                     ABone_1.text = ("Reset Stretch On " + i as string + " Object(s)")
  114.                     )Catch()
  115.                 )
  116.                 If Selection.Count == 0 then ABone_1.text = ("No Objects Selected")
  117.                 
  118.             )
  119.             
  120.             
  121.     )
  122.         CreateDialog ABone_Roll Pos:[150,150] Width:200 height:160
  123.         
  124.     
  125. )
  126.  
  127. )
  128.