I'm trying to set an FCurve in the Graph Editor to "Active" through python.

In the API FCurves don't actually have an "Active" property, but manually click-selecting a channel or keyframe on an FCurve will bring up this in the Graph's UI:

enter image description here

You can see that the curve gets a very bright highlight and the UI panel on the right now shows that the curve is Active.

FCurve's do have a "select" property that when set to True through script will select the curve. But just setting the select property to True doesn't produce the same result. It only selects the curve but doesn't consider it active, like this:

enter image description here

Even though the curve/channel is selected you can see the curve's highlight is not nearly as bold now, and the UI panel on the right shows no active curve at all.

So I started digging through the source code and found that there's an FCURVE_ACTIVE flag that does in fact get set, but I can't figure out how to do anything through script that would trigger anything that might set that flag.

Here's a link to an ANIM_set_active_channel function in anim_channels_edit.c from the source code:


You can see down on line 111 the FCURVE_ACTIVE flag is set.

This function is called in a number of different places:

  • action_select.c
  • nla_channels.c
  • nla_select.c
  • graph_select.c
  • ED_anim_api.h

Does anyone know how this works? What is Blender doing once it reads the flag to brightly highlight the curve and make it show up in the right UI panel? Can this be reproduced through script without having to manually click-select on either a keyframe or an action channel?

Thanks for any ideas.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.