RSS FEED   

---Scripts:

Warning!!!
Use these scripts at your own risk. I have created and used them in several productions but I cannot be held responsible for any damage they may cause. Do not use the code in any of these scripts without giving PEN Productions or myself credit for their original creation. Please report any bugs in these scripts to Paul Neale at info@paulneale.com or on the PEN Productions Forum at http://paulneale.com/forum.

These scripts can only be used in production environments and NOT in any type of retail sales product including any form of training material. If you are unsure if you should be using these scripts please contact Paul Neale at info@paulneale.com about their usage.

Page updated: July 3, 2008 4:49 PM

Script package installer:

All scripts in a self installing .mzp package. Down load file and run Max. From the scripts drop down menu choose run and select the InstallM6.mzp file. All the scripts will be extracted and run. They can be found under any of the PEN categories.

Down Load:

Unavialable at this time.


Scripts: Description
ABC:
Attribute_Holder

Place this modifier in the stack and add custom attributes to it. Has allot of extra tools for saving poses and keying all attributes.

New Max 8 version available. This reflects changes in Max Script for Max 8 and above.

Active Trasnform Editor This tool is designed to support the Transform Type In tool. Allows for typing in the values of the active list controller or animation layer.
Auto Material

Allows for automatic addition of a default material. This can happen on creation of the object or the user can force the material on scene or a selection of objects.

Updated to V:1.41 Now supports material editor and material library.

Batch It Max New! Batch processing utility for Max 4x,5x,6x,7x,8x,9x
Control Objects Creates drag and drop spline control objects for use in character rigging.
DEF:
Find Modifier Finds modifiers in the scene by class.
GHI:
PEN Helper PEN Helper is a customizable helper object. Any Mesh or Poly object can be used as the helper objects mesh and can be saved for later use.
JKL:
   
MNO:
Math Functions
  1. Extract local rotation function.
  2. Hermite function.
  3. Clamp Range function.
"M" Group: Maya like grouping tools that uses point helpers for the groups.
Morph Helper Aids in working with morph targets.
Node Store: Adds Custom Attribute to scripted controllers for storing node to use with "this"
PQR:
PEN_Tools A collection of small utilities to aid in doing all kinds of things. Best to read each Macro script header in the file for an idea of what they all do.
Reset Xform NEW! Eases the task of finding and resetting the Xform on many objects. Lots of options.
Rigging_Utils Has allot of tools for dealing with list controllers as well as working with controllers and their dialogs.
STU:
Set Keyable Tracks Set tracks to be keyable by type in one button push. Great for locking out tracks before animation begins.
Set_out_of_range_Types Sets the out of range types for position/rotation/scale on all selected objects.
Skin Tools Various tools to be used with the Skin modifier. There was a bug in the update version posted previous to Aug 21 06, please down load and install again over writing existing files.
Three_Fing_Hand This is a modifier that was needed in Max 4 because Custom Attributes were not supported by the merge animation tools.
Turn Points On Off Sets all the display settings for points helpers to off and remembers their settings when they are turned on again. Used for cleaning up rigs so animators don't see all the extra nodes.
VWXYZ:
   

Version
Description

ABC:

Max 5x/6x/7x/8x

Script V:2.05
V:2.06

Stability: High

PEN_Attribute_Holder
This is a scripted modifier. Place this script in your scripts/startup directory and restart Max. This modifier can be added to any object and is designed to hold Custom Attributes. There are added tools for keying and resetting all the CA's as well as saving presets and copy/paste functions. You can also save the presets out to a text file to be loaded on other objects in the scene.

This is an update with a few added features. I have made the interface more compact by moving the preset management buttons to a RC menu that is located in the < button. There is also a slider now that ramps the preset values up so that mid points to the presets can be used. This is great for having a preset for a fist but using it to get a relaxed position half way.



Installation:
Copy the .ms file to the scripts\startup folder and restart Max. The modifier is found in the modifier list.

Tips:
($.modifiers[1].rollouts())[1]
Assuming that PEN_attributeHolder is the first modifier in the stack this will return the Presets rollout. You can use createDialog to open it as a floating window. PEN_AttributeHolder can't be displayed in the modifier stack at the same time because the rollout can't be created twice.

