Salutations cronies, I am having trouble getting the Record Animation setting to work. I have read and watched a number of tutorials but I cannot get my animation to be recorded. Here:here is a link to get my blend file and below is the code for the module called by it (to get the characters ears to move in a continuous sinusoidal manner).

## Program to slowly alter vectors of bones and servos which is ####
## read by Blender ####
import os
import time
import math


def boneInstruc():

    while 1:  
        global i #necessary to ensure using global variable 
        #servo(xRE, xLE, xTL)
        return (RE, LE, TL)
  • $\begingroup$ you might want to use driver and expressions for this movement instead. Also does this code execute once per frame? $\endgroup$ – Vader Apr 2 '14 at 12:25
  • $\begingroup$ Thanks, I tried to use Bone Driven Shape Key animation in another file but it would not work either. All the internet examples seem to use the physics engines to do actions and to record them into the Time Line or DopeSheet (eg link). And yes the code executes once per frame. $\endgroup$ – CubeBot88 Apr 2 '14 at 12:46

Python scripts run blocking in Blender, which means Blender will wait and UI be locked until finished. You won't see an animation therefore, no matter if you use time.sleep() or not.

Use a frame change handler to register a callback function, that changes objects on every frame change (before or after):


| improve this answer | |
  • $\begingroup$ I may be wrong here but the link you sent me is for commands in the Python console - meaning then cannot be called in a Python BGE Module or Script. Could you be so kind as to show me how one calls the frame change handler in the BGE? -Alternatively, is it possible to extract data from a text file and use an Expression with a Bone Driven Shape Key animation to control the character (an alteration of Vaders comment)? $\endgroup$ – CubeBot88 Apr 24 '14 at 7:19
  • 2
    $\begingroup$ You should open two new questions for that, and add the game-engine tag! $\endgroup$ – CodeManX Apr 24 '14 at 19:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.