• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/84

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

84 Cards in this Set

  • Front
  • Back
$
current selection
$Box01
select object with name"Box01"
$'TileA'*
select objects with the names starting with'TileA'
move $[10,10,10]
move relatively by 10 units in x
rotate $ (eulerangles 90 0 0 )
rotate relatively 90 degrees around x
scale $[2,2,1]
scale twice in x and y,z is unchanged
$*
select all objects
$.material.difuse = color 255 0 0
change diffuse color to red(for Vray the name of this property is diffuse, for standard materials it is diffuseColor !)
$.material = VRayMtl diffuse:green
reflection:gray reflection_glossiness:0.7
apply green glossy reflective VRay material
$.material = VrayMtl()
apply Vray material
w = 10
h = 10
a = w * h
assign the value 10 to w
assign the value 10 to h
calculate the area a
a=#($Box01,$Box02,$Box03)
array definition with three objects
a.count
returns number of elements in array
a[1].renderable=false
access elements of array with brackets[ ]
$.pos.x = random 0 10
random value between 0 and 10 (integer)
$Box01.height = random 2.0 5.0
random height between 2 and 5 (float)
print $.position
print position of current object
format "% objects selected." selection.count
output number of selected objects
$Tile.parent = $Wall
link Tile to Wall object
animate on (at time 50f(move $ [0,05]))
with Autokey on, move object at frame 50
animate on (at time 100f($.radius=10))
with Autokey on, set radius at frame 100
$.children[1].name = "Tile_01"
set name of first child object
objects
all objects in the scene
geometry
primitives,meshes and other geometry objects
lights
lights(includes Vray and other third party lights)
cameras
cameras
spacewarps
forces, spacewarps, deflectors etc.
$*.material = undefined
removes all materials of the scene
delete $lights/Fill*
delete all lights starting with "Fill"
if a >b do (print d; print e)
a = (if d ==0 then 0 else a/d)
If expression:
if <expr> then <expr> [else <expr>]
if<expr> do <expr>
for i = 1 to 10 do
(
Box pos:[1*30,0,0]
)
Loops:
create 10 boxes at different x positions
for obj in (selection as array)
where classOf obj == Cylinder do
(
obj.scale.z = 2
)
Loops:
set scale value for cylinders in current selection
If($.pos.z<0) then
$.wirecolor = red
else
$.wirecolor=green
Conditional Statement:
set wirecolor to red if object is below 0, otherwise green
if(superclassof $ == Light) then delete $
Conditional Statement:
delete current object if it is a light
function calculateVolume w l h =
(
w*l*h
)
Function:
Multiplies the parameters(width, length, height) when supplied to run the function.
calculateVolume 10 20 50
Function:
Based off function calculateVolume w l h = (w*l*h)
Function call with concrete values: return result will be 1000.
for obj in (selection as array) do
(obj.primaryVisibility = false)
For Loop:
turn off "visible to camera" property for selected objects
for obj in (selection as array)
where hasProperty obj "radius" do
(obj.radius = 10)
For Loop:
set the radius porperty for objects which expose it (applies to spheres and cylinders but not to a box, for example)
for obj in(selection as array) do
(
for m in obj.modifiers where
(classof m) == TurboSmooth do
(
m.enabled = false
)
)
For Loop:
turn off turbosmooth modifiers on selected objects by iterating all objects and also all their modifiers. The classof command checks if m is a TurboSmooth modifier & then disables it.
backgroundColor = color 0 0 0
set environment background color
useEnvironmentMap = false
toggle environment map(true/false)
$sphere01.wireColor = red
Assigns the spheres color property to red using dot notation. ex: .wireColor = r g b
messagebox ("Hello World")
creates a message box that pops up with the message you wrote in string format.
about, and, animate, as, at, by ,case, catch, collect, continue, coordsys, do, else, exit, fn, for, from, function, global, if, in, local, macroscript, mapped, max, not, of, off, on, or, parameters, persistent, plugin, rcmenu, return, rollout, set, struct, then, throw, to, tool, try, undo, utility, when, where, while, with
Reserved words that have fixed meanings & can't be redefined or configured.
x+=1
Short hand version of x = x +1 which is used for incrementing.
Context Expressions
<context> { , <context> } <expr>
<animate> <on> ( do something )
Context expressions are mirrors of some of the most important abstractions in the 3ds Max user interface - the animate button, the time-line slider, the working coordinate system, and so on. Context expressions make it as easy to create animation and perform geometry manipulation in MAXScript as these tools do in the user interface.
[in] coordsys : part of the Context Expressions to manipulate objects inside 3dsmax
coordsys local
coordsys world
coordsys parent
coordsys grid
coordsys screen
about :part of the Context Expressions to manipulate objects inside 3dsmax. It defines the center point about which any scale or rotation operation is performed within its context.
about pivot -- rotates/scales about each object's pivot point
about selection -- rotates/scales about the center of the current selection
about coordsys -- rotates/scales about the coordinate system
about <node> -- rotates/scales about the pivot of give node
about $foo rotate $box* 30 y_axis
rotate all the boxes 30 degrees about the y_axis of $foo
in coordsys parent about coordsys rotate $planets* 45 z_axis
rotate each planet 45 degrees around its parent
in coordsys local selection.pos = random [-20,20,20] [20,20,20]
randomly jiggle each object in the selection around +/- 20 units
in coordsys parent rotate selection (EulerAngles 0 0 90)
rotate objects in parent’s coordinate system
at time : context corresponds to the 3dsmax time slider.
-- generate a keyframed animation of $foo randomly chasing $baz
animate on
for t in 0 to 100 by 5 do
at time t
$foo.pos = $baz.pos + random [-10,-10,-10] [10,10,10]
about: context defines center point about which any scale or rotation operation is performed.
about selection : Rotates/scales about the center of the current selection

