Notifications
Clear all

[Closed] Modifying keyframe values with maxscript

Hi there,
I have a problem with scaling animated objects in Max.
Th thing is that I need to scale down my scenes for export to a game engine, but some of the objects have animations applied.

The problem comes up obviously when I reset all transforms on the objects (these are hierarchies by the way) because at that point all transformation animation values are too big.
So what I want to do is:

  1. get the Transformation matrix from the object rescale that and use this matrix to rescale my animations. (Actually it is invTMx * scaleMtx * TM).

So far so good, but I can not change the keyframe values for the love of my life. Even when I try to set the values to 0,0,0 it does not work.
I try

at time t object.pos.controller.value = 0

for example.

If there is an easier way I would also be very happy.

Thank you very much.

Cheers,

Malte

2 Replies

I may be misunderstanding your question, but if your trying to set a key frame, or change an existing one on the position, you can do this.

with animate on ( at time 5 $.pos = [0,0,0] )

I don’t have a lot of experience with setting keys though.

Hey Philip999,

thanks for the answer. Ye, I found that out too.
with animate on did the trick.

It seems that MaxScript operates on a more higher level than I would like. I thought I could simply change the data of the keys, but I have to manually set Max to “set key” and change the current frame number. This is something I don’t like though. I have to investigate further. Perhaps the stuff I like to modify is on API level.

Thanks for your help.

Cheers,

Malte