can python do animation ?

I see a lot of modeling and uv type of scripts but nothing for animation like a random move tool or random birds paths wings flapping.

http://www.blender3d.org/cms/Animation.61.0.html This is all i can find but it is very sparce.

I found getting documentation or examples to be difficult,
but the following modified script (from Strubel’s original)
is a great way to learn how to create nice moving object
scenes:

http://www.cise.ufl.edu/~fishwick/blender/tumble

The complete rendering is done in about 20 seconds on
a reasonably fast machine. Load the .blend file, press
ANIM, and go to the area where the movie is created.
I recommend using the AVI JPEG option for recording
the movie - it is highly compressed, but seems to preserve
everything, at least for this example.

-paul

BMG does animation

http://projects.blender.org/viewcvs/viewcvs.cgi/bstar/BMG/?cvsroot=bstar

Stefano

Stefano:
This is , of course, excellent - I created a few gears! I think the
overall problem, however, is that most people are trying to get
to square 1 with simple scripts like:

  • how to make a sphere move up and down
  • how to make a sphere move up and down using physics
  • how to make a sphere pulsate or change color

People see lots of really complicated scripts and just want something
simple that provides them with the necessary skill set. A great 2D
package that has this sort of documented support is Processing
(www.processing.org). While Blender’s scripting is incredibly
powerful, the “teaching” documentation is lacking. I may see if I
can get a student project going on this.

-paul

all of thise are cool and this one
https://blenderartists.org/forum/viewtopic.php?t=28745&highlight=shatter

the problem is that since it is code it scares any toying withit away. If there was a basic GUI that all scripts could go through or a random adjustment of options or even presets to get started with, it would make the use of these scripts more open.

Speaking of animation, how do you keep track of
state variables in your Python script? There are some
variables that need to be available between frames.
For example, any physics based simulation that uses
Python user variables to keep track of object state…

Take this excerpt for example:

import Blender
from Blender import *
from math import *

frame = Get(‘curframe’)
if frame == 1:
i = 0

print i

After frame 1, variable ‘i’ is no longer recognized. I need a way to
keep the value of ‘i’ alive from one frame to the next. Any ideas?

Come on :wink: the ‘animation’ part is just a ‘get rotation of gear A, multiply by a number, set this rotation to gear B’ :slight_smile:

Please join db-docboard mailing list!

Stefano

just declare I before the if then at the if set it to 0


i=0
frame = Get('curframe')
if(frame==1):
   i=0

the problem was that you wern’t declaring i before the if and such when the if doesn’t run the computer never makes the i variable.

MacBlender

Thanks for that quick feedback. I probably did not describe
the problem in sufficient detail. I need to be able to update
the variable as well. So for example, suppose I want to initially
set i to 0 in frame 1, and then increment i by 1 each frame.
how do you do this when (1) the script code is run in its
entirety each frame, and (2) none of the variables, apparently,
are remembered from one frame to the next?

I can think of a potential solution, but it is really arcane-- build
a special purpose C++ plugin that does nothing more than
store variables for later access. A better solution would be a
keyword such as ‘static’, designating that a variable is to retain
its existence and value for all frames.

-pf

Looks like you guys answered this on the other thread. i put
the other thread up since I thought this one was buried under
another topic.

Thanks!

well you may know this one: https://blenderartists.org/forum/viewtopic.php?t=28155

It’s the ODE physic engine in Blender. like having game engine animation in keyframe.