3ds Max 8 MAXScript Essentials
eBook - ePub

3ds Max 8 MAXScript Essentials

  1. 256 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

3ds Max 8 MAXScript Essentials

About this book

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 downloadable resources contain media files that allow you to practice the techniques with real-world examples demonstrating how you can use then in a production environment.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access 3ds Max 8 MAXScript Essentials by Autodesk in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Games. We have over one million books available in our catalogue for you to explore.

Information

MAXScript Basics

Chapter 1

Learning the basics of MAXScript is similar to learning the basics of any other programming language. In this chapter, you will first learn how to access MAXScript, then proceed to common concepts of programming languages such as syntax, logic, and program flow. You will then finish by learning how to code a basic script.

Objectives

After completing this chapter, you should be able to:
Understand MAXScript basics.
Use the MAXScript Listener and Macro Recorder.
Create variables, work with different data types, and use functions.
Create and modify objects.
Create arrays and loops.
Work with both the MAXScript Listener and MAXScript Editor.

Introduction

This chapter provides you with an introduction to MAXScript and some of its most commonly used tools. By the end of this chapter, you will be able to write simple scripts and use both the MAXScript Listener and Editor.
To perform the exercises in this book, you should be using 3ds Max in its default configuration with units set to Generic Units.

Syntax and Organization

A script is a series of statements written out in text form. 3ds Max interprets what is written in a script, then performs the action. If the statements are not written correctly, the script will not execute properly, or it might not run at all. The sequence and organization of script commands, called syntax, is very precise. Deviations from correct syntax will cause an error in the script. Usually, MAXScript will let you know if you’ve scripted something it doesn’t understand.
It is important to keep your scripts neat and readable. To create scripts that are easy to read, you can indent with tabs and spaces to help delineate special items or functionality. 3ds Max ignores white-space characters, such as extra spaces or tabs, when processing scripts. The examples in these chapters demonstrate one way to indent. You can indent differently, but you should always be consistent.

Comments

You can use comments to make your script more understandable to others. Comments are blocks of text in your script, written in plain English, which explain or document what your script is doing or how it is doing it. You should use comments in all your scripts. This is especially important if a script is large or complex.
Comments are not executable script statements. You indicate that text is a comment by placing a double hyphen (--) at the beginning of the comment. You can put a comment on a new line, or on the same line as a script statement. Any text that begins with a double hyphen is ignored. You can put the double hyphens on several lines if you like. For example:
b = box()
b.length = 20.0
-- Here is a comment.
-- Here is a second comment, which continues
-- on this line. The next line is part of the script.
b.width = 30.0
The next example shows how to place a comment on the same line as a script statement:
b = box() --Create a box, comment is ignored
Comments can span several lines if you begin with the two characters /* and end with the two characters */ (or the end of the file). Anything between these characters is considered a comment. Comments expressed in this manner are called block comments. For example:
s = sphere()
/* We’ll place a large comment here that doesn’t require delimiters on each line because now we are using block comments.*/
s.radius = 10.0
This syntax can also be placed on a single line, between script text:
s = sphere /*large radius*/ radius:100.0

Multiline Statements

Script statements are executed, or interpreted, one line at a time. Sometimes a MAXScript statement can be quite long. You can place long statements on multiple lines by using a backslash (\) to indicate that a statement continues. The following example shows a long script statement written across several lines.
Original script command:
torus radius1:10 pos:[0, 0, 20] wirecolor:[225, 230, 100]
The same command spread over several lines:
torus radius1:10 \
pos:[0, 0, 20] \
wirecolor:[225, 230, 100]
The text was indented several spaces on each new line. 3ds Max ignores the spaces, but the indentations make it easier for you and other programmers to read.

Variables and Data

In any programming language, items are represented by variables. V...

Table of contents

  1. Cover
  2. Half Title
  3. Title Page
  4. Copyright Page
  5. Original Copyright Page
  6. Contributors
  7. Table of Contents
  8. Introduction
  9. 1 MAXScript Basics
  10. 2 Constructing User Interfaces
  11. 3 The 3ds Max Interface
  12. 4 Understanding Objects and Classes
  13. 5 Transforms and Animation
  14. 6 Working with MAXScript Objects
  15. Appendix
  16. Index