about pivot: Rotates/scales about each object's pivot point

about coordsys: Rotates/scales about the center of the current working cord. system set using the coordsys context expression.

about<node>: Rotates/scales about the pivot point of the given object.

about <matrix3>: Rotates/scales about the center of the coordinate system specified by the given 3D matrix

about <point3>: Rotates/scales about the given point with coordinate system and axes taken from the current working coordinate system.
about $foo rotate $box* 30 y_axis
rotate all the boxes 30 degrees about the y_axis of $foo
in coordsys parent about coordsys rotate $planets* 45 z_axis
rotate each planet 45 degrees around its parent
coordsys : [ in ] coordsys corresponds to the current reference coordinate system
[in] coordsys world : Use the world space coordinate system

[in] coordsys local: Use the object's local coordinate system

[in] coordsys parent: Use the object's parent's coordinate system

[in] coordsys grid : Use the currently active viewport’s coordinate system

[in] coordsys screen : Use the currently active viewport’s coordinate system

[in] coordsys <node>: Use the specified node's local coordinate system - this is equivalent to the "pick" coordinate system capability in the 3ds Max user interface

[in] coordsys <matrix3> : Use the coordinate system specified by the given 3D matrix
animate on
(
for i in selection do
(
in coordsys local i.position = [random -20 20,random -20 20,random -20 20]
)
)
randomly jiggle each object in the selection around +/- 20 units
animate on
(
in coordsys parent rotate selection (EulerAngles 0 0 90)
)
rotate objects in parent’s coordinate system
set: perform "sticky" actions. context established to perform code that follows up,until you declare a new "sticky" action. Establishing a "sticky" context is accomplished with set.
set can be used on •animate , •time , •in , •coordsys , •about , •level , or •undo

EXAMPLE:
set animate on
set time 30f
move $foo [80,0,0]
scale $baz [1,1,3]
$bar.bend.angle += 23
set animate off
set time off
try: Error-trapping scheme but limited to the fact you can't get error codes or info about error that occured.
try <protected_expr> catch <on_err_expr>

•the protected_expr is executed & any errors that occur are trapped and on_err_expr is executed.

•If there are no errors the on_err_expr isn't executed.
catch: Part of Error-trapping scheme that will execute if bumps into error.
catch is part of the <on_err_expr>
throw: can be used to generate your own runtime error and pass on an error you caught when doing some interim clean-up
• Will execute outer catch if you have nested try/catches.
throw ("Hey")

