Python in Animation

Hi people,

I’m making a part of animation using a Python script, but I have some questions:

  1. I added the script on “Scriptlinks > Object Script Links > FrameChanged” to execute at each frame on one object. That’s correct?

  2. I can’t use Gamelogic when animating by Render, correct? That’s really an animation, not a game.

  3. Something strange is happening: when I was testing the animation (Alt+A) the changes are made on object is permanent. Why?

  4. That’s a stupid question: I need to know if it’s first frame. How can’t I do that?

Thanks so much. And sorry for a lot of questions!

First of all, tell us WHICH Blender version (SVN#####) you use.

Half answer to 2.
If you did something with a Gamelogic, you can export it to (automatically) animation settings (for Alt A).
I did not see direct from a Script (normal) using the GE …

Thanks a lot PKHG!

Then, first of all, I’m using Blender 2.49b (stable).

That’s good, I’ve much more experience with Gamelogic!

But I’ve done some tests before start the project and when rendered the animation, all GE scripts have been ignored.
Have I done something wrong? I missed some setting?

Oh, I am nearly only using Bl 2.56 … SVN >=344**
In Bl 2.5* I have seen examples of using scripts in the GE …

Feel free to click on any of the 2.49 script links in my signature. The APE script has an example of how to detect a rewind (i.e. if curFrame == 1).

Hi people!

Thanks Atom!

I’m using the 2.5 version now. And GE is still ignored on animation. I think missing some configurations.
I’ve made a simple test file, and in game mode § everything works, but on animation (Alt+A) nothing happens.

I found some solution - that works for my animation, but only temporary - using the Game > Record Game Physics to IPO on Wiki as “Rigid Bodies”.

And thanks to Ira Krakow’s tutorial (the forum doesn’t let me post links :frowning: ).

Solved!

The secret is use Ctrl-Alt-Shift-P to generate IPOs in a smart way.

Thanks to anomalydetected and, again, Ira Krakow.

Another way to generate IPOs, which bypasses actually running the game, is to press Ctrl-Alt-Shift-P with your objects in the position as if you were going to run a game. Go to Frame 1. Position the icosphere above the plane. Disable Record Game Physics to IPO in the Game Menu. Instead, press Ctrl-Alt-Shift-P. The Bullet Physics engine runs, generating the IPO curves. Press Alt-A. Change gravity to 16. Press Ctl-Alt-Shift-P. Then press Alt-A. We now have the IPOs for gravity in a bigger planet, like Jupiter.