1. Copy:
Mybox = Box ()
Showsource for I = 1 to 5 do
(
Box_copy = copy mybox
Box_copy.pos = [I * 50, 0, 0]
)
Ii. Sugar gourd
For I in 1 to 10 do
Sphere radius :( I * 10) position: [0, (10*(1.0 * I) ^ 2)-]
3. Mat
Hide Geometry
-- Clear scenario
Spheres = For I in 1 to 10 collect
Sphere radius :( I * 10) position: [(10*(1.0 * I) ^ 2)-, 0, 0]
-- In this example, the created sphere object is collected into an array.
Spheres [3]
-- Access elements in the Array Using Indexes
For I in spheres do print I. Radius
-- Print the radius attribute of all objects in the array
INC = 10
-- Defines a local variable for incremental operations
For angle in 0 to 360 by 30 do
(
Instance spheres rotation :( quat angle z_axis)
)
4. Random color
Mapped function rand_color x =
X. wirecolor = random (color 0 0 0) (color 255 255 255)
For I in 1 to 30 do box pos: [I * 50, 0, 0]
A = for OBJ in $ box *
Where obj. Height> 5 collect OBJ
Rand_color
V. Animation 1
Mybox = Box ()
Animate on
(
At time 0 (mybox. Pos = [-, 0, 0]; mybox. Scale = [, 1])
At time 100 (mybox. Pos = [, 0, 0]; mybox. Scale = [, 3])
)
6. Animation 2 Mesh Animation
K OS = sphere radius: 100
Converttomesh Kos
Animatevertex Kos # All
Animate on
(
For v = 1 to Kos. numverts do
(
V_pos_track = "$" + Kos. Name + ". vertex _" + (V as string) + ". Controller"
V_pos = execute (v_pos_track)
At time 0 v_pos_last = v_pos.value
For t = 1f to 100f do
(
At time t
(
V_pos.value = v_pos_last + (random [-15,-15,-15] [15, 15])
V_pos_last = v_pos.value
)
)
)
7. animation 3 Rotation
Theteapot = teapot ()
Animate on at time 10 rotate theteapot 180 z_axis
8. Floating panel
Rolout test9 "array collection (made by lilianfu)" width: 162 Height: 54
(
Button btn11 "Sugar gourd" POS: [15, 10] width: 80 Height: 35 tooltip: "10 hoists"
On btn11 pressed do
(
Spheres = For I in 1 to 8 collect
Sphere radius :( I * 8) position: [(8*(1.0 * I) ^ 2)-, 0]
)
Button btn13 "mat" POS: [] width: 80 Height: 35 tooltip: "10*50"
On btn13 pressed do
(
Spheres = For I in 1 to 6 collect
Sphere radius :( I * 8) position: [(8*(1.0 * I) ^ 2)-, 0]
-- In this example, the created sphere object is collected into an array.
Spheres [3]
-- Access elements in the Array Using Indexes
For I in spheres do print I. Radius
-- Print the radius attribute of all objects in the array
INC = 10
-- Defines a local variable for incremental operations
For angle in 0 to 360 by 20 do
(
Instance spheres rotation :( quat angle z_axis)
)
)
Button btn12 "curve" POS: [15, 50] width: 80 Height: 35 tooltip: "r = 10"
On btn12 pressed do
(
For I = 1 to 60 do
(
Sphere pos: [15 * I, 80 * sin (I * 8),-80 * Cos (I * 8)] radius: 15
Sphere pos: [15 * I,-80 * sin (I * 8), 80 * Cos (I * 8)] radius: 15
)
)
Button btn14 "box array" POS: [] width: 80 Height: 35 tooltip: "r = 10"
On btn14 pressed do
(
D = Box ()
For I = 1 to 20 do
For j = 1 to 20 do
In D
Copy d pos: [I * 20, J * 20, 30 * Cos (J * 20) + 20 * sin (I * 20)]
)
)
Createdialog test9200 300
9. Modifier
My = Box length: 20 width: 10 Height: 20
My. Name = "redbox"
My. Pos = [0,100, 0]
My. Scale = [2, 3, 2]
Move my [20,-100,0]
Rot_box = eulerangles 30 60 60
(Eulerangles 30 60 60)
Rotate my rot_box
Showclass "*: mod *"
Addmodifier my (twist angle: 30)
10.
-- Set 8 segments for all sphere in the scenario
S = $ sphere **
For S1 in S do
S1.segs = 8
-- Script tracker (Open listener)
-- 1. Shortcut Key F11
-- 2. Macro record macrorecorder/enable
-- Maxscript is its internal language, and its plug-in can only
-- Runs internally. CTRL + e execute the program