Sergey Pogosyan

cg artist + cg developer

Script Builder по-русски
ScriptBuilder.ms ScriptBuilder maxscript file 2011-12-19
1.00 KB

Version:
0.3
Release Date:19 December 2011

This script is made after the *nix's MAKE utility.

Description:

It will save-and-compile current script in maxscript editor, but if your script consists of several files (main file, function file) then you can create special build.ms script and describe build process in that file (just like in Makefiles). For example I'm using this build.ms file to build BatchCam2 maxscript:

--build.ms file. compiles script in current directory.
--this file gets called by ScriptBuilder maxscript.

category_name = "Sergo Pogosyan"
script_name = "BatchCam2"
output_file = "BatchCam2_compiled.ms"
full_output_file = \\
 pathConfig.appendPath (getFilenamePath (getSourceFileName())) output_file
try CloseRolloutFloater batchCam2_floater catch()

filein @"BatchCam2.ms" --this is main file that eventually will 'compiled'

if (doesFileExist full_output_file) then
	deleteFile full_output_file	
copyFile (pathConfig.appendPath (getdir #usermacros)\\
 (category_name + "-" + script_name + ".mcr")) full_output_file

macros.run category_name script_name
As you can see this build.ms file closes script window, compiles main script file, re-runs newly compiled script and even makes a copy of compiled script in the development directory.
 
The key feature of this script - access to the maxscript editor's window - is pointed out by Denis from the cgsociety.org. Detailed info could be found in the script source.