Notifications
Clear all

[Closed] how do i change tangents on selected keyframes?

hi, i am trying to create a script that will change the tangents on existing keyframes selected in the timeline.
i figured out how to do this on all the keyframes, but i need a command to switch the tangents on only the selected keyframes.
can anyone help me? yes, i am a noob at scripting but if someone could explain this it would be great as i cannot work out how to do it from the maxscript reference… thanks!

2 Replies

Can we see your code?

how about doing a check using isKeySelected?

if isKeySelected == true then (change tangent)

hi thanks alot for taking the time to reply!
i tried your advice with isKeySelected, but i cant make it work still…
heres my code :

rollout test “Test”
(
button btn_linear “linear”
on btn_linear pressed do
(
if isKeySelected == true then

             $.pos.controller.X_Position.controller.keys.inTangentType = #linear
             $.pos.controller.Y_Position.controller.keys.inTangentType = #linear
             $.pos.controller.Z_Position.controller.keys.inTangentType = #linear

             $.pos.controller.X_Rotation.controller.keys.outTangentType = #linear
             $.pos.controller.Y_Rotation.controller.keys.outTangentType = #linear
             $.pos.controller.Z_Rotation.controller.keys.outTangentType = #linear
        
             $.scale.controller.keys.inTangentType = #linear
             $.scale.controller.keys.outTangentType = #linear
   )

)
createDialog test