Okay, I may be missing something thats already been covered or something, but, is there a way to set animations to frameskip so as to keep synchronised with sounds if the machine may not be powerful enough (eg. for linear animations/ presentations), in realtime, of course. I did a couple of searches but turned up only with framerate limiting (one of which I started )
Creat a timer property called time and a float property called frame on the object playing the animation, set the object’s IPO or action actuator to property play mode, and set frame as the property to play by. Now attach this script to an always sensor:
# the number of frames you want the animation to play per second:
FPS = 25
owner = GameLogic.getCurrentController().getOwner()
owner.frame = owner.time * FPS
Now the animation should play at exactly the same speed at any framerate.
If you want looping animation though, you’ll have to modify the script slightly.
So how will it change if I wanted something like a game or something interactive where events and actions are in loops or being called for?
if you want it to loop, change it to this:
# the number of frames you want the animation to play per second:
FPS = 25
# the number of frames in the animation
MaxFrames = 100
owner = GameLogic.getCurrentController().getOwner()
owner.frame = (owner.time * FPS) % MaxFrames
That should work for a constantly looping animation.
You can have more control by setting owner.time to zero every frame until you want the animation to start. Or make the animation start in the middle by something like owner.frame (owner.time * FPS + StartFrame) % Maxframes
You can play around with it to get other effects too.
By the way it there a script to make a sort of bullettime like in Max Payne or Matrix style?
yea… make ONE WISEMAN XD
Someone made one of those a loooong time ago. It’s not hard to do it with actions or ipos, but it would be fairly difficult with physics. I suppose you could slow down forces, but I’m not sure the results would be predictable. Would be interesting to see:)
Yeah, just make a script that slows down all forces or motion actuators by 5.0 or something like that, so this shold be a way to make a bullettime like in Max Payne. :o
Just slowing down the forces might not be enough. You’d also have to adjust the damping / friction on every object.
Since I don’t think there’s a way to access an onject’s damp value, or a material’s friction in python, then there’s no way to make bullet time work with blender’s current physics engine.