0% found this document useful (0 votes)
723 views20 pages

MAXScript For Artists PDF

MAXScript is a scripting language for 3DS Max that allows users to automate tasks. It can execute scripts ending in .ms directly or .mcr macro scripts associated with the user interface. The MAXScript listener window provides a console to run scripts. Variables are used to store and reference data in scripts and have different scopes. Common operations include conditionals, loops, and working with objects and their classes. The document provides examples of one-line scripts for tasks like disabling VRay displacement or creating colorful teapots. Additional resources are recommended for learning more about MAXScript.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
723 views20 pages

MAXScript For Artists PDF

MAXScript is a scripting language for 3DS Max that allows users to automate tasks. It can execute scripts ending in .ms directly or .mcr macro scripts associated with the user interface. The MAXScript listener window provides a console to run scripts. Variables are used to store and reference data in scripts and have different scopes. Common operations include conditionals, loops, and working with objects and their classes. The document provides examples of one-line scripts for tasks like disabling VRay displacement or creating colorful teapots. Additional resources are recommended for learning more about MAXScript.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

{

MAXScript For Artists


{ Anton Vasilescu
http://75ive.com
What is MAXScript?

MAXScript is a built in scripting language for


3DS Max which helps with automating tasks. It
allows you to perform and automate almost all
the tasks which are performed by the 3DS Max
user interface.

ANTON VASILESCU http://75ive.com


Types of scripts

.ms which can be run and will execute directly


from the MAXScript editor or through the Run
Script command

.mcr or MacroScripts are associated with user


interface elements and acts as a wrapper for a
regular .ms file.

* To edit a .mcr file which is added to your


interface, just right click on its icon

ANTON VASILESCU http://75ive.com


How to run a MAXScript
MAXScript menu/Run Script

Utilities panel/MAXScript button

ANTON VASILESCU http://75ive.com


MAXScript Listener
You can open it one of the following ways:
1. From the MAXScript menu/MAXScript Listener

2. Right click on the mini listener on the bottom left


corner of the UI and choose Open Listener
Window

1. Press the F11 key

ANTON VASILESCU http://75ive.com


Listener as custom viewport
Open the Viewport Configuration panel, choose your
layout then click on the desired panel and click on
Extended/MAXScript Listener option in the newly
opened menu

ANTON VASILESCU http://75ive.com


MAXScript Help
YOUR BEST FRIEND!
How to use it:
Contents displays all the topics in an ordered
fashion. Great to use when you start to familiarize
yourself with the document and its structure

Index displays all the commands in alphabetical


order and its the easiest to find what you are
looking for with

Search use it when you dont know the commands


name. The results are quite overwhelming and its
quite hard to pinpoint what you need

Favorites use it as much as you can to save the


topics you feel like you need most

ANTON VASILESCU http://75ive.com


Variables
How to define a variable:

Variable types:
Boolean true / false
Number (integer & float) 1, 1.0
String this is a string
Time 2.5s, 1m15s, 18.25f, 4800t, 0.5n
Pathname $box01, $torso/left_arm, $*box*
2d and 3d point [1,2], [1,2,3]
Array #(1,2,3), #(1, foo, #(1.2, 3), [1,2,3])

ANTON VASILESCU http://75ive.com


Variable Types
Local Variables - Local variables can only exist within a
block. For this reason, they must be created in a block. If
you try to define a local variable from the top level of
MAXScript, you will receive an error message.

Global Variables - when a variable is global, it means that


the variable can be used anywhere in the program.

Persistent Global Variables - You declare a particular


global to be persistent and the value it contains is always
saved to and restored from scene files as they are opened
and closed. Therefore, you can keep direct references to
objects in the scene in variables and those references will
persist across scene save and reload.

ANTON VASILESCU http://75ive.com


Variable Scope
Variable scope is one of the most important things and best
grasped in the beginning!

You could imagine the scopes as an onion with nested


"layers". When a local variable is created at a certain level, it is
visible only at this level and all scopes nested inside of it.

* Best practice is to always have your script enclosed in a pair


of parentheses

ANTON VASILESCU http://75ive.com


Object Sets
ObjectSets represent the main scene object
categories in 3ds Max

selection
objects
geometry
lights
cameras
helpers
shapes
systems
spacewarps

ANTON VASILESCU http://75ive.com


Classes & Superclasses
All objects with similar properties are part of similar
a class. For example all spheres are part of the
Spehre class. All omni lights are part of the
Omnilight class.

SuperClasses more generic classes from which each


individual object class is derived. For example all
geometry objects are part of GeometryClass.

To query the objects about their class you would use


the following functions:
classOf
superClassOf
isKindOf

ANTON VASILESCU http://75ive.com


Conditionals
Comparison Expressions Logical Expressions
== equal or
!= not equal and
> greater than not
< less than
>= greater than or equal
<= less than or equal
If/Do (not recommended!), If/Then, If/Then/Else

CaseOf

ANTON VASILESCU http://75ive.com


Loops
The loops are used to iterate through a range of
numbers, time values, or a sequenced collection of
values, such as an array or object set.

For Do/Collect

For Where Do/Collect

While/Do

ANTON VASILESCU http://75ive.com


One liner scripts

ANTON VASILESCU http://75ive.com


Disable Vray Dsplacement

ANTON VASILESCU http://75ive.com


Colorful Teapots

ANTON VASILESCU http://75ive.com


Geometry from Spline

ANTON VASILESCU http://75ive.com


Additional Resources

http://75ive.com/tutorials/
http://Scriptspot.com
http://forums.cgsociety.org/forumdisplay.php?f=98
Google MAXScript!

ANTON VASILESCU http://75ive.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy