System Information
Windows 7
Blender Version
Broken: 2.69 / current
Short description of error
FCurve.extrapolation = 'LINEAR' doesn't update the F-Curve, any graph-related operator will trigger a refresh however.
If automatic updates are too expansive, a FCurve.update() method could be used.
Exact steps for others to reproduce the error
Go to scripting view
Change 3D View to Graph editor
Paste and run this script:
import bpy obj = bpy.context.object obj.animation_data_create() obj.animation_data.action = bpy.data.actions.new(name="MyAction") fcu_z = obj.animation_data.action.fcurves.new(data_path="location", index=2) fcu_z.extrapolation='LINEAR' # <<<<<<<<< won't refresh f-curve! fcu_z.keyframe_points.add(2) fcu_z.keyframe_points[0].co = 10.0, 0.0 fcu_z.keyframe_points[1].co = 20.0, 1.0 # operator does update the f-curve... #bpy.context.area.type = 'GRAPH_EDITOR' #bpy.ops.graph.extrapolation_type(type='LINEAR') #bpy.context.area.type = 'TEXT_EDITOR'