Max scripting

This page shows some tools and scripts i’ve written for myself during last 2 years while learning MXS, mostly for learning and fun.

I’m trying to improve my scripting skills whenever i have time, and as 3d generalist i create these scripts for my needs. This is just a selection of tools i’ve written for myself.

I’ve also written some tools for production, but i’m not able to demo those yet.

I should also note, that ALL of these are personal projects!

BVH importer

What happens if you are using custom rig and not biped and you need to import BVH data into Max? I guess one is out of luck. I didn’t search for other solutions, since i decided to write BVH importer as practice.

I’ve used BVH importer to import custom BVH data into Max. This script can be used to import freeform BVH animation such as face marker data or bipedal characters with fingers and without fingers in Max.

It consists of BVH parser, skeleton maker and finally animation loader.

It can be used to import hierarchies without animation and with animation and it notes the framerate and adjusts scene settings accordingly, if user wants so.

It has options such as import scale, automatic layering and naming, color coding based on name tags.

It’s also possible to create non-hierarchical reference objects which mimic animation hierarchy transformations.

It still need a lot of work in my opinion but so far it has worked for my needs!

Joystick maker


If you are into experimenting with facial animation rigs like me (Need more time!) you probably have heard about on-screen “joysticks”.

Building joysticks each and everytime gets tedious and that’s why i wrote a joystick maker.

User can create “Standard Osipa joysticks”, with user defined color scheme.

I made this script have “command line” UI in addition to GUI so i can create whole panel at once with correct layout and names. Kinda nice?

Paint helper


Ever had to paint character weights with small screen space? Think that Max UI has a lot of scrolling involved? That’s why i wrote this script.

It contains the most important skin weight painting features and i can use it in expert mode. I experimented with callbacks and change handlers to make part of the buttons react to changes in modifier panel.

Skin envelope helper

Another skin related tool i wrote. It gives me possibility to use features like multi bone remove, picking bones from screen and selecting all member bones of skin modifier.

The last one is a real helper, i can tell!

Morph split to sides


This one is one of the many face and morpher related scripts i’ve written for myself. This script makes it super simple to create split sides of facial morphs.

Ever needed to create seamless left-right pairs? Not easy. I’ve seen hacks with channels and such. Not nice. With this script i can create split sides without hiccups.

I can adjust blend falloff visually and when “Create Targets” is pressed it spits out left and right side, aligned, named and color coded!

Shapes are created without Soft Selection or such so they fit perfectly to each other.

Secondary deformation tweak nodes


This is an experimental script. With this script it’s possible to automate creation of secondary tweak nodes into skin modifier. These tweak nodes “ride” skin, but don’t get double transformed, yet you can tweak your mesh on top of morph.

I haven’t had time to put it into production use, but here is a link to prototype:

Secondary deformation

P.S.
Phoelix, thanks!

UV Scaler


For good long time i was looking for a script which would help me with a phase of UV mapping i call “scaling”. Once UV pieces are done many times they might be proportionally correct but incorrect in scale to each other and without any relative scale to scene object. What a long sentence.

Well this script helps to solve previous issues. You only need to select one edge of UV island and off you go! Works for multiple islands at time.

One week or so after writing this, someone released a script quite similar to this. Argh! Jokes aside, this was a real learning experience of scripting Unwrap modifier and UV coordinate space!

GUN – Shooting script


My personal favourite a shooting script. You probably have heard about Rayfire and Impact? Well if not, then find out! This one is on the same tracks, yet probably not as sophisticated as previously mentioned tools.

This script creates a gun rig, shoots bullets, creates hits on the walls with debris and smoke and shells too, of course. And most importantly, it shoots automaticly. It can shoot randomly based on rate, or at selected frames.

It automaticly creates hit dents, mesh subdivision, debris, smoke and lighting effects. Everything can be tuned from an GUI which gives control over size, amount and style of debris and such.

I’m feel overwhelmed when it comes to particle scripting – a lot of work for late night project! Which is one reason i’ve kept this in the closet… Somebody borrow me some time!

Features:
Automatic gun rig creation
Automatic lock rig
Automatic muzzle flame rig

Bullets, debris, shells and smoke created with particle flow and scripts.
Raycast hit locations, no misfires like by using particle collision for collisions.
Shoot on selected frames
Shoot based on rate
Procedural textures created by script for bullets, smoke and hits

Automatic lighting effects
Automatic hit deformation
Automatic particle flow layout based on selected items

Moving targets
Multiple targets
Deforming targets (should be working too…)
Gravity
Floor collision

Some words

I hope it wasn’t too boring – Just kidding!

if you are interested in something similar or you have some questions or suggestions please drop me a line, i might be able to help you!