'MaxScript get local transforms of object at different frames and do math

What I need is Maxscript code that will create a simple modifier. I need this modifier to display values that I can use in wiring, and maybe have a couple variables for input.

This modifier should return the difference in a local transform of an axis (x,y,z), in relationship to its parent, from current frame to an offset frame, where the offset amount should be an input variable.

So for example, if current frame is 20, and user variable input is x (integer), I want to return local object angle x,y,z at 20f minus x,y,z at 20f+x

I'm thinking the final number(s) should give me a value to use as a rough speed / acceleration value of the changing angle from parent object. To be used as a modifier to be dropped onto the object that is being transformed. Suggestions welcome.

I hope this makes sense.



Solution 1:[1]

I found a way to do this without maxscript. I found under create object 'helpers', there's an object called "Expose Transform" which provided the base value I needed, then, created an 'expression' on the field I needed it wired to, that I used to define a variable using the base value from the expose transform object, and also was able to use the same value, at an offset frame using the built in variable offset spinner - it allows for you to create a frame offset variable (as ticks - 1/100th of a frame), then I just subtracted the one variable from the other in the expression itself and used whatever math to get the final variable how I needed it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1