resample baked f-curve

(liero) #21

yes that’s the latest one… guess you just need to select your object -and curves-

(justavisitor) #22

Whoa, thank you for your extremely fast answer! :slight_smile:

The object is selected. However, I can’t select/deselect the corresponding (baked) curve in the Graph Editor (all options under ‘Select’ are greyed out). But again, the curve looks like it’s selected as it’s red…

(copperplate) #23

A quickstart tutorial example:

  1. After installing the addon, open a new blend file.

  2. Select the cube and press “I” to insert a “Location” key frame.

  3. Change the timeline to the graph editor window, and on the left under CubeAction expand the Location channel. Click the Z Location channel.

  4. Hit “N” inside the graph editor to bring up the properties panel. Under the “Modifiers” tab, click “Add Modifier” and choose “Noise”. Increase the “Strength” to 5.

  5. Hit “ALT-A” to play the animation. You should see the cube bouncing up and down.

  6. In the graph editor window, click “Key” and press “Bake Curve” (or just press ALT-C) and left click to confirm.

  7. Now in the 3D window, in the left toolbar window, navigate to the “Animation” tab (Hit “T” if the toolbar window is not visible).

  8. Click “Unbake to Action”. You will notice down in the graph editor, the whole length of the Z Location channel is now covered in orange, editable keyframes.

(justavisitor) #24

Hi Copperplate,
Thank you for your great tutorial. The noise option was seriously funny :slight_smile: and the addown works just like it should. But it looks very different from my other file, in which I baked sound to F-curves. That curve is red and does not have any selectable points. The curve in your project is blue and has selectable points or vertices…

(batFINGER) #25

A quick note.

I was using similar code to unbake sound drivers. Not sure when these were introduced

>>> fc =['SoundAction'].fcurves[0]

>>> fc.convert_to_
>>> fc.convert_to_keyframes(
FCurve.convert_to_keyframes(start, end)
Convert current FCurve from sample points to keyframes (linear interpolation), if necessary
>>> fc.convert_to_keyframes(1,1000)
>>> fc.convert_to_samples(
FCurve.convert_to_samples(start, end)
Convert current FCurve from keyframes to sample points, if necessary
>>> fc.convert_to_samples(1, 1000)

they’re pretty quick.

(justavisitor) #26

I can’t bake and unbake the curve in this simple .blend.

The unBake buttons are greyed out…

EDIT: Perhaps the plugin doesn’t work with Shapekeys (which I use in this project)? The buttons work as expected if add a new object and animate it directly

EDIT2: OK, I added a bone instead of the shapekey, and that works.


shapekeyBaked.blend (445 KB)

(level1rock) #27


How can I generate a f-curve from the upper and lower points of another one?

(check out the image as example. I want to generate the green f-curve from the red f-curve)

Thank you :wink:


(Cowboyhat) #28

I can confirm this script works on object properties only - so loc, rot, scale curves will un-gray the buttons and it works.
BUT, if you want to use shape keys, the buttons will remain grayed out.

Workaround: unless/until support for shapekeys is added, you can still get this to work.

  • Add a fake/temporary object (perhaps an empty) and insert a location keyframe, then bake sound curves to that location curve.
  • Then go to your real object with shapekeys and insert a “shapekey keyframe” which causes a curve to be created.
  • Now you can copy and paste the curve from the empty to your real object’s shapekey.
  • Lastly, delete the empty/temp object

(copperplate) #29

Almost 3 years later and this addon is still helping me… thank you so much, Liero! Good thing I had saved it on my PC, as I was having trouble remembering what it was called on Google. This addon should be added into Blender permanently. :slight_smile:

(copperplate) #30

Thought it was worth mentioning that this addon is the ONLY way to be able to accurately time remap an animation that uses the “noise” f-curve modifier. I needed to go from 30 fps to 24 fps while maintaining the speed of the original 30 fps animation.

Setting your render setting to 24 (or 23.976) and the Time Remapper addon to 1.25 should have worked, BUT the Time Remapper addon caused instability with my version of Blender when attempting to render frames in excess of 1m 30s each. Additionally, the TR addon could not transition correctly between a 1 frame IK switch in an armature, causing twitching. The only solution was to use Blender’s built-in Time Remapping options. I set the frame rate to 24, Old to 100 (or 30), and New to 80 (or 24), and re-positioned the timeline markers (which were bound to cameras) to 0.8 times their current position.

Only one problem remained: some camera shake, which was using a noise f-curve modifier, suddenly became too violent in this remapped playback. The original motion needed to first be baked (Alt-C) at normal speed (Old: 100, New: 100) and then converted to keyframes using Liero’s addon. The final result is an accurate representation of the original 30 fps motion when converted to 24 fps!