# How can I find an specific F-Curve given an action name?

Given action name, a data path and an array index, how can I find the F-Curve associated to that action?

You need to use the fcurves.find(data_path, array_index) function. For example, we want to retrieve the F-Curve for the location’s Z channel, for an action named ActionName.

# Configuration
action_name = 'ActionName'
data_path = 'location'
array_index = 2

action = bpy.data.actions.get(action_name)
if not action:

• Use bpy.data.actions.get(name) else it will throw a KeyError – batFINGER Apr 1 '19 at 8:26
• @batFINGER, You mean that, if the key is not present, operator[] will throw a KeyError exception, while get() will return None? I updated my answer to reflect this. Thanks. – Dazotaro Apr 2 '19 at 23:17