Page MenuHome

Changing extrapolation type via RNA doesn't refresh F-Curve
Closed, ResolvedPublic

Description

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'

Event Timeline

codemanx created this task.Feb 23 2014, 1:14 PM
codemanx raised the priority of this task from to 90.
codemanx updated the task description. (Show Details)
codemanx edited a custom field.
codemanx added a subscriber: codemanx.
Joshua Leung (aligorith) lowered the priority of this task from 90 to 50.
Joshua Leung (aligorith) edited this Maniphest Task.
Joshua Leung (aligorith) changed the task status from Unknown Status to Resolved.Mar 7 2014, 2:17 PM

Closed by commit rB6e7ce9770f7e.

Joshua Leung (aligorith) edited this Maniphest Task.