You are previewing 3ds Max 8 MAXScript Essentials.
O'Reilly logo
3ds Max 8 MAXScript Essentials

Book Description

Write your own MAXScript functions and utilities to create custom tools and UI elements, and automate repetitive tasks. Demonstrated techniques include the creation of objects, arrays, collections, control structures, parametric objects, and the construction of UI elements. The companion CD-ROM contains media files that allow you to practice the techniques with real-world examples demonstrating how you can use then in a production environment.

Table of Contents

  1. Cover
  2. Half Title
  3. Title Page
  4. Copyright
  5. Table of Contents
  6. Introduction
    1. What’s New in the Edition
      1. Copying the Exercise Files from the CD
  7. 1. MAXScript Basics
    1. Objectives
    2. Introduction
    3. Syntax and Organization
      1. Comments
      2. Multiline Statements
      3. Variables and Data
      4. Untyped Variables
    4. The MAXScript Listener
      1. Using the MAXScript Listener
      2. Object Properties
      3. Additional Object Properties
    5. Macro Recorder
    6. Functions
      1. Function Parameters and Signature
      2. Creating Your Own Functions
      3. Passing Arguments by Value
      4. Passing Arguments by Reference
      5. Exceptions to Pass by Value (Advanced Topic)
      6. Returning Values from Functions
    7. Local and Global Variables
      1. Defining Variables
      2. Global Variables
      3. Local Variables
    8. Conditional Statements
      1. If-Then Statements
      2. Logical Operators: Not, And, Or
      3. If-Then-Else Statements
      4. List of Operators
    9. Loop Structures
      1. For Loop
      2. Loops with Multiple Statements
      3. While Loops
    10. Collections
      1. Arrays
      2. Array Functions
      3. Printing Arrays
      4. Multidimensional Arrays (Advanced Topic)
      5. Wildcards
    11. Structures
      1. Structure Syntax
      2. Structure Constructor Function
      3. Structure Initialization
      4. Structure Member Functions
      5. Calling Functions During Construction of a Structure (Advanced Topic)
    12. Strings
      1. Concatenation
      2. Findstring
      3. Replace
      4. Converting Between Numbers and Strings
    13. Creating and Running Scripts
      1. Working with Equations
      2. Changing Wireframe Colors with a Loop
    14. Conclusion
  8. 2. Constructing User Interfaces
    1. Objectives
    2. Introduction
    3. Building User Interfaces
      1. Types of User Interfaces
      2. Script Types
      3. MacroScripts
      4. Script Files
      5. Rollouts
      6. Adding User Interface Elements
      7. Event Handlers
      8. Rollout Groups
    4. Creating a Working Script
      1. Creating the User Interface
      2. Adding Event Handlers
      3. Fine-Tuning the UI
      4. Automatically Destroying Dialogs
      5. Adding Pickbutton Events
      6. Using Local Variables
      7. Disabling and Enabling UI Items
    5. Conclusion
  9. 3. The 3ds Max Interface
    1. Objectives
    2. Introduction
    3. Copy, Instance, and Reference
      1. Copy
      2. Instance
      3. Reference
      4. Cloning Nodes Using MaxOps.CloneNodes
      5. Copying Arrays
      6. Max Commands
      7. Command Panels
      8. Main Tool Bar
    4. Picking Scene Objects
    5. Picking Points
    6. MouseTrack (Advanced)
    7. Painter Interface (Advanced)
    8. Conclusion
  10. 4. Understanding Objects and Classes
    1. Objectives
    2. Introduction
    3. Object Oriented Programming
      1. Class Hierarchy
      2. Class Inheritance
      3. Determining Class Types
      4. Instances
      5. Properties
    4. MAXWrapper Class
      1. Methods
      2. Constructors
      3. Get and Set Methods
      4. Mapped Methods
    5. Working with the MAXScript Reference
      1. MAXScript Grammar
      2. Optional Parameters
      3. Return Values
      4. Reference Assignments
    6. Conclusion
  11. 5. Transforms and Animation
    1. Objectives
    2. Introduction
      1. Position and Scale Transform Properties
    3. Position Transform
    4. The Scale Transform
    5. Rotation Transform
      1. EulerAngle
      2. Gimbal Coordinate System
      3. Local Rotations
      4. Quaternions
      5. AngleAxis
    6. Contexts
      1. Coordsys Context
    7. Animation
      1. Controllers
      2. Animation Keys
      3. Key Values
      4. Controller Types
      5. Rotation Axis
      6. Delete Keys
      7. Key Tangents
    8. Conclusion
  12. 6. Working with MAXScript Objects
    1. Objectives
    2. Introduction
    3. Applying Modifiers
    4. Lights and Cameras
      1. Lights
      2. Cameras
    5. Materials
    6. Controlling the Renderer
    7. Callbacks
    8. Randomizing
    9. Conclusion
  13. Appendix
    1. Debugging and Error Trapping and Handling
      1. Error Types
      2. Compile-Time and Run-Time
      3. Debugging Techniques
      4. Stack Trace-Back
      5. Error Trapping and Handling
    2. MAXScript Debugger
      1. Accessing the Debugger
      2. Break Command
      3. Debugger Output Window
      4. Debugger Command Line
      5. Watch Manager Window
      6. Fixing Errors with the Debugger
      7. Setting the Active Frame
      8. Debugger Interface
    3. File Input and Output
      1. File Pointer and Offset
      2. Writing to Files
      3. File Access at the System Level
      4. Open and Save Dialogs
      5. Opening the Save Dialog
    4. Binary File I/O
      1. Writing a Binary File
      2. Reading a Binary File
      3. Additional Binary I/O Functions
    5. Visual MAXScript
      1. Saving and Executing Panels Created with Visual MAXScript
      2. Using the VMS Editor in Another Way
    6. ActiveX Controls in MAXScript Rollouts
    7. Function Publishing System and Interfaces
    8. Expression Controllers and Script Controllers
  14. Index