3D MAX TUTORIALS

 

Transform Script Controller

Main toolbar > Curve Editor (Open) > Select a transform track in the Track View hierarchy. > Track View toolbar > Controller menu > Assign > Transform Script

Graph Editors > Track View – Curve Editor > Select a transform track in the Track View hierarchy. > Track View toolbar > Controller menu > Assign > Transform Script

The Transform Script controller contains all of the information contained in a Position/Rotation/Scale (PRS) controller in one scripted matrix value. Instead of having three separate tracks for position, rotation, and scale, all three values can be simultaneously accessed from one script controller dialog. Because the transform values are defined by a script, they are easier to animate.

The value of the controller script must be a matrix3 value. A matrix3 value is a 4x3 3D transformation matrix. For more information, see the Matrix3 Values topic in the MAXScript reference.

Writing Controller Scripts

The software interprets the text you type into the Script text box as the body of a MAXScript block expression. You can type as many expressions as you want on as many lines as you want, and they are evaluated in turn. The value of the last expression is taken as the controller value. This must yield a matrix3 value.

Since the text is inside a block expression, you can declare local variables that are visible only within the script and are temporary for one evaluation. You can also declare or access global variables that are shared with all other scripts in MAXScript and hold their values from one evaluation to the next.

A controller is always evaluated with respect to a specific animation time by the software. This might be the current time slider or incrementing frame time if an animation is playing, or a rendering is under way. In the case of Script controllers, the time being evaluated is used to establish an automatic "at time" context around the controller script, so any properties you access (outside of other explicit “at time” expressions) yield the correct values for the current controller evaluation time. This means you don't have to do anything special in your scripts to work at the correct time. You can access the evaluation time with the standard MAXScript variable, current Time. You can also reference scene property values at other times by using "at time" expressions in your scripts, as in regular MAXScript programming.

See also

MAXScript Reference

Procedure

To use a Transform Script controller:

  1. Select an object.

  2. Right-click to open the quad menu.

  3. In Transform quadrant, click Curve Editor.

  4. Select the Transform track of the selected object in Track View.

  5. Select Transform Script from the Assign Transform Controller dialog and press OK.

    The Script Controller dialog opens.

  6. Edit the matrix3 value in the Script Controller dialog, and click Evaluate when you are finished.

Interface

After assigning a Transform Script controller, a Properties dialog is available by right-clicking the track in the Track View hierarchy and choosing Properties or clicking the Properties button on the Track View toolbar.

Script—Type the script to compute the controller value here.

Result—Shows the results of an evaluation or any error messages caused by errors in your script.

Evaluate—Evaluates the controller script and prints the result in the Result box. The evaluation is computed for the current position of the time slider.

Close—Compiles and checks the transform controller script. If everything works, the Properties dialog is closed. Any problems result in a query box asking whether you really want to close the box with an incorrect script. If you do, the controller will yield a null value (0, [0,0,0],) when evaluated.


Comments

Home
Selectiong Objects
Selection Commands
Objects Properties
Programmers Forum
Birthday Gift Baskets
Creating Geometry
Transforms: Moving, Rotating, and Scaling Objects
Creating Copies and Arrays
Effects and Post-Production

Systems Animation
Character Assemblies Lights and Cameras
Advanced Lighting
Material Editor, Materials, and Maps
Rendering
3D MAX FORUM

Managing Scenes and Projects
Utilities
User Interface
Customizing the User Interface
Default Keyboards
Transforms: Moving, Rotating, and Scaling Objects
Creating Copies and Arrays
Rendering to Textures

Introduction
Glossary
Getting Started with 3ds max
Viewing and Navigation 3D Space
Modifiers
Surface Modeling
Precision and Drawing Aids
SpaceWarps and Particle
Adobe_Premiere Tutorials

Web Designer - offers freelance web design services, redesign, graphic design, content management, web development and e-commerce.
LTD