Online Help Script Examples

The following sample scripts can be found at various places in this Help file as illustrations of certain features. They could be used directly or with small changes in the daily practice or as a starting point for your own scripts. This index should help you locate them quickly.

Sample Scripts

My First Utility Example

Shows the creation of simple Scripted Utility.

Skyscraper Extrusion

Illustrates the usage of EditablePoly extrususion functions

Atmospheric Effects Test Bed

Illustrates the creation of Atmospheric effects.

ListView ActiveX Control

Shows the creation and usage of the ActiveX ListView control by Microsoft.

Excel Spreadsheet ActiveX Control

Illustrates the creation and properties inpsection of an Excel Spreadsheet control.

IE Browser ActiveX Control

Illustrates the creation of an Internet Explorer ActiveX control in a rollout.

Windows MediaPlayer ActiveX Control

Shows the creation and usage of an ActiveX Windows Media Player control.

WinsockTester

Demonstrates the creation and usage of an ActiveX Winsock control.

Save Multi-Frame Image File

Shows the correct way for saving multi-frame image files.

Convert Bitmap to Script

Shows a way to convert a bitmap to MAXScript in order to distribute bitmaps as part of the script code.

NetRender Examples

Shows the correct way to work with the NetRender interfaces.

TrackBarKeyLimit

new.gif NEW: Implements a limit spinner to control the number of keys allowed to be displayed in TrackBar using a trackbar filter callback function.

Scripted Functions

Apply_Planar_Map_Function

Shows the application of planar mapping

CalculateVolumeAndCenterOfMass

Reimplements the Measure Utility's functionality for finding the Volume and Center Of Mass of Geometry Objects.

drawLineBetweenTwoPoints

Shows how to create a simple line between two points in space.

EdgeVerts

Returns the two vertices used by an edge.

FlipObjNormals

Flips all normals of an editable mesh by reversing vertex order.

getLocalFaceRotation

Returns the local face rotation as displayed in the Transform Type-In.

getFilesRecursive

Returns all files matching a pattern from a given root and all its subdirectories.

TimeFromSolarTime

Returns the time value stored in a Daylight_Slave_Controller

GetCamVFOV

Returns the Vertical FOV of a Camera

getFaceSmoothGroupB

Gets the EMesh Smoothing Groups

setFaceSmoothGroupB

Sets the EMesh Smoothing Groups

maybe_saveMaxFile

Shows a replacement function for saveMaxFile to check for existing files and prompting before overwriting.

maybe_saveNodes

Shows a replacement function for saveNodes to check for existing files and prompting before overwriting.

setNodeWorldRotation

Sets a node's rotation relative to world space

sortMultiSubById

Sorts the sub-materials of a Multi/Sub material by their Material IDs.

splitMeshByUVElements

Splits a mesh to elements based on the UVW Face Elements.

UpperCase_function

Converts a mixed case string to upper case.

MacroScripts

Free Camera Creation MacroScript

Illustrates the definition of Macro Scripts

GrabViewport MacroScript

Illustrates the use of gw.getViewportDib() to access and save the viewport bitmap.

PolyToElement MacroScript

Shows how to split every polygon in an EditablePoly into an Element.

Render to RamPlayer

Illustrates the usage of rollouts and rolloutFloaters in macroScripts

SubObject Vertex

Illustrates the definition of Macro Scripts

SuperExpertMode

Implements a Super Expert Mode with just the viewports and main menu visible.

Parameter Wire altExectute

Illustrates the definition of alternative execute handlers in MacroScripts

MicroListener

new.gif NEW: Illustrates the use of the Execute method to convert strings into MAXScript expressions.

Grow/Shrink/Loop/Ring Skin Selection

new.gif NEW: Implement Skin Selection Grow/Shrink, Loop and Ring ActionItems to be used in QuadMenus when skinning.

Editable Mesh Selection Converter MacroScripts

Edge2FaceSel

Convert Edge to Face Selection in Editable Meshes

Edge2PolySel

Convert Edge to Polygon Selection in Editable Meshes

Edge2VertSel

Convert Edge to Vertex Selection in Editable Meshes

Face2EdgeSel

Convert Face to Edge Selection in Editable Meshes

Face2VertSel

Convert Face to Vertex Selection in Editable Meshes

Vert2EdgeSel

Convert Vertex to Edge Selection in Editable Meshes

Vert2FaceSel

Convert Vertex to Face Selection in Editable Meshes

SelOpenEdges

Select Open Edges in Editable Meshes

Scripted Plug-ins

Extended Rect Shape Plugin

Illustrates the creation of Scripted Shape Plug-ins

lightMaster

Illustrates the application of Scripted Plug-in Methods. See also threeLights.

threeLights

Illustrates the application of Scripted Plug-in Methods. See also lightMaster.

Negative renderEffect

Illustrates the creation of Scripted RenderEffect Plug-ins

Normal Spline Modifier Plug-in

Illustrates the creation of Scripted Modifier Plug-ins

SaddleDeform simpleMod

Illustrates the creation of Scripted SimpleMod Plug-ins

SquareTube simpleObject

Illustrates the creation of Scripted SimpleObject Plug-ins

Supa Mod modifier

Illustrates the creation of Scripted Modifier Plug-ins

SupaGlass material

Illustrates the creation of Scripted Material Plug-ins

Super Blur FX renderEffect

Illustrates the creation of Scripted RenderEffect Plug-ins

Super Color Balance FX renderEffect

Illustrates the creation of Scripted RenderEffect Plug-ins

Super Fog Env atmospheric

Illustrates the creation of Scripted Atmospheric Plug-ins

Texture Plane SimpleObject

