Page MenuHome

Add a Un-Bake FCurves operator
Needs RevisionPublic

Authored by Sebastian Parborg (zeddb) on Dec 9 2019, 5:29 PM.

Details

Summary

We already had the ability to bake fcurves but no way to convert the baked result back without using python.
This patch adds and operator that is available now next to the bake operator in the drop down menu,

Diff Detail

Event Timeline

I basically copied the "bake" operator with a few modifications. I left the comments from the bake operator code mostly untouched.

One thing I don't understand from a conceptual point of view, is why there are start and end parameters. Why not convert all the baked data there is?
As the code was moved from a place that already had those start and end parameters, keeping them around makes sense, of course. When it comes to the new un-bake operator, do you have any strong feelings about the default values ? Would it work to have them initialised to INT_MIN and INT_MAX so that all baked data is converted?

source/blender/blenkernel/intern/fcurve.c
1036

'leading' and 'heading' mean the same thing. Maybe 'leading' and 'trailing'? I know it's just a copy-paste, but it's an excellent opportunity to make things actually correct.

Update to take care of inline comments.

Sebastian Parborg (zeddb) marked an inline comment as done.Feb 18 2020, 3:53 PM

I'm not sure if we should change the start and end frame range as this matches how the bake operator works.

Perhaps changing how the bake/unbake works for the bake and now unbake operator could be done in an other commit?
(When we perhaps have a more concrete plan on how we want this to work)

Sybren A. Stüvel (sybren) requested changes to this revision.Feb 18 2020, 6:35 PM

Perhaps changing how the bake/unbake works for the bake and now unbake operator could be done in an other commit?
(When we perhaps have a more concrete plan on how we want this to work)

👍

source/blender/blenkernel/intern/fcurve.c
982

TODOs should have the name of the person who knows more about this.

source/blender/editors/space_graph/graph_edit.c
1864

Sentences should end in a period.

1900

Comments should be full sentences (start with capital, end with period).

1906

TODOs should have the name of the person who knows more about this.

1906

No C++ comments in C files.

1915

No C++ comments in C files.

1936

TODOs should have a name (and be capitalised).

This revision now requires changes to proceed.Feb 18 2020, 6:35 PM

The recent comments are for copy/pasted code. It would be weird to me to fix these here but not for the rest of the code.

How about we do this in multiple steps? One commit with the unbake operator and one clean up commit.

This could have been done in one go in phabricator worked with the pull request workflow (github/gitlab/gittea etc).

I'm guessing it is not possible to have multiple commits in one differential, right?