Scripting for the 3ds Max CAT system is not a simple task. It has some documentation, but its very basic and it’s missing good examples.
So you have to fiddle around, google, test and trial by error. (Most often times the max error messages are also not really helpful)
I am experimenting and learning more about Max Script every day.
Let’s see if I can produce some valuable content and give something back to the community!
My script idea:
I knew since longtime, that the CAT system has the ability to setup procedural stuff via controllers in the SETUP mode.
(Check this out: Hierarchy Panel for CAT Rig -> scroll down to „Animation Controller“.)
So if you add animation layers later, the base setup still works and you can insert stuff like constraints, funky controllers, etc. which the animation layer works on top.
I am in general lazy and want things to work from bottom up. Yet, I still want this fine subtle details in my hand animations, without actually animating it.
The idea here is pretty simple: Use Noise Controllers on each finger for random movements and control their parameters via attributes on the wrist gizmo.
So I used scripting and rigging BEFORE I’m going to animate the hand and setup some cool controlable noise controllers with parameter controls.
Basically what the script does:
- Creates an attribute holder modifier and adds all parameters at once
- Sets all finger bones to use Animation Controllers in Setup Mode (since through the Max Hierarchy Tab, you can’t do it at once)
- Also sets all fingers to „Additive to Layer Mode“, so the animation values in an animation layer start at zero. On top of the noise values in the setup layer.
- Then the timeconsuming part: Connecting all finger noise controllers to the global noise and finger noise attributes in the wrist gizmo.
- I used expression controllers for each fingers noise strength to read the global and individual parameters
- The noise frequency is tricky, since it is not exposed as a controller track. I had to use a temporal attribute which has a script controller assigned, which sets the noise frequency in all finger noise controllers indirectly. Benefit, I can also animate the global noise frequency and all fingers follow along.
Here is a GIF of what my script does:
Please comment, if you like to know some specifics.
I will also try to add some code snippets for easy reuse and further explanation later.