Notifications
Clear all

[Closed] delete a key set for a modifer value

I want to delete a key that is set on a push modifier and leave any other keys set at that frame alone.

For example to delete a key from “myobject”s push modifier at frame 10, I have tried:

deletekey $my_object.Push.push_value 10

This dosent work. Maybe deletekey isn’t what I need?
Anyone? Thanks!

5 Replies

hi josiah,

You just need to find max’s way to access the modifier’s controller.
The below script should do it.

– get key index at frame 10
keyIndex = getKeyIndex $plane01.push.pushValue.controller 10

– delete key at frame 10
deleteKey $plane01.push.pushValue.controller keyIndex

Thanks a million Brett, it works fine. I appreciate your time and expertise in helping me out!

One other question (if you find time), what if I want to delete only the key assingned to a morpher modifiers channel only?

keyIndex = getKeyIndex $plane01.morpher.controller 10
deleteKey $plane01.morpher.controller

dosent work because morpher uses ;

$plane01.morpher <channel> <value>

Do I set up a variable to hold the channel value somehow? Maybe it’s not possible to delete just one channel of this modifier on a given key?

Thanks very much.

Josiah,

I’m glad everything worked out. Once you get the hang of managing key arrays, you can pretty much do anything with the data.

To access a morph channel, just put the number within a bracket:

variable = getKetIndex object.morpher[morph channel].controller frameNumber
[size=2]keyIndex = getKeyIndex $sphere.morpher[10].controller 20

-bret

[/size]

Perfect!
I spent some time trying to figure this out.
Thanks Brett, I appreciate it immensely!

Your welcome! When I encountered that issue a few months ago, I remember it took me hours to stumble upon that syntax. I’ve learned that it always helps to look at the listener window.

-bret