Page MenuHome

FCurve update method for scripts
Closed, ResolvedPublicPATCH

Description

This small patch exposes Blender's internal FCurve update functions (specifically sort_time_fcurve and testhandles_fcurve) to Python scripts through a new "update" method on bpy.Types.FCurve.

Triggering the update functions previously required running a curve operator of some sort, all of which check the context for UI state. Setting up and then reverting the UI state was a pain when Blender was running with UI and impossible when it was running in background mode.

This patch mainly helps import scripts.

Event Timeline

Joshua Leung (aligorith) changed the task status from Unknown Status to Resolved.Mar 22 2014, 3:55 AM
Joshua Leung (aligorith) claimed this task.

I ended up reimplementing a similar feature in 3e26a7a594a9f2d91cba48ba70d30e3ca38a5505 to fix a bug.

In the end, I found that there were a few issues with this patch so I couldn't use it as-is (i.e. RNA api for FCurves already exists - it lives at the end of the struct def for FCurves, and the naming of the new API function was inconsistent with the rest of the code). Nevertheless, I ended up crediting this patch in the commit (though I had a bit of trouble trying to find it again at the time).

Thanks anyway for your time and work :)

Thanks for the commit!