Reprinted from Http://www.cgjoy.com/thread-177298-1-5.html
First of all we need to know a few of Max's areas related to scripting and testing.
In the command panel, click
<ignore_js_op>
button, open the Application panel, click the Max Script button, and the MaxScript window appears in the application panel, shown in 1-1.
<ignore_js_op>
Script Listener Window
The script listener is also called the Script Tracker, click the Open Listener button in the MAXScript Scroll window, or select Maxscript/maxscript in the menu bar Listener
command, shortcut key F11.
<ignore_js_op>
You can also right-click the Mini-listener (mini listener) at the bottom left of the user interface to open the Script Listener window.
<ignore_js_op>
The Script Listener window is a command edit and execute window, it consists of two parts, the upper part is the Macro record window, the lower part is the script run result Output window.
<ignore_js_op>
Script editing window
Click the New Listener button in the MAXScript Scroll window, or select the maxscript/new Scrip command in the menu to open the Script editing window, shown in 1-5.
<ignore_js_op>
Let's go straight to the chase. Use the Script editing window to edit some of the controls under customization:
1. Create a floating dialog box:
<ignore_js_op>
Rollout floater "Floating window": The type of the definition window is a Rollout window with the title name "Floating window"
Createdialog Floater: To create this floating window note that the defined variable name "Floater" must be the same, width and height represent the window widths and heights, the last 2 parameters represent the background color and the foreground color, and the middle must be separated by parentheses. Write the contents of our definition within parentheses. We then solve the ctrl+e or tools evaluate all to get the following result:
<ignore_js_op>
Of course, this floating window can also define some menu bar, below we define the menu. First, let's look at our following statement:
<ignore_js_op>
We start by defining the floating window above the definition menu statement, and then we add menu:tdhmenu after the definition of rollout, where Tdhmenu is the definition of the menu variable bracket is still our definition of the content, now we are just the statement format description, the content is empty. We run the knots that can be needed.
<ignore_js_op>
On our window appeared the name of my definition of the submenu menu. Below we are further writing, in our menu, the method of defining a dropdown submenu:
<ignore_js_op>
For example, the red box is the newly added 2-word menu of the statement 2 submenus whose names are open and closed respectively.
After running, you can get the desired effect.
Here we write controls for our floating windows, and there are many controls in Max, such as:
<ignore_js_op>
We first add the above control specific statements in the floating window as follows:
<ignore_js_op>
Where range indicates that the range of values for the spinner control is 100 to 100 the default is 0 Fieldsidth: Represents the width of the spinner control ToolTip: represents the prompt character when the mouse moves to the top. Where the scale of each point of the spinner change the minimum value, and the definition of the properties of each control is not the same, we can refer to the material, the specific method of writing is this, in the following
<ignore_js_op>
Where the expression "#" in front of #center is the name
The above tutorial we simply wrote a way to make such a control panel, this is just one of them, let's use this knowledge to write a small script to make a
<ignore_js_op>
As a floating window in a rollout, and then create a press Bull "Gonghu" point to open it and pop a floating window, in the floating window of the menu point to the First submenu, pop up a "you can understand no" prompt dialog box
Here's a simple script to create a box, as follows:
<ignore_js_op>
As above, the trigger event for spinner is "on". Changed Val do "
For I in selection does indicates what to do when I is selected
Here is a script to create a chain.
<ignore_js_op>
The results of the run after execution are as follows:
<ignore_js_op>
This knowledge of intermediate events and function definitions, etc. refer to Max's help file to find out the relevant commands
I am also a CG enthusiast. Usually bored when you look at the script, the function is very strong, I am also a beginner. Write a bad place please correct me, hope to know more script-writing friends, together to improve progress.
Here's my artwork and some of the skeleton's assembly works:
<ignore_js_op>
<ignore_js_op>
<ignore_js_op>
MAXScript (1)