I would like to get the selected channel in python. But I Don't find the right function to do it. or maybe it's the way I select the channel with the mouse in the graph editor ?
I tried based on this post but that don't work. I don't know why. Maybe the API have changed since then ? I'm using blender 3.4.1
Do you know how to do it ? Thanks !
import bpy
# Get the selected fcurves
selected_fcurves = bpy.context.selected_editable_fcurves
# Check if any fcurve is selected
if selected_fcurves:
# Print the name of each selected channel
for fcurve in selected_fcurves:
print("Selected Channel:", fcurve.data_path)
else:
print("No fcurves selected.")