Search ProofOfProgress Blog

Wednesday, March 9, 2011

Expose Nodes To Script Controllers in MaxScript



--Example of how to use a script controller: March2011

ScriptHolderOBJ = Sphere(); --Create object to hold script controller.
TestNode = Box(); --Object to expose to script controller

assembled_EXE_string = "quat 0 0 0 1 --I like Pie. I would eat it every day if I could.";

--*********************************************************************
--MUST ADD SCRIPT CONTROLLER TO OBJECT BEFORE YOU EDIT IT!!
--If you don't, none of your edits to the controller will stick and you will
--Be left with an empty script controller.
--*********************************************************************
SCON = Rotation_Script() --Script Controller for Rotation. (Position is "Float_Script" )
ScriptHolderOBJ.rotation.controller = SCON;

--Add The Hard Coded Nodes to script Controller.
SCON.AddNode "ExposedNode_01" TestNode --Equivalent of AddNode button.

--This step must
SCON.Script = assembled_EXE_string;

No comments:

Post a Comment