Graph Editor sampling key frames issue
Closed, ResolvedPublic


System Information
Windows 10 64Bit, GTX980

Blender Version
Broken: 2.79

Short description of error
Graph Editor >Key >Sample Keyframes (Shift + o) doesn't sample correctly.
Exact steps for others to reproduce the error

  1. Grab the default cube, make a location key frame as is default, 0, 0, 0 at frame #0.
  2. Scroll time line and go to frame #30
  3. Bring the cube up z, 10 (whatever) and make a location key, x =0, y =0, z = 10 like so.
  4. Scroll time line and go to frame #60
  5. Put the cube back to original position, x =0, y =0, z =0

6, With selecting the cube, open graph editor and Key > Sample keyframes

  1. Please undo and redo to compare the difference between before and after the command applied.
Joshua Leung (aligorith) triaged this task as Confirmed priority.

Confirmed. Looks like the problem is that it currently adds keyframes between each pair of keyframes instead of sampling the whole region first before changing anything.

Well it is solvable, also...

Remind the process of this, if you select 2 key frames and do "sample key frames".
Normally the goal of that is to produce a smooth transistion to just those 2 frames.
And that results in 'sub' key frames , each frame has bezier curve and because the next frames are close their control vectors are short as well.
Thus since by default those control vectors are mirrored the first and the last one get a small vector to, and since by default it are mirrored control vector that causes the shape change beyon the selected period.

Here is how you could do this :
Turn begin and end bezier curve into (Key > Handle type > free ), this disables the mirroring effect they normally have (which is normally handy).
Next from the two bezier points only select the 2 vectors that suround the area where you want to do this.
Next perform "Sample key frames".

Its not realy a bug i believe, but maybe it wouldnt be a big code change to automate what i just described
ea if there is a continous selection of keyframes turn first and last one into free type before sampling all the key frames.

PS i wonder why one would do this, as normally you would be glad to not have so many key frames (its a big trouble to alter values for a series of them ..)

While investigating this yesterday, I realised that there is a workaround. Instead of selecting all the points covering the range you want to sample, just select the first and last keyframes of that range (e.g. the first and last keyframe, leaving out anything in between).

Thank you Peter and Joshua for the solution. That works perfectly. The reason why I need that is to mirror animation for characters. In order to mirror tons of keyframes on tons of function curves at one time, I've found that I have to sample all of the function curves before I mirror them.