Using Python, I would like to control what is displayed in the F-Curve Editor (in the Graph Editor window).

For example, say I want to display bpy.context.scene.gravity.

  1. How to display this property if it's already been keyframed?
  2. How to display it if it hasn't been keyframed?
  3. How can I undisplay any other F-curves? (e.g., say a keyframed object also happens to be selected)

From the wiki manual:

Header Tools

Show Selected Only

  • By default, the Graph Editor shows the channels for the active object only. Toggle this button off to show channels for all objects.

Show Hidden

  • Enable this to show channels from objects/bones that are hidden.

Show only matching F-Curves

  • Use this to only include F-Curves that contain the specified text.


  • Show options for whether channels related to certain types of data are included.

Graph Editor Filter

If you want to change these settings you should have a look at

If you are using an operator which will be called from the graph editor, the space data is available from

space = context.space_data
dopesheet = space.dopesheet


dopesheet.show_only_selected = True
#select the objects you want to show
obj.select = True

Another example:

#show only objects from the group named 'Group'
dopesheet.filter_group = bpy.data.groups['Group']
dopesheet.show_only_group_objects = True

#don't show object transformations and scene properties
dopesheet.show_transforms = False
dopesheet.show_scenes = False

Hide a fcurve:

#only accessible by index
fcurve = obj.animation_data.action.fcurves[0].hide = True
#fcurve's attributes data_path, array_index provide more information about it

or select it:

fcurve = obj.animation_data.action.fcurves[0].select = True

If the object has not been animated:

The minimum requirement to show up in the graph curve is existent animation data with an action assigned to it which possesses at least one fcurve.

So if the object has not been animated yet:

if not obj.animation_data:
    obj.animation_data.action = bpy.data.actions.new('myAction')
    #create an fcurve for the x coordinate
    obj.animation_data.action.fcurves.new("location, 0)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.