I'm trying to create a program that allows you to input an amount of time (e.g. 50 years, 100 years, 10 years) and the script runs for that scalable amount of time but shortened (so scale 50 years to 5 seconds, 100 years to 10 seconds, 10 years to 1 second).

Currently my main program looks like so

scene = bpy.context.scene
# change this to see 3 or 2 tuple demo
tuples = 3
cultures = 4
lamp, cam, kernel, culture_list = graphics_factory.create(tuples,cultures)

positions = []

# random points for modeling purposes, this will change to data later
for i in range(200):
        y = uniform(-2.0,2.0)
        x = uniform(-2.0,2.0)
        y = uniform(-2.0,2.0)

number_of_frame = 0  
t_end = time.time()+10
# makes cultures move around
while time.time() < t_end:


    for culture in culture_list:
        culture.location = positions[randint(0,100)]

    # move next 10 frames forward - Blender will figure out what to do between this time
    number_of_frame += 25

as of right now I am not simulating time. I have found the "my_handler" method of working with frames in a scene but this doesn't seem to allow me to change the a.) number of frames or b.) amount of time it takes to run through the program. I'd like to move away from running through the loop for 10 seconds like I do but i'm not sure of any other way to simulate movement. Does anyone know of a good way that allows me to simulate movement and time?


1 Answer 1


I've found there's no built in way in blender (other than physics simulation engines) to do this. Instead I mapped 'time' to frames linearly and customized the number of frames in the animation with scene.frame_end with the while conditional being

   while number_of_frame < scene.frame_end:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .