Blender Studio
  • Films
  • Projects
  • Training
  • Characters
  • Tools
  • Blog
  • Join
  • BLENDER.ORG

    • Download

      Get the latest Blender, older versions, or experimental builds.

    • What's New

      Stay up-to-date with the new features in the latest Blender releases.

    LEARNING & RESOURCES

    • Blender Studio

      Access production assets and knowledge from the open movies.

    • Manual

      Documentation on the usage and features in Blender.

    DEVELOPMENT

    • Developers Blog

      Latest development updates, by Blender developers.

    • Documentation

      Guidelines, release notes and development docs.

    • Benchmark

      A platform to collect and share results of the Blender Benchmark.

    • Blender Conference

      The yearly event that brings the community together.

    DONATE

    • Development Fund

      Support core development with a monthly contribution.

    • One-time Donations

      Perform a single donation with more payment options available.

Training Highlights
Stylized Rendering with Brushstrokes
Geometry Nodes from Scratch
Procedural Shading Fundamentals
Stylized Character Workflow

Training types
Course Documentation Production Lesson Workshop

Training categories
Animation Geometry Nodes Lighting Rendering Rigging Shading
Film Highlights
Wing It!
2023
Charge
2022
Sprite Fright
2021
Spring
2019
Project Highlights
Project DogWalk
Interactive
Gold
Showcase
BCON24 Identity
Showcase
Fighting with Grease Pencil
Article
Course
Scripting for Artists
Blender Versions
Videos
  1. 01

    Introduction & copy-pasting

    Free
  2. 02

    Names & Objects

  3. 03

    Stuff on Lists

  4. 04

    Data Types

  5. 05

    Collections: Mass-Rename of Objects

  6. 06

    Blender Collections

    Free
  7. 07

    For vs. While

    Free
  8. 08

    Your Own Operator

    Free
  9. 09

    From Script to Add-on

    Free
  10. 10

    User Interfaces

    Free
  11. 11

    Custom Properties

    Free
  12. 12

    Asset Linking

    Free
  13. 13

    Roast my Add-on

    Free
  14. 14

    The Roast of Nature Clicker

    Free
  15. 15

    Modal Operators

    Free
  16. 16

    Readability & Understandability

Tech
  1. 01

    Updating F-Curves

  2. 02

    Render 10,000 OBJ files

  3. 03

    Mass-Rename Bones & Vertex Groups

  4. 04

    Rendering from 'all' angles

Login to view this content

Join Blender Studio for just €11.50/month and get instant access to all of our training and film assets!

Login Join Blender Studio
Sybren Stüvel
Sybren Stüvel Author
License CC-BY
Report Problem
Tech

Updating F-Curves

This is the first video in a series of "tech videos" in which Sybren discusses concrete problems seen on Stack Exchange. This video is all about modifying animation data from Python scripts.

  • Use ctrl+space to find actions and F-curves
  • Evaluate F-curves for a frame without going to that frame
  • Adjust existing keyframes
  • Calling fcurve.update() after making changes

Links from the video

  • The question on Stack Exchange
  • API documentation for Action and FCurve

The Slides

Slides are only visible to Blender Cloud susbcribers

Join to leave a comment.

8 comments
Henk Kok
Henk Kok
Jan. 2nd, 2023

For the record, from time to time I return to pick a few things again from this. Today I remembered that curves could be evaluated so I went back and behold, its there. Great and helpful tutorial, thank you!

<deleted>
<deleted>
Sept. 13th, 2020

for lazy ones as me:

import bpy
reset_to = 1.0
for object in bpy.context.selected_objects:
    # in case the object is not animated, we should also change its y-coordinate
    object.location.y = reset_to
    if not object.animation_data or not object.animation_data.action:
        # no action so nothing to do
        continue
    action = object.animation_data.action
    fcurve = action.fcurves.find('location', index=1)
    if not fcurve:
         # y location not animated so nothing left do
         continue
    for keypoint in fcurve.keyframe_points:
        keypoint.co.y = reset_to
    fcurve.update()

Sybren very nice video,

I am missing only how to insert a new keyframe at say time 60 in the timeline ...

As the title says: existing ke;yframes , so my wish is something new ;-)

oh oh the triple ` does not as im MD.

Possible here? If so, please tell me Greets Peter

Edit
Delete
Henk Kok
Henk Kok
Feb. 7th, 2021

@Peter K.H. Gragert ah yes, lazy indeed, thanks :-)

Show more replies
Henk Kok
Henk Kok
Feb. 7th, 2021

@Peter K.H. Gragert From what I found,  keypoint.co.x  represents the frame number

santokio
santokio
Aug. 9th, 2020

still waiting for tech9ne

Henk Kok
Henk Kok
March 23rd, 2020

Thank you once again Sybren, this wasn't easy to figure out alone but with this tutorial a n entire array of possilibities is opened up to me.

Julian Darley
Julian Darley
Nov. 5th, 2018

is there a blend file containing the suzanne animation that is being corrected here?

Training ODW
Training ODW
Aug. 30th, 2017

Very nice explanation! Thank you Dr.

Films Projects Training Blog Blender Studio for Teams
Pipeline and Tools
  • CloudRig
  • Blender Kitsu
  • Brushstroke Tools Add-on
  • Blender Studio Extensions
Characters
  • Mikassa
  • Whale
  • Ballan Wrasse
  • Snow
Studio
  • Terms & Conditions
  • Privacy Policy
  • Contact
  • Remixing Music
Blender Studio

The creators who share.

Artistic freedom starts with Blender The Free and Open Source 3D Creation Suite