How to offset all keys (without manually dragging keys) in Curve Editor?

How to offset all keys (without manually dragging keys) in Curve Editor?

worldpeace2040
Explorer Explorer
2,486 Views
5 Replies
Message 1 of 6

How to offset all keys (without manually dragging keys) in Curve Editor?

worldpeace2040
Explorer
Explorer

I would like to select all keys in the curve editor and offset them with a fixed value (without manually dragging keys)

Is there any way to do this? 

 

 

 

0 Likes
Accepted solutions (1)
2,487 Views
5 Replies
Replies (5)
Message 2 of 6

10DSpace
Advisor
Advisor
Accepted solution

@worldpeace2040 

 

A scripted solution to your request was posted by @Swordslayer here:

 

https://stackoverflow.com/questions/59278874/creating-a-maxscript-for-moving-keys

 

The actual script is shown below:

try destroyDialog ::MoveKeyTool catch()
rollout MoveKeyTool "Move Key"
(
    group "Settings"
    (
        spinner OffsetBySpn "Offset by" type:#integer range:[-1e3,1e3,10]
        button OffsetFramesBt "Offset Keyframes"        

        on OffsetFramesBt pressed do
        (
            local currentTV = trackViews.current
            if currentTV == undefined do return messageBox "Trackview window has to be open."
            local selCount = currentTV.numSelTracks()

            for i = 1 to selCount
                where (local ctrl = currentTV.getSelected i).keyable do
                    moveKeys ctrl OffsetBySpn.value #selection
        )
    )
)
createdialog MoveKeyTool

I can verify that it works on Max 2022.  

 

 

0 Likes
Message 3 of 6

domo.spaji
Advisor
Advisor

In the "key entry" type in n +/-/*... something

Works for time and values.

 

There are also "Retime (all)" tool, Edit ranges, ...

 

 

Why is dragging manual and typing... isn't?!

0 Likes
Message 4 of 6

worldpeace2040
Explorer
Explorer

 

Hey thank you for the script, I'll give it a try!

 

To answer your question, I have to edit 40 animations which all contains an undesired z offset. Manually dragging them might produce inconsistent results across these animations.

 

Thanks again for the reply!  

 

 

0 Likes
Message 5 of 6

domo.spaji
Advisor
Advisor

Script is for time/frames offsetting, you, however, dont need to do anything with keys, just offset your object/s without setting any keys and whole animation will be offset.

0 Likes
Message 6 of 6

worldpeace2040
Explorer
Explorer

 

Thank you for the additional tip.

 

I think I need to clarify that, what I wanted to do is to offset the z value of a particular bone (hip bone), the root bone location should remain unchanged.

 

In this particular case, I don't have the option to simply adjust the object's offset as that will alter the root bone location.

(I know I can adjust hip bone without affecting root bone with biped rig settings, sadly, the file I'm dealing with is a plain .fbx animation file without associated biped rig)

 

Frankly, I'm not sure adjusting keyframes via curve editor is the best (simplest) solution to solve this issue - if there are any other simpler ways to deal with my problem, I'm eager to give it a try. 

 

 

 

0 Likes