Changing extrapolation type via RNA doesn't refresh F-Curve #38774

Closed
opened 2014-02-23 13:14:44 +01:00 by CodeManX · 9 comments
Member

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'
**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'
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @CodeManX

Added subscriber: @CodeManX
Joshua Leung self-assigned this 2014-02-24 03:51:17 +01:00

This issue was referenced by blender/blender-addons-contrib@6e7ce9770f

This issue was referenced by blender/blender-addons-contrib@6e7ce9770f7efd5b7a1189caae50c4efbfd933ca

This issue was referenced by blender/blender@6e7ce9770f

This issue was referenced by blender/blender@6e7ce9770f7efd5b7a1189caae50c4efbfd933ca

This issue was referenced by blender/blender-addons-contrib@3e26a7a594

This issue was referenced by blender/blender-addons-contrib@3e26a7a594a9f2d91cba48ba70d30e3ca38a5505

This issue was referenced by blender/blender@3e26a7a594

This issue was referenced by blender/blender@3e26a7a594a9f2d91cba48ba70d30e3ca38a5505
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

Closed by commit blender/blender@6e7ce9770f.

Closed by commit blender/blender@6e7ce9770f.
Member

Closed by commit blender/blender@3e26a7a594.

Closed by commit blender/blender@3e26a7a594.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#38774
No description provided.