Jump to content

blender, fcurves and animations


gsll

Recommended Posts

Considering the advances vpoteryaev made with skyrim nif data utils,
I would need a script that would automatically, for every bone,
insert a keyframe corresponding to all bone constraints along the whole timeline.

I think f-curves are the best way to get the information between two keyframes.

The script would :

- get the properties of the bone : location, scale and rotation

- insert a keyframe for all these.

The blender API documentation on fcurve doesn't help much.
I need some good examples to figure out how it works.

I've been looking at f-curves and looking for working examples (blenderstackexchange seems the only resource):
- evaluate property at any keyframe 1
- evaluate property at any keyframe 2
- select a fcurve
- get keyframe data
- export anim data property

I have not yet managed to make a working script to retrieve the required values.

Does anyone could provide a tip or a link toward working script ?

 

Best regards

Link to comment

If you are wanting to bake the keys, Blender already does that.

 

In Pose Mode, go to: Pose->Animation->Bake Action.

Select: Only Selected, Visual Keying, and Clear Constraints.

 

Blender will then key all bones relative to the constraints used.  This can then be exported.

 

ETA:  Be sure to select all bones (keyboard shortcut A) before baking.

Link to comment

If you are wanting to bake the keys, Blender already does that.

 

In Pose Mode, go to: Pose->Animation->Bake Action.

Select: Only Selected, Visual Keying, and Clear Constraints.

 

Blender will then key all bones relative to the constraints used.  This can then be exported.

 

ETA:  Be sure to select all bones (keyboard shortcut A) before baking.

 

 

Thank you.

 

It works better with all bones selected.

Sorry, at current stage of 'utils' development this method gives nothing at output except error message.

Because:

1. Action name must start with 'skeleton'. Easy to fix - I will remove 'assert' statement that check this requirenment.

2. Baking adds scaling parts to keyframes that not supported at that moment.

3. Baking doesn't create exactly 'LocRot' frames, but sometimes only 'Location', sometimes 'Rotation'

I'll try to update scripts before weekend.

 

Kind Regards.

 

ADDED: quick fix in post.

Link to comment
  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use