MAXScript101_3.3 Working with Modifeirs
1. modifier
-- operation (1): add a modifier: way 1
b = bend angle:45 direction:90
addModifier $box01 b
-- operation (2): add a modifier: way 2
addModifier $box01 (twist angle:90)
-- operation (3): get existing modifiers
$box01.bend
$box01.twist
-- operation (4): adjust bend modifier
$box01.bend.angle += 20
-- operation (5): get all modifires or one modifier for an object
$box01.modifiers -- #modifiers(TwistMod: Twist, ... )
for m in $box01.modifiers do pring m.name
-- top modifier
$box01.modifiers[1].angle = 45
-- bottome modifier
botMod = $box01.modifiers[$box01.modifiers.count]
-- index modifier by it's name
bendM = $box01.modifiers["Bend"]
2. most modifier parameters are animatable
-- 在小球进行转动的时候,长柱子向小球方向弯曲
addModifier $column (bend())
animate on
for t in 0 to 100 by 5 do
at time t
(
local dv = $ball.pos - $column.pos
$column.bend.angle = atan2 dv.z dv.x
$column.bend.direction = -(atan2 dv.y dv.x)
)
3. For detatails, please refer to MAXScript Reference
. Modifier Common Properties, Operators and Methods: eg. deleteModifier ...