Name: Name of a new preset to be created.
Add: Set the spinners and sliders to the value you want to create a preset for, type a name in the Name field and then press Add. A new preset will show up in the presets list.
Delete Selected Preset: Select the preset from the Presets list and press Delete.
Delete All Presets: Deletes all the presets for the modifier.
Save: Saves all the presets to a text file.
Load: Loads presets from a text file over writing the originals. Note: This works based on the order of the CA's on the modifier and not by their names.
Merge: Merges presets from a text file with existing presets. Note: It is possible to create duplicate names with different settings.
Presets: This is a list of all presets and when one is chosen from the list all the attributes will be updated to the preset value.

Ramp: This is a new feature in v2.05, it allows for the values of the presets to be ramped up and used at any point. The green button is a toggle for this feature incase you want to have it work in an absolute fashion. Select a preset and ramp the slider from 0 to 100 to get a gradual result for the preset.

Key All: Keys all attributes added to the modifier.
Reset All: Resets all attributes on the modifier to a value of 0.
Copy: Copies the existing values of the CA's to the buffer.
Paste: Pastes the buffer back to the CA's. This is great for copying and pasting a pose from one hand to another.

Down Load File: PEN_Attribute_holder_2.05.zip < Max 4x, 5x, 6x, 7x
Down Load File: PEN_Attribute_holder_2.06.zip < Max 8x

Max 7x/8x

Script V:1.41

Stability: High

PEN Auto Material:

Auto Material is designed to aid in adding a base material to objects by selection, scene or automatically on creation. Several game clients have complained that their exporters will not work if there are not maps on every object in the scene and would like a solution to adding material as the objects are created.

Installation: This script comes with a self installer. Down load PEN_autoMaterial.mzp and drag and drop it into a Max view port. Open the Customize User Interface dialog and the macro scripts can be found in the category PEN Materials. Add the macros to your favorite quad, menu or button bar.

Settings Menu: Option for resetting the whole UI to the default settings.

Wire Colour Group: Set the wire colour of the object or apply only the wire colour.

Use Material Definition Group: Choose if the material will be defined in the material editor, material library or the Auto Material UI.

Naming Group: Add a custom prefix to all materials with the ability to use the objects name as the root.

Material Editor Group: Choose to use the material from the selected slot in the material editor or a specific slot.

Material Library Group: Load the desired material library and choose the material to be used from it.

Basic Parameters: Setup the diffuse, specular and glossiness of the material.

Maps Group: Apply default maps to the material for diffuse, specular and bump. The maps can be turned on in the view port by default if needed.

Options Group:
Auto Apply:
When on materials will automatically be applied to objects on creation.
Replace Existing: Will allow for replacing existing material with the default material when the scene or selection method is used for applying the materials.
Instance Material: Will apply one instanced material to all objects.
Add Maps to Existing: Use this if you want to add the default texture maps to existing standard materials.

Apply Group: Apply materials to the scene or a selection of objects manually.

Down Load File: PEN_autoMaterial.mzp

Max
6x/7x/8x

Script V:1.0

Stability: High

Control Objects:

Creates custom spline control objects for rigging characters and other objects. Add the macros to your favorite quad or button bar and drag and drop these controls to place and size them. Due to limitations in creating scripted shape plugins these objects don't have any parameters to size them after creation. Use XForm modifier to size after creation.

Installation: Copy the .ms file to your 3dsMaxX\stdPlugs\stdScripts folder and the .mcr to the 3dsMaxX\ui\macroscripts folder and restart Max. You will find them in PEN_ControlObjects category.

Down Load File: PEN_ControlObjects.zip


DEF:

Max 4x/5x/6x/
7x/8x

Script V:1.0

Stability: High

PEN_findmodifier

Finds modifiers in your scene based on class name of modifiers. It has some defaults added to a drop down list but you can type in your own.
However, first you need to know the class name of the modifier that you are looking for.

This was a quick hack but it works.

Macro script category:PEN_Tools

Down Load File: PEN_findmodifier.zip


MNO:

Max
6x/7x/8x

Version:
V:0.01

Stability:
High

Math Functions:

