[ODE] ODE/Blender

nlin@nlin.net nlin at nlin.net
Fri Oct 18 17:59:02 2002


Russ Smith wrote:
>
>i'm in full support of ODE/blender integration - i think this is quite
>an exciting prospect. in fact i took some very preliminary steps in this
>direction as soon as the blender sources were released - but as norman
>is far in advance of my own pitiful attempt i will abandon what i am doing
>and help out the existing effort.

Not so fast - we may be doing different types of ODE/Blender integration
so I wouldn't throw out your work just yet...

>i have a question: the commercial dynamics providers (ME, havok etc) have
>their own plugins for 3DSMax, maya, and other expensive tools. i am
>wondering what functionality, if any, would be lost by an artist switching
>from e.g. 3DSMax/Havok to Blender/ODE ? (i'm a 3DSMax novice and a
>blender dummy.)

Something important to understand about Blender is that it has a built-in
real-time interactive 3D game engine. This means you can model a 3D scene in
Blender, press the "P" key, and Blender instantly (typically less than 1 second)
starts the game engine, which then controls all objects on-screen. This is
a reasonably complete (Turing-complete, anyway) game engine; you can animate
objects along paths, read keyboard input, move the camera and players around,
create/destroy objects, set variables, send messages between objects, run
scripts, and have objects controlled by the physics subsystem.

This physics subsystem in the real-time game engine is what I am working
on, so that Blender real-time games can have dynamic objects controlled
by ODE. (The previous Blender game physics were impulse-based.)

>i am guessing
>that the initial blender integration will be to run ODE simulations
>within blender to produce animation data, and that the saved dynamics
>information will be tied in with blenders own file format(s).

This is not the ODE/Blender integration I am working on right now, but
it is very important as well, so that artists creating non-interactive animations
(more traditional animations and movies) can also use ODE to create realistic
dynamic motions. As I am not an expert in creating these kinds of animations,
I don't know how such tools typically work or how they could be integrated
into the modeling/animation workflow of Blender (as opposed to the game engine
integration, which appears to me to be of a different nature). The way it is
now integrated, physical properties of objects are specified either in the
Blender material for the object (button DYN in the MaterialButtons) and/or in
the Blender Game Attributes for the object (in the GameButtons). These buttons
allow the user to enter properties like mass, friction, bounding volume, etc.
The Blender game engine reads these fields on game startup, then creates the
ODE objects. A rendering/animation tool should probably use these same
buttons to read out physically relevant information, but would start an ODE world
and simulate one timestep forward for each frame of the animation rendered.
From what you write above it sounds like you are talking about the possibility
of running the simulation just once then "baking in" the ODE-computed animation
to save the animation data somewhere. This would also be possible. Again, I don't
know how such tools usually work.

>it would
>also be nice if it blender could export a file format describing just the
>dynamical attributes that have been given to the geometry objects, so
>that in my game/simulation/whatever i could load this data, construct the
>ODE objects, then attach the objects to my scene data.

Blender has a python scripting interface, and many good python scripts have
been written, especially for exporting/importing data. The python integration
is kind of shaky right now, since the project just went GPL, but I expect it
to stabilize. At that point, it should then be fairly easy to add python
access to the new dynamical attributes (friction, restitution, bounding
volumes, mass, etc) associated with each object. Then a python script could
simply iterate over all objects in the scene, iterate over all attributes for
each object, and write it out in any format desired.

-Norman