I'm writing a script for Blender that needs to be run from the terminal. I would like to change the interpolation type of f-curves in my script. When using Blender's normal UI, the sequence of commands for what I want to accomplish is:
bpy.context.area.ui_type = 'FCURVES'
bpy.ops.graph.select_all(action='SELECT')
bpy.ops.graph.interpolation_type(type='BACK')
This works great when I run the code within Blender, however when I try to execute this from the terminal, I receive the following error:
bpy.context.area.ui_type = 'FCURVES'
AttributeError: 'NoneType' object has no attribute 'ui_type'
This is understandable, because in headless mode, apparently there is no area or UI. How can I achieve the same results in headless mode?
Thanks!