The [ with ] animate <boolean_expr> context corresponds to setting the Animate button in the 3ds max user interface. Placing an expression, operation, or block-expression within an animate on context causes keyframes to be generated whenever an animatable property of a 3ds max object is changed, regardless of the actual state of the Animate button. Likewise, placing an expression within an animate off context prevents keyframes from being generated whenever an animatable property of a 3ds max object is changed. Expressions that change an animatable property of a 3ds max object, and are not within an animate context, will generate keyframes only if the Animate button is on.
Setting the animate context on or off does not affect the state of the Animate button. The state of the Animate button can be queried and set using the animButtonState global variable. The user can be prevented from changing the state of the Animate button using the animButtonEnabled global variable.
Examples:
loadheight=obj.pos.z
-- lift object, no key generated
animate off
obj.pos.z=loadheight+LiftHeight
-- Create key at time tStart to keep object lifted until that time.
-- If tStart != 0, a key will also automatically be created at frame 0.
-- Then create a key at time tEnd to drop the object
with animate on
(
at time tStart obj.pos.z=loadheight+LiftHeight
at time tEnd obj.pos.z=loadheight
)