Illustrates the creation of Scripted SimpleObject Plug-ins with UVW Coordinates

Tower plugin

Illustrates the creation of Scripted SimpleObject Plug-ins

How To Tutorials:

How To ... Develop A Transform Lock Script

Developing a simple script for checking all Transformation locks.

How To ... Remove All Materials

Creating a very simple script removing all materials from the scene.

How To ... Quickly Rename Selected Objects

Developing a simple renaming utility to change the names of selected objects

How To ... Select Non-Quad Polygons

Example of accessing and selecting Polygons in an EditablePoly object.

How To ... Assign Materials Automatically

Shows how to use MAXScript callbacks to automate material assignment

How To ... Move Objects to a Surface

Shows how to use the intersectRay function to find surface points on objects.

How To ... Output Object Data To File

Shows the basic of writing object data to an external text file.

How To ... Output Geometry Data To Text File - Part One

Shows the basic of writing mesh geometry data to an external text file.

How To ... Read Geometry Data From Text File - Part One

Shows the basic of reading object data from an external text file.

How To ... Output Geometry Data To Text File - Part Two

Enhances the mesh geometry output script with support of smoothing groups, material ids and edge visibility.

How To ... Read Geometry Data From Text File - Part Two

Enhances the input script developed in Part One to support the new data added by the preceding tutorial.

How To ... Create a Quick Preview

Implements a simple viewport preview and automatic RAMplayer loading

How To ... Access the Z-Depth channel

A small experiment creating objects based on the Z-Depth of the camera

How To ... Create a MonoChrome RenderEffect

A simple example of a scripted RenderEffect plug-in

How To ... Create Custom Mesh Object

Shows how to create a custom mesh object

How To ... Create Scripted Geometry Plug-in

An example of a scripted geometry plug-in

How To ... Create a Dalmatian TextureMap Plug-in

An example of a scripted texture map plug-in in the famous polka-dot dog look

How To ... Access Windows System Data

Shows an approach to access system data that is not directly exposed to MAXScript

How To ... Sort TrackView Alphabetically

Shows an approach to sort the objects in the TrackView

How To ... Flatten a SplineShape

Example of modifying a slineShape by moving knots and bezier vectors

How To ... Draw a Freehand Spline

Example of drawing a spline with the mouse in the ground plane.

How To ... Enhance the Morpher Modifier With Floating Controls

Example of dynamic UI creation, time and change callbacks usage to create a floater with controls linked interactively to a Morpher modifier.

How To ... Change Objects At Render Time

An example of changing object properties at render time using callback scripts.

How To ... Develop a Vertex Renderer

new.gif NEW: An example of a scripted vertex realtime renderer.

How To ... Script Particle Flow

How To ... Transfer ParticleFlow Particle Motion To Scene Objects

new.gif NEW: An example of moving scene objects using Particle Flow particles.

How To ... Affect Particle Flow Particles by Mass

new.gif NEW: An example of applying a Force to particles based on their mass.

How To ... Develop a Bitmap Painting Tool In Nine Easy Steps

How To ... Develop a Bitmap Painting Tool - Basic Utility

new.gif NEW: The first step of the tool creation - The basic tool with a single point brush without strokes support.

How To ... Develop a Bitmap Painting Tool - Strokes Support

new.gif NEW: The second iteration of the tool adds continuous stroke drawing.

How To ... Develop a Bitmap Painting Tool - Brush Size and Color

new.gif NEW: The third iteration of the tool adds control over the size and color of the brush.

How To ... Develop a Bitmap Painting Tool - Airbrush and Shapes

new.gif NEW: The fourth iteration of the tool adds circular brush shape support and an Airbrush option with variable strength.

How To ... Develop a Bitmap Painting Tool - Smooth Brushes

new.gif NEW: The fifth iteration of the tool adds a brush with smooth falloff

How To ... Develop a Bitmap Painting Tool - Load and Save

new.gif NEW: The sixth iteration of the tool adds bitmap file loading and saving. Finally, you can store your work of art to disk!

How To ... Develop a Bitmap Painting Tool - Erase Changes

new.gif NEW: The seventh iteration of the tool adds an eraser option to the right mouse button and a Commit Changes menu option to permanently bake the changes to the image.

How To ... Develop a Bitmap Painting Tool - Unwrap UV Coordinates

new.gif NEW: The eight iteration of the tool adds UV texture coordinates unwrapping and realtime updates of the bitmap as diffusemap on a selected object.

How To ... Develop a Bitmap Painting Tool - 3D Painting

new.gif NEW: The ninth iteration of the tool adds 3D Painting on a selected object in the viewport.

How To ... Develop a Selected Objects Inspector using ListView ActiveX Control

How To ... Develop a Selected Objects Inspector using ListView ActiveX Control - Part One

new.gif NEW: This tutorial will demonstrate how to set up an ActiveX Control in a MAXScript rollout to display details about selected scene objects

How To ... Develop a Selected Objects Inspector using ListView ActiveX Control - Part Two

new.gif NEW: This second tutorial will demonstrate how to customize the ListView ActiveX Control defined in Part One and update the display automatically when the selection set changes

How To ... Develop a Scene Browser using TreeView ActiveX Control

How To ... Develop a Scene Browser using TreeView ActiveX Control - Part One

new.gif NEW: This tutorial will demonstrate how to set up an ActiveX Control in a MAXScript rollout to display the hierarchy of the 3ds Max scene nodes.

How To ... Develop a Scene Browser using TreeView ActiveX Control - Part Two

new.gif NEW: The second tutorial will demonstrate how to customize the TreeView ActiveX Control defined in Part One by adding icons, colors and checkboxes to display and control the hidden state of scene nodes.