Hi,
I’m working on an animation in which one I make an object to go through a tube. As it reaches the end of the tube, I would like it to start again from the beginning of the tube (like a html marquee) while the entire animation still running. As I couldn’t do it with the generic blender tools (or tell me if I can), I managed to do it with a python script as follow:
import Blender
donnee = Blender.Object.Get(‘myObjectName’)
Blender.Set(‘curframe’, 1)
donnee.setLocation(0.0, 0.0, 0.0)
originY = donnee.LocY
#want to move along Y coord
for i in range(1, 50):
Blender.Set(‘curframe’, i)
donnee.setLocation(0.0, i, 0.0)
Blender.Redraw()
#simulate marquee, reinitialize position and start again
if(donnee.LocY > 30):
donnee.setLocation(0.0, 0.0, 0.0)
...
With this code, I can see myObject moving as I expect, but of course, location at each frame is not saved. I guess, I have to insert keyframes at concerned frames but I don’t know how.
Anyone could help please ?