this returns -- Runtime error: Hey
f = openFile "foo.dat"
try
while not eof f do read_some_data f
catch
(
messageBox "bad data in foo.dat"
results = undefined
)
close f
In this example, any errors in reading or processing the data in the read_some_data() function are trapped, then a Message box is displayed and some clean-up is done.

This is a good example of a use for the simple error-trapping.
• classOf $
• superclassOf $
returns the class of the node and superclass of the node
t = targetObject()
Creates a target object assigned to variable t. *Hint: type classOf on targetObject will return Targetobject, but superclassOf will return GeometryClass(however you can't modify this as you can typical geometry)
tc = TargetCamera pos[100,100,100]
Creates a TargetCamera at coordinate [100,100,100] assigned to variable tc.
tc.target = t2
The targetObject you created with variable t2, is now the targetObject for the TargetCamera you created using variable tc. The two are joined and complete.
for i = 1 to 200 do sphere pos:(random[-300,-300,-300] [300,300,300]) radius:(random 2 40)
Create random sized spheres in the [300,300,300] coordinate space.
$Sphere*.radius = 10
Selects all spheres and adjusts their radius to 10.
for o in $ where hasProperty o "radius" do o.radius = 10
Selects objects with a radius property in your selection and sets the radius to 10.
for o in selection do for m in o.modifiers where classof m == Bend do m.angle = 45
Nested for loop,this will filter all modifiers which & if they equal a bend type modifer and edit their angle value.
Reserved Keywords
about

and

animate

as

at

by

case

catch

collect

continue

coordsys

do

else

exit

fn

for

from

function

global

if

in

local

macroscript

mapped

max

not

of

off

on

or

parameters

persistent

plugin

rcmenu

return

rollout

set

struct

then

throw

to

tool

try

undo

utility

when

where

while

with
theBox = box width:10 length:10 height:10
for y = 0 to 9 do for x = 0 to 9 do (copy theBox).pos = [ 50*x, 20*y, 0]
delete theBox
•creates a box called theBox.
• for loop iterates 9 times to copy theBox on the x and y axis.
• copies on x every 50 units, copies on y every 20 units
• delete the original theBox leaving you with a total of 100 boxes.
theOffset = 0
for o in $Box*do moveKeys o.height.controller(theOffset +=1)
This will offset your keyframes by one to each object.
*This does depend on your object copy order.
Turn on/off network rendering.
rendusenet = true
rendusenet = false
select every object in the objects where the object’s material is not defined
select (for o in objects where o.material == undefined collect o)
For every object in our selection where the material is not undefined put it in the material slot of the same index (will bug after 24)
for i = 1 to selection.count where selection[i].material != undefined do meditmaterials[i] = selection[i].material
Make the material in slot 1 of the material editor the current object’s material, just because it’s a pain to pick some times.
meditmaterials[1] = $.material
showproperties (variable)

EX: showproperties b
Shows the objects properties you can edit and manipulate.
EX:
.height: float
.length: float
.lengthsegs: integer
.width: float
.widtsegs: integer
.mapCoords: boolean
.heightsegs: integer
addmodifier b (taper())
Adds a taper modifier to b. To show properties of b so you can edit them type:
showproperties b.taper
.curve: float
.limit: boolean
.upperlimit : float
.lowerlimit: float
.amount: float
.primaryaxis: integer
.effectaxis: integer
.symmetry: boolean
.center : point3
.gizmo:transform
Radio Buttons : choose among several options
syntax:
• type is the var assigned to the radio buttons
•"Type" is the caption text displayed in the UI
•labels:#("Noise","Smoke") are the options
•columns defines the number of columns
The Colorpicker:

colorpicker col "Material Color" defalut:[180,180,180]
on col changed val do
(
mat.diffusecolor = val
mat.ambientcolor = val/2
)
dfd
utility:

utility assign_color "Assign Color"
typing 'utility' at the very top of the script will allow this script to run from the utility>MaxScript button.

In this ex: assign_color is our var & 'Assign Color' is our text in our UI