This is a set of Max Script functions that are to be loaded and globally and then called from other scripts or script controllers. Read the notes in the file for further help on usage for the scripts and what they do.

List of included scripts and how to access them via max script:

Local Rotation:
--Returns the local eulerAngle value for any object passed to it based on any other objects in the scene.
penMath.localRot()

Hermite Function:
-Returns a value from 0 to 1 based on a bezier curve that defaults to an ease out ease in. The curve can be adjusted with two inputs.
penMath.hermite()

Clamp Range:
-Converts any range to any other range and returns a float value. Pass the function an input value and the ranges that you want to convert from and to and the corresponding value will be returned. This will also invert ranges and values. Many possible uses.
penMath.clampRange()

Installation:
Unzip file and copy it to "3dsMaxX\stdPlugs\stdScripts" and restart Max.

Down Load File: PEN_MathFns.zip

Max 4x/5x/6x
7x/8x

Script V:0.01

Stability: High

"M" Group
This tool is used to create groups like in Maya and uses point helpers for the group nodes. There are also four Macro Scripts that come with "M" Group so the dialog doesn't need to be opened every time. All options are sticky from session to session of Max and are saved to an Ini file that is stored in the 3DSMax/CFGPlugs as mGroup.ini.

Thanks go to Jon Lanz from Blizzard for the GetSelectedRoots function.

Align To:
Local:
Aligns new point helpers to the selected objects pivot.
Parent: Aligns new point helpers to the parent objects pivot for the selected object.
World: Aligns new point helpers to the world center.
Selection Center: Aligns new point helpers to the center of all selected objects.

Affects:
Group Each Object: Creates a point helper for each object that is selected.
Group All Objects: Creates a single point helper for all the objects that are selected. If Local is selected in the Align To options the local pivot of the most parent object will be used. If there are multiple most parent objects the pivot will be set to Selection Center instead.

Creation Display:
Hide Group Point Helpers: On creation of a new point helper the display properties of the point will be turned off but the point will not be hidden.
Show Group Point Helpers: On creation of new point helpers the points will be displayed.

Post Display:
Selected Only: Only affect currently selected point helpers.
Point Size: Sets the size of the point helpers when they are displayed.
On: Turns on display of point helpers, as well as unhides the point helpers if hidden in the Max interface. There is a macro provided for the same function.
Off: Turns off the display of point helpers. There is a macro provided for the same function.

Group:
Group: Groups the selected objects using point helpers as the node. This retains the hierarchy of the objects unless the Group All Objects option is selected where all objects are linked to the single group helper that is created. There is a macro provided for the same function.
Ungroup: Deletes any selected point helpers and retains the hierarchy of the objects. There is a macro provided for the same function.

Tip:
Use mGroup.help() in the listener for a break down of some of the functions that might be useful to call from other scripts, there are many others that make up mGroup.ms but are not useful by them selves for the most part.

Installation:
There are two scripts that ship with this tool. mGroupMacros.mcr is the macro scripts and should be placed in 3DSMax/UI/Macroscripts folder. mGroup.ms is the struct that contains all the functions to run "M" Group and should be placed in 3DSMax/Scripts/Startup.
Restart Max and add the Macros to your favorite hot key or quad menu. They are found under the "M" Group category.

Down Load File: PEN_mGroup.zip

Max 4x/5x/6x
7x/8x

Script V:1.0

Stability: Low

Will not cause any problems but it has little error checking.

Morph_Helper

This tool is currently getting a rewrite and will include mirror morph target abilities.

Makes life easier when creating morph targets. Add this script to the macroscripts folder and then add the macro to your favorite quad menu. This script will allow you to adjust the values of a morph target without having to go to the Morpher modifier in the modify panel. You can turn on and off Automatically Reload Targets as well as MeshSmooth.

Note: This is stable but has very little error checking in it. Names of the targets might get clipped because it was written for Max 4. The object with Morpher on it must also have Meshsmooth on it.

Down Load File: PEN_Morph_Helper.zip

Max
6x/7x/8x

Script V:0.2

Stability: Med/High

Node Store: No longer needed in Max 8

