Continuously Update Blender Animation

Viewed 10

I am using OpenPose to generate facial keypoints from a live video taken from the webcam of my laptop. OpenPose saves the facial keypoint data into one json file per frame into a folder. I have a script in blender that assigns the motion of the facial keypoints to a different bones of a blender rig, poses the character and creates keypoints based on the data from the json files.

I would like to play my character animation while blender imports data from the json files and creates new keyframes so my character animation updates in real time, or close to real time, and I can see my character's face synchronized with my face.

The idea I had to do this was to create a loop where I inport data from 96 frames, create keypoints, play the animation from the 0th frame, stop the animation after 2 seconds, delete the keyframes, import the next 96 frames and so on. When I try to stop the animation, I get an error: WARN (bpy.rna): C:\Users\blender\git\blender-v320\blender.git\source\blender\python\intern\bpy_rna.c:1339 pyrna_enum_to_py: current value '31' matches no enum in 'ImageFormatSettings', '(null)', 'file_format' and the script stops looping. Can someone please help me figure out what is happening and why this isn't working? Or how I can do this live animation updating a different way?

Thanks!

0 Answers
Related