Modifiers and Controllers

We can add modifiers to the objects using the Addmodifier command.

  • Create a cylinder width radius=20, height=100 and height segments = 20:
    cyl = cylinder radius:20 height:100 heightsegs:20

Using MAXScript, apply a Bend and a Twist modifier to this object.

  • Type addmodifier cyl (Bend()) and addmodifier cyl (Twist())

To access a modifier applied to an object, you can use many ways:

  • cyl.bend accesses the Bend modifier in the cyl object
  • cyl.twist accesses the Twist modifier in the cyl object
  • cyl.modifiers[1] accesses the first modifier in the list (Twist)
  • cyl.modifiers[#twist] accesses the modifier named "Twist"

Renaming modifiers like Xform, Mesh Select, among others, makes it easier to select them through MAXScript, if not you would have problems to know which modifier you were accessing, because multiple modifiers would have the same names. To rename modifiers in the Stack List, use the Edit Stack button.

Change the Bend angle to 45º and the direction to 30º.

  • Type cyl.bend.angle = 45 and cyl.bend.direction = 30

We can also change the animation controller of any parameter in MAX, using the .controller property.

You will now change the position controller of the cylinder to a Path Controller.

  • Type cyl.pos.controller = Path()

Using showproperties, list the Path Controller's properties:

.axis : integer
.constantVelocity : boolean
.Path
.follow : boolean
.bank : boolean
.bankAmount : float
.smoothness : float
.allowUpsideDown : boolean
.axisFlip : boolean
.percent : float

Now create a shape anywhere in your drawing, and name it Path01.

Using MAXScript you will select this shape as the path in the Path Controller.

  • Type cyl.pos.controller.path = $Path01

If you wish, you can change more parameters in the Path Controller.

You can download the cylinder_bend.max file, which is the result of this lesson.

Alexander Esppeschit Bicalho © 1999