Copy an objects key-frame value through max script?

Copy an objects key-frame value through max script?

jeffpanek3d
Participant Participant
681 Views
4 Replies
Message 1 of 5

Copy an objects key-frame value through max script?

jeffpanek3d
Participant
Participant


I have a chain of helper objects parented together, with their own rotational values. And I'd like to  copy/paste a helper objects' key-frame value at one position in the timeline and paste to a new position. As an example to copy the key-frame for "Dummy1" at frame 5 and paste this at frame 20.

 

Ive spent several hours collating with ChatGpt, which yielded disastrous results.

0 Likes
Accepted solutions (2)
682 Views
4 Replies
Replies (4)
Message 2 of 5

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

There are many solutions, all of which can do something similar to what you need... but the right one is:

 

with animate on at time 20 
(
	$dummy1.rotation.controller.value = at time 5 $dummy1.rotation.controller.value  
)

 

The code above shows how to retrieve a value from a specific time and apply it to another time. However, if you are asking about key operations or how to organize the UI for it, that's a different story.

 

 

 

0 Likes
Message 3 of 5

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

@jeffpanek3d wrote:

 

Ive spent several hours collating with ChatGpt...


because it's not charging for the extra time yet 😉

0 Likes
Message 4 of 5

MartinBeh
Advisor
Advisor

"copy/paste" sounds like your are looking for an interactive function in the GUI? If so, you can do that with Shift-moving keys, either in Trackview or in the timeline.

 

If you want to do it via MAXScript, you need to look at the objects controllers, for example  $Sphere001.position.controller.keys is an array of keys. 

 

See https://help.autodesk.com/view/MAXDEV/2023/ENU/?guid=GUID-DB1E088D-DA4E-44BF-AE9A-B207653E96B8

and https://help.autodesk.com/view/MAXDEV/2023/ENU/?guid=GUID-76F76CB2-1026-447E-8DEE-23A57FB29C25 for info on keys (note that not all controllers have keys).

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
0 Likes
Message 5 of 5

jeffpanek3d
Participant
Participant

What i was looking for. 

Thanks!

0 Likes