Pages

Thursday, February 26, 2009

Including Scripts Within MacroScripts

A typical MacroScript will usually start like this:

macroScript scriptName category:"CategoryName"
(
   ...
)

The MacroScript could hold more then one macros in the same *.MCR file.
Example:

macroScript Free_Camera category:"Cameras"
tooltip:"Free Camera" Icon:#("Cameras",2)
(
   StartObjectCreation FreeCamera
)

macroScript Target_Camera category:"Cameras"
tooltip:"Targeted Camera" Icon:#("Cameras",1)
(
   StartObjectCreation TargetCamera
)

But there is one more cool extras - fileIn to refer to external *.MS file:

macroScript MaxToFBX
category:"Exporter"
tooltip: "Export to FBX"
Icon:#("Systems",3)
(
   fileIn (GetDir #Scripts + "\\MaxToFBX.ms")
)

At this time there is no way to encrypt MacroScripts (.mcr).
So this method is suitable for encrypted MaxScripts (.mse).
And for other purposes too.

No comments:

Post a Comment

Thanks for your comment