In Max6 "this" has been added to the script controllers making it possible to reference the script controller itself. This means you can now use a Custom Attribute added to the script controller and store the nodes that the script will be accessing. Why you ask? Well up to now script controllers have had two major flaws. Speed, and a dependency on the names of the objects that are referenced in them. Both problems were taken care of at the same time with the addition of "this" The following script aids on working with CA's on scripted controllers and makes it painless to set up.

Select any track and change it to a script controller. In the case shown it is the position controller that is being used.

Make sure that the controller track is selected and trackview is left open.

Run the Macro Script "Open Node Store" and this dialog will open. It will also open the script controller if the window is not already displayed.

Node Handle: This is where you enter a unique name that will reference the node that you are going to store.
Add Node: Once a node handle name is typed in push this button then click on the node that you want to store.
Delete Node: This will delete the selected node in the Node List.
Node List: List of all the currently stored nodes. Displayed is the index of the node in the array, the unique node handle and then the nodes name in Max.
Copy: Will copy all the nodes and the script depending on the checkboxes below.
Paste:
Will paste the copied nodes and the script depending on the checkboxes below.

 

The script can be written in to different ways. The first uses the node handle, the second references the node directly.

First Method:
this.ns.node #Con1

"this" refers to the script controller.
"ns"
refers to the custom attribute that stores the nodes.
"node"
calls the function that will search for the correct node handle.
"#Con1" in this case is the given node handle
This method is the slowest between the two since the node handle needs to be searched for. The more nodes in the list the slower the search might be. I have tested the speed with up to 10 node handles and have not seen a slow down that would stop me from using this method. The search has been optimized as best as possible to keep it fast.
This method has the advantage that if the node list is changed it will not break the script, unless the node that is deleted is referenced in the script of course.

Second Method:
this.ns.nodes[1]
"this"
refers to the script controller.
"ns"
refers to the custom attribute that stores the nodes.
"nodes[1]"
references the array that the nodes are stored in their order added and displayed in the node list. In this case the 1st node is being referenced.
This method is the fastest since the node handle doesn't need to be searched for but has the problem that if the node lists order changes the script will not be valid and an error will be thrown. The order will change if a node is delete from the list higher up forcing the array to renumber the remaining entries.

Installation:
Open the zip file and copy PEN_nodeStore.ms to the scripts\startup folder and PEN_nodeStore.mcr to the ui\macroScripts folder and restart Max. Max6 or higher must be used for this script.

Tips:
nodeStore.ms is a struct and the functions can be accessed and added to you own code.
nS=nodeStore(): Create an instance of the struct.
nS.run(): Runs nodeStore and adds it to a selected track that is a script controller.
nS.openCaDialog(): Opens the nodeStore dialog box and script. The track must be selected in trackview.
<controller>.ns.node: Access to the node handle function. This takes one argument which is the node handle to be accessed <#Con1>.
<controller>.ns.nodes: Access to the array that stores the nodes. The length of this array must be kept the same length of the names array.
<controller>.ns.names: Access to the array of node handles as strings. The length of the names array must remain the same length as the nodes array.

Down Load File: PEN_nodeStore.zip


PQR:

Max 4x/5x/6x/
7x/8x

Script V:1.0

Stability: Varied

PEN_Tools
This is a very large set of Macro scripts that I add to quad menus to enhance hot key sets. There are many kinds of tools in here and I am not even going to begin describing them all. There are a couple that still show up that are unfinished or just don't work well so be warned. I have never had any problems caused by them so don't be too worried but read the warning above.

Macro script categories: PEN_Tools, PEN_Modeling, PEN_layout, PEN_Animation.

Down Load File: PEN_Tools.zip

Max
5x/6x/7x/8x

Script V:4.01

Stability: Reasonable!

PEN_Rigging_Utils
This is an updated version of the PEN_Character_Setup script. Some of it is still not finished but there are significant changes to the Controllers area that I think will be very useful to every one.

Consider this tool a constant work in progress. None of it is completely bug free but is all works and is one of the tools that I use the most while dealing with character rigs and setup.

This will be the main interface when it launches. Not sure I like the tabs so I might change them one day when I have time...time, ha, that's funny.

Controllers section. This has allot of tools for me to list here. It takes a bit of getting used to but it does allot. I need to update the controller choices one of these days as it only lists a couple of things that I needed at the time that I created it.

List Controllers Names: List of all the controllers in the lists on the selected objects.
Remove List Controllers: Sets the controllers back to the default.
Zero Out Objects: Adds a list controller to all the selected objects and adds a second controller to the list. Sets the second controller to be active and names the first one Zero and the second one Animation.
Add Controllers: Add/Replace/Rename controllers in a list by the index of the list or just adding to the available track.Add a name to the name field to name controllers on creation.
Set/Del Controllers: Set controllers to be active by either name or index, you can select the controller you want with the List Controllers Names drop down list at the top.
Set first will set the first controller active and Set Top will set the last controller active.
Resets: This will make the value of the currently active controller [0,0,0]

Note: Using Zero Out Objects with a list controller already set up on the object will make the value of the second controller [0,0,0] and add any value that was in the second controller to the first. This means that the object wouldn't move.

Edit controllers is a life saver. It will find and display any controllers that have a dialog box that can be opened. You have all kinds of filtering ability. Just select the object that is displayed in the first window and it will show you all the controllers in the second. Double click on the controller to open the dialog.

Show info never got refined so don't trust it and I know that Link Constraints don't show up either thanks to Alan Noon. There might be a problem with controllers on some IK solved bones but that may have been fixed at some point. Test and let me know please.


Edit Attributes:
For every one that is tired of using the current custom attributes tool in Max here is a solution that has complete control. You will have to write the CA in max script by hand but that means that you can do any thing that you could do with a scripted modifier but have it contained in the file.

Note: Materials are not supported. I started a complete rewrite but have not been able to get back to it but it will support all possible places you could put a CA.

Current Attribute Definitions: Shows all the current attributes on the selected objects for modifiers and base objects. Double click on the CA and it will open it in a script window. This file is automatically saved to a temp file when the CA is found and deleted why another object is selected.
Open Definition: Opens the currently selected CA in the list.
Redefine Definition: Edit the opened script and save over the temp file and press redefine will update the CA with the new code. If there is an error in the code the script might die. It needs a bit more error checking in places.
Make Unique: Makes the CA unique to others of the same name.
Delete Definition: Deletes definition with the whole rollout.

Loaded Attribute Definitions: Contains a list of CA definitions that have been loaded from session to session of Max. You can save your favorite definition and load it and it will always be there for you.
Load Definition: Loads a new saved definition and stores if for the next session of Max.
Remove from List: Removes selected CA's from Load list.
Open Definition: Opens the CA to a Max script window for editing.
Add New Definition: Add the selected CA in the load to the selected object. The CA is added to the currently selected level in the modifier stack.
Redefine Definition: Redefine the definition that is selected in the Current Attribute list with the one that is selected in the Loaded Attribute list. Be careful not to over write a completely different attribute as it allows for this.
Download Example Custom Attribute Definitions: CAs.zip


Just makes it easier to work with setting the Link and Inherit info. Doesn't need much explaining and saves allot of button clicks.

Works on all selected objects.


A bunchOstuff that I need to do all the time. Nothing ground breaking but useful.

Select Bones: Selects all the bones in the scene.
Fix Nub Bones: Sets the length width and height of end bones to match the width of the parent bone.
IK Enable/Disable: Turns IK on and off of all selected IK solvers.
Make Point Helpers: Makes a point helper aligned to each selected object.
Spline On: Sets the view port render to on with the diameter of the spinner.
Colour Objects Left Right: Colours the objects green and red for starboard and port or for you non sea fairing types, right and left. Different values of the colours are used for different object classes.
Skin On/Off: Turns the always deform check button on and off for ALL the skin modifiers in the scene. don't use this if the scene has been animated!
Goal Size: Sets the size of the goal end of selected IK solvers.
Point Size: Sets the size of selected point helpers.
Bone Length: Sets the length of all selected bones as a relative value.
Select CNT Objects: Selects all objects with "CNT" in thier name in the scene. This is how I identify control objects.
Open/Close Groups: Opens/Closes all groups in the scene.
Select Mirror Object: Selects the object that has the selected axis value mirrored. An example would be the right and left forarm.

Installation:
Place PEN_Rigging_Utils_4-01.mcr in the UI\macroScripts folder.
Place all the .ms files in the stdPlugins\stdScripts folder.
Add PEN Rigging Utils to your favorite menu from the PEN Tools category.

Down Load File: PEN_Rigging_Utils_4-01.zip


STU:

Max 5.1/6x/7x
8x

Script V:0.1

Stability: High

Set Keyable Tracks

There was a new addition to Max 5 that allows controller tracks to be set as Keyable or not. This script makes the task of setting the tracks keyable or not much faster as it will set it based on track type. I hope to have an update to this so that list controllers can be dealt with better.

Down Load File: PEN_SetKeyableTracks.zip

Max 4x/5x/6x
7x/8x

Script V:1.0

Stability: High

PEN Animation-Set_out_of_range_Types

This script sets pos/rot/scale range types on all selected objects. I wrote this by request for someone on the Max web board.

Macro script category:PEN_Tools

Down Load File: PEN Animation-Set_out_of_range_Types.zip

Max
6x/7x/8x

Script V:1.0

Stability: High

Skin Tools: Various tools for use with the Skin modifier.

I have changed the category that these tools are found in. They now have their own category called "PEN Skin"

Most tools when used in a quad menu will now display a check box to show that the tool is active.

Skin Paint Mode On/Off:
This is a Macro Script found in the PEN Tools category for turning the Paint Weights tool on and off.

Skin Paint Blend Mode On/Off:
There is a hidden feature in Skin that is a blend or a blur paint mode that allows for the weights of verts to the blended. This makes it easier to soften areas or correct uneven weighting.

Set Paint Weight to 0.02/0.05/0.1/0.5/1.0:
These are five macros that set the paint value to one of the presets. A check box is displayed if the weight is set at that value. There are also six other presets that come with Max and can be found in the Skin Modifier category.

Update Painter on Mouse Up:
Toggles the paint mode to update only when the paint is finished. This is great when working with very large meshes that make the paint mode slow.

Pressure Sensitive:
Turns the pressure sensitive setting on and off in the paint tool for use with Wacom tablets.

Affects Strength/Affects Size/Affects Size and Strength:
Sets what the pressure sensitivity affects when painting.

ABS Effect:
Opens a floating window for setting the ABS Effect value of a vertex. This tool was hacked together and doesn't have many features.

Select Affects Vertices:
Selects the vertices affected of the selected bone.

Mirror Bones Blue to Green/Mirror Bones Green to Blue:
Mirrors all bones from one side to the other.

Mirror Verts Blue to Green/Mirror Verts Green to Blue:
Mirrors vertices from one side to the other.

Mirror Selected Verts:
Mirrors selected vertices.

Installation:
Unzip and place the PEN_SkinTools.ms file in the STRplugins\STRscripts folder and PEN_SkinTools.mcr in the UI\MacroScripts folder and restart Max. All scripts will be found in the PEN Skin category in the Customize/Customize User Interface dialog. Add the tools in your favorite quad menu or set hot keys for them.

Down Load File: PENSkinTools.zip

Max
4x/5x

Script V:1.0

Stability: High

Three_Fing_Hand

This is a scripted modifier. To use this script, place it in your scripts/startupscripts folder and restart Max. A new modifier will be available called Three_Fing_Hand. Add this modifier to your hand control object and wire your fingers to the sliders in the modifier. In the setup rollout of the modifier you can set your own high and low values for the sliders as well as save off presets for the sliders that can be used to make animating faster by being able to get back to commonly used hand positions.

This is only needed for Max4 users because the CA's don't work with the merge animation tool. Use a combination of CA with the PEN Attribute Holder script and you can do any interface that you like with more control and options.

Down Load File: Three_Fing_Hand.zip

Max
6x/7x/8x

Script V:1.0

Stability: High

Turn Points On Off

Turns selected point helper display properties off and on. It will remember what the settings were when they are turned off so that only those are turned back on again. This script is great for cleaning up the view port of unwanted objects for animation and simplifying the look of the rigs. It stores the data in setAppData channel 590964.

Installation: Copy .mcr file to your 3dsMaxX\ui\macroScripts folder. The macro can be found under the PEN Tools category, just add it to your favorite quad or button bar.

Down Load File: PEN_turnPointsOnOff.zip