Python Animation COMP questions

Hi All,
I have a few questions regarding the Animation COMP as used through the Python API (animationCOMP class):

  1. Creating channels: Is there any Python API for this? I’m currently doing this by modifying the ‘channels’ and ‘keys’ DAT inside the Animation COMP. This does seem to work but since it isn’t documented, I’m not sure if this is an appropriate solution.

  2. Deleting channels: Again, through the Python API, I’m deleting the appropriate row in the ‘channels’ DAT and then deleting all rows in the ‘keys’ DAT with the correct channel ‘id’ (from the ‘channels’ DAT). Am I missing something or is this acceptable?

  3. Not Python related: I can’t figure out how to expose the curve editor for an Animation COMP in perform mode. I tried using the OP Viewer, but unless i’m mistaken, It doesn’t allow creating/delete keys. I’ve tried searching on the forum, but am probably not searching with the correct terms. All I really want is the ‘Channel Editor’ part of the Animation Editor in Perform mode. What are my options here?

Any help appreciated

1 Like

hey,

afaik there is no full-fledged API to add/edit/remove curves, so what you’re currently doing is probably the closest option to that. And those Table DATs is also the only place where info is stored about keyframes, so if you delete it there it’s good enough.

Also there is currently no Animation Editor COMP or something like that - but you can roll your own by copying the one used in the editor.
Open this path in you network editor: /ui/dialogs/
and see how much of TouchDesigner is just built in TouchDesigner :wink:
What you want is in the /ui/dialogs/keyframer/ COMP (enable it’s viewer flag to see it)

Another way of getting there is hovering the mouse over the Animation editor, and pressing F10 to get launched immediately into the relevant TouchDesigner network. This works also for a lot of other parts of the TD ui.

Thanks for your replies, very useful.

It would be useful to have helper functions to speed things up (to add/edit/delete curves). Not a huge issue though.

I managed to get the keyframer to do my bidding so all is well :slight_smile:

As I said to raganmd in another thread, the /ui/dialogs stuff is so useful! It clearly demonstrates that the possibilities are endless.

Thanks again