Writing Animation Switch Node Plugin

Hi everyone,

I’m looking to create a plugin anim switching node. That is, something that will take multiple anim curves as inputs and switch between them to provide a single anim curve as output. It would be quite similar to the built-in Choice node except that there is some extended functionality I want to add. This is all fairly straightforward except that I’d like the node to be as invisible to the user as possible. For example, when you key a node being controlled by one of these switches I’d like the key to be set on the currently active anim curve. I know this ought to be possible, because this is what happens with the Choice node by default. However, I cannot find any information anywhere and how this keying information is passed through a node.

As a bonus, I’d love it if the graph editor could display the incoming curve as though it were hooked up directly and not going through an intermediary node. This is how a pair blend displays its incoming anim curves so, again, it seems like it ought to be possible.

Does anyone know how either of these things are achieved? Documentation and examples of nodes that sit in the middle of animation like this are a little spotty.

Thanks