I've imported a motion capture armature from an fbx file, the problem is whenever I check the action number of keyframes for any fcurve they are much more than I expected from previewing the action keyframes in dope sheet (the action starts at frame 1) enter image description here

The keyframes timing is not aligned to blender frames as well. enter image description here

I could fix this manually by selecting all the keyframes in the dope sheet editor, press g to move them then left click, this snaps all keyframes to their correct location in the timeline and when I recalculate the number of keyframes I get the expected number of keyframes. enter image description here Is there a way to replicate the same process in python?

  • $\begingroup$ Yes there is. Buy maybe your question should be: How can i...? ;) $\endgroup$
    – Chris
    Jun 12, 2021 at 12:30
  • 1
    $\begingroup$ Firstly it is not vital that kfs be exactly on frames, as long as the action time is same mocap will look Ok . A bvh often has a very high frame rate eg 100 frames per second. Which if imported "raw" at default 24fps will have 100 kfs jammed into 24. Since the Importers use the bvh timing. (bvh importer has options not to) Some options Set blender fps to match. Set a frame rate multiple eg 25 fps keep 1 & cull 3 of each 4. Clean and smooth the fcurves (wont put kfs on exact frames will cull a lot) Can make a new action with copy of fcurves by using Fcurve.evaluate(frame) $\endgroup$
    – batFINGER
    Jun 12, 2021 at 13:20


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.