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

  1. -- Macro Scripts File
  2. -- Created:  Nov 17 1998
  3. -- Modified: Feb 27 1999 9:35pm
  4. -- Author:   Frank DeLise 
  5. -- Macro Scripts Fucnction for Modifiers
  6. --***********************************************************************************************
  7. -- MODIFY THIS AT YOUR OWN RISK
  8.  
  9. -- AddMod Modname Example:(Addmod Bend) Will Check to see if an object can have this type of modifier applied and add it.
  10.  
  11. FN AddMod Modname =
  12. (
  13.     If $ == undefined then
  14.     (
  15.         MessageBox "Please Select an Object first " title:"Modifiers"
  16.         false
  17.     )
  18.     Else 
  19.     (
  20.         If (ValidModifier $ (Modname)) then 
  21.         (
  22.             Try 
  23.             (
  24.                 If SubObjectLevel == undefined then (Max Modify Mode)
  25.                 modPanel.addModToSelection (Modname())
  26.                 true
  27.             )
  28.             Catch
  29.             (
  30.                 MessageBox "Modifier cannot be applied to this object."
  31.                 false
  32.             )
  33.         )
  34.         Else
  35.         (
  36.             MessageBox "Modifier cannot be applied to this object."
  37.             false
  38.         )
  39.     )
  40. )
  41.  
  42.  
  43. -- Utility function for macroScripts
  44.  
  45. Struct mcrUtils (
  46.   
  47.   -- return true when at editable mesh or edit mesh in modify panel
  48.     fn EditingMesh = selection.count == 1 and
  49.     (    Try
  50.         (    local co_class = Classof (modPanel.GetcurrentObject ())
  51.             co_class == Edit_Mesh or 
  52.             co_class == Editable_Mesh
  53.         )
  54.         Catch (false) 
  55.     ),
  56.  
  57.   -- Returns true of the modifier is applicable to the current selection set
  58.     fn ValidMod Mod = 
  59.     (    Try ( ($ != undefined) and (isKindof Mod Modifier) and (ValidModifier $ Mod) )
  60.         Catch (false)
  61.     ),
  62.   
  63.   -- Return true of the class passed to it is currently being created.
  64.   fn IsCreating Obj = 
  65.   (     Try ( (iskindof Obj node) and (isCreatingObject Obj) )
  66.           Catch (false)
  67.   )
  68. )
  69.  
  70.