Films Training Blog
Pipeline and Tools Characters
Pipeline and Tools Characters
search Login Join
favorite

Development Fund

Support Blender Core Development with a monthly contribution.

theaters

Blender Studio

The creators who share. Access production content and knowledge from the Open Movies.

code

Blender Developer Blog

Latest news and updates on Blender development.

people

Get Involved

Join the community and help with design, development, docs and more.

bar_chart

Open Data

A platform to collect and display the Blender Benchmark results.

menu_book

Blender Docs

Documentation on Blender's features, tools and API.

Blender Conference

The yearly event that brings together the Blender community in one place.

download

Get Blender

Download the latest Blender version, or try the beta!

Films
Training
Blog
Pipeline and Tools
Characters
Search
Login
Join

Course

Scripting for Artists
feed Course Overview
feed Blender Versions
Videos keyboard_arrow_down
  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 keyboard_arrow_down
  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

Course

Scripting for Artists
feed Blender Versions
Videos keyboard_arrow_down
  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 keyboard_arrow_down
  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

You need to login to view this content

You can join Blender Studio for €11.50/month and get access to all of our training & film content instantly!

Login Join Blender Studio

Tech

Updating F-Curves

16th August 2017

info License: CC-BY
flag Report Problem

Published by

Sybren A. Stüvel

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

8 Comments

Join to comment publicly.

<deleted>

13th September 2020 - 10:37

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

delete Delete

Henk Kok

7th February 2021 - 15:03

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

Show more replies

Henk Kok

7th February 2021 - 16:09

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

Training ODW

30th August 2017 - 03:25

Very nice explanation! Thank you Dr.

Henk Kok

23rd March 2020 - 17:40

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

5th November 2018 - 22:15

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

santokio

9th August 2020 - 11:53

still waiting for tech9ne

Henk Kok

2nd January 2023 - 15:11

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!

Blender Studio

The Creators Who Share.

Facebook Logo Twitter Logo YouTube Logo
  • Films
  • Blog
  • Training
Pipeline and Tools
  • Cloud Rig
  • Blender Kitsu
  • Contact Sheet Add-on
  • Blender Purge
  • Blender Cloud Services
Characters
  • Einar
  • Security Bot
  • Huginn
  • Pack Bot
Studio
  • Terms & Conditions
  • Privacy Policy
  • Contact
  • Remixing Music
  • Blender.org
Loading...