Want to script: a control object whose Pivot changes dynamically during manipulation based on rotation


#1

Long title for a simple idea. There may be dozens of ways to do this, some more efficient than others.
I’d like to script it and I’m assuming that I could leverage a custom attribute with some maxscript inside but, as Jon Mulaney once said, “I am often wrong”.

Put in simple terms, it’s the box rolling challenge but the box doesn’t need to ever tip over fully in any given direction. You would change the pivot based on which edge of the box you want to be the axis of rotation. One transform is the control (CTRL). Depending on if rotation is positive or negative in X or Y, the pivot changes to the position of a Point Helper in the scene (P1, P2, P3, P4).

I’d like to be able to key rotation on the CTRL node and also see it’s effects interactively in viewport.
What’s my best approach?


#2

In general, this task is called “Animated Pivot.” We have discussed this many times in this forum. Unfortunately, there is no solution through the MAXScript.


#3

Hm, ok. Gotcha. That’s too bad. Any suggestions, since Maxscript can’t do it?

I tested the potential with …
$CTRL.pivot = $Dynamic_PIVOT_nX_rig.pos

I was hoping that there would be a solution where the rotation of CTRL can be regularly evaluated and it’s pivot be changed, as above, when the range goes negative or positive.

I solved a similar problem once with reaction manager and hierarchically organizing multiple rig points.
Not the most elegant solution, but it seemed to work.
That gave me the interactivity that an animator would need when posing, but that was only range-mapping the rotation of A to rotation of B, C, D, etc.

Here, I have an additional need to also move the pivot based on which way the control object is turned. I’ll keep experimenting, but any ideas are gratefully appreciated.


#4

There is a CAT controller with an animated pivot point. I used it a few years ago to animate vehicle rigs being flipped.
I can’t remember the name and the docs are not being helpful.
It was a transform controller


#5

Expose Transform?