Hello, I'm in the process of porting one of my old model export scripts to the new version of blender but I've encountered some problems.
I used to use Blender.Armature.NLA.GetActions() then iterate each action and again iterate and set each key frame and just get the necessary information from the pose bones..
This no longer works with a new system in place.. I've found no resources regarding how things work now and I've spend hours going through the python/blender documents trying to figure out any way to get the right information.. but with no success ..
Does anyone have any insight into this? or know of any export scripts that have been ported to the new version?
I would be very grateful for any help regarding this. <3
Hello,
For animation export, I’m using the principle found in io_export_directx_x.py.
See for example WriteFullAnimationSet. It looks like the animation is simulated frame by frame and at each step, you can extract the position, rotation, etc… to put in your export format.
It looks roughly like:
| Code: |
KeyframeCount = bpy.context.scene.frame_end - bpy.context.scene.frame_start + 1
for Object in Config.ObjectList:
...
for Frame in range(0, KeyframeCount):
bpy.context.scene.frame_set(Frame + bpy.context.scene.frame_start)
... get the current object position, rotation, scale, armature etc.. at the current framekey position
process to store in your format
|
Does it fit your request?