|
|
Link Object to a Vertex Added on: Mon Aug 14 2000 |
Page: 1 2 3 4 5 6 7 8 9 10 |
Here is a brief run down on the MAXScript Rollout.
"Open Listener" opens up the MAXScript listener, basically it is the command prompt of MAX.
You can type in stuff like "The_Cube = box length:10 width:10 height:10" and it will make a box at (0,0,0) with those sizes.
"New Script" just opens up a Notepad.exe like thing for writing scripts. Useful hotkeys are "Ctrl + S" to save and "Ctrl + E" to evaluate the script.
"Open Script" opens up a script for editing.
"Run Script" this just runs the script without opening up the editor.
When you run a script it either opens up a floater or adds it to the "Utilities" depending on how you wrote the script.
The "Utilities" selection lists the scripts that you have run or are in your MAXScript start-up folder.
To open that utility's rollout, click on the arrow and the list opens up. Highlight the script you want and release the mouse button. It should open up a Rollout below.
Lets think ahead of what we will need to write in our script.
We will need to select the vertex, and the object that will be linked to the vertex.
Once we select the objects we should link them. No problem, that is only three buttons.
Now to actually move the teapot to the vertex we will use a Scriptable Controller.
A Scriptable Controller is just like a float controller or a bezier controller but the main difference is you can have access to all of MAXScript�s functionality. It is MUCH more powerful than the expression controller.
To keep this script pretty simple it will just get a vertex numberthat the user will select ahead of time and allow the user to pick a child object. To select the vertex the user can apply a meshselect modifier or similar and select the vertex.
Click on New Script and lets begin to write. (There is a list of all the functions I used at the bottom of the tutorial)
First thing we need to write is:
MainFloater = NewRolloutFloater "Link To Vertex" 300 315 This creates the floater in which our buttons will be placed. In other words it is the User Interface to our script.
"NewRolloutFloater" is a built in function that creates the floater. It takes three parameters: name, width, height. The name of the floater is "Link To Vertex" (make sure it is in quotes).
The size of the floater will be 300 315 or width by height (in pixels), this will give us plenty of room. In order to access this floater we need to assign it to a variable, that way we can access it where ever in the script. We assign it by with "MainFloater ="
|
|
|
|