Blender Behavioural Simulation
powered by OpenSteer
Introduction
OpenSteer is a C++ library to help construct steering behaviours for autonomous characters in games and animation (from OpenSteer website). Blender is the free open source 3D content creation suite, available for all major operating systems under the GNU General Public License (from Blender website). Imagine the possibilities of both combined. BBS started as a simulation tool for a very specific situation of a research project at the Technical University of Eindhoven but has since than evolved into a more general design tool.Real-time
By combining Blender and OpenSteer, both modelling and simulation can take place simultaneously in real-time. This means that the actors in the simulation respond to your modelling decisions while you model! Furthermore, the position and rotation of the actors are stored using Blenders flexible IPO keys. Thus, simulation runs can be manually edited, played back and saved to disk.Demonstration video
License
The modifications to OpenSteer are licensed under the MIT-license. The Python scripts are licensed under the GNU General Public License v2 or higher.Downloads (version 20090511)
The OpenSteer Daemon has been verified to compile and run under Ubuntu Linux. However, only a windows binary is provided here.- Download Python scripts for use with Blender.
- Download compiled OpenSteer Daemon for win32 (opensteerd.exe).
- Download the OpenSteer source with modifications.
- Or simply Download all.
- Download Blender from the Blender website.
Installation
On Windows
Move opensteerd.exe to the directory where you want it to reside or compile it yourself, preferably with Microsoft Visual Studio.On Linux
Compile OpenSteer Daemon using the provided Makefile in opensteerd/linux/, the binary will be located at opensteerd/linux/objs_optimized/opensteerd.elfBoth
Move the Python scripts (opensteerd.py and bbs_gui.py) to your Blender scripts directory (i.e. C:\Program Files\blender\.blender\scripts or ~/.blender/scripts). The script is accessible in Blender from Scripts > Animation > BBS.Usage
Some basic Blender skills are required, like knowing how to add and edit meshes and curves. I will not explain how to do that, but there are excellent tutorials available on the web.BBS uses the TimeLine functionality in Blender since this is the only way to retain editing functionality while animating. However, (afaik) there is now way to control this functionality by script. Therefore, a TimeLine area has to be visible when using BBS. The buttons on the TimeLine area have to be used to start, pause and stop a simulation or play one back.
opensteerd path:
Provide the path where the OpenSteer Daemon resides.Run Daemon:
Start the OpenSteer Daemon and make Blender connect to it.Terminate Daemon:
Terminates the Daemon. After terminating the Daemon the simulation can't be continued, but can be played back.Mode:
Whether to base actor locations on the OpenSteer Daemon or the previously recorded IPO keys.# Actors:
The number of actors in the simulation. Note that this can be changed even in middle of a simulation.Path:
The path which the actors follow. This should be a Blender Curve Object with only Polyline knots. This can also be changed in the middle of a simulation. You can type in the name of the object or press A to use the active object. When you change the path before starting the simulation, you are advised to reset the plugin once before starting the simulation. Or else the actors will all start at an (arbitrary) default path and have to move to the selected path.Obstacle:
A Blender Mesh the actors try to avoid.A section is computed at the Z=1 plane. The OpenSteer obstacles are based only on that section.
You can type in the name of the object or press A to use the active object. Enter and leave editmode once on the obstacle to send the obstacles to the Daemon.
Reset Plugin
Resets the plugin and moves all actors somewhere close to the path.Native Render
Switches to the internal OpenGL representation of OpenSteer. This breaks the connection with Blender and is probably only useful for debugging behaviours of the actors.Notes
- Blender has the ability to continue playback whilst editing, BBS uses this feature, however, Blender temporarily halts playback when using tools, such as translation, rotation, and scaling.
- BBS' primary functionality resides at the OnFrameChange event. When in simulation mode, every time the current frame changes (either because the play button has been pressed or the current frame has been changed manually) the actors are moved to wherever the Daemon believes they should be and there location is stored using IPO keys at that current frame. The Daemon is not aware of the current frame in Blender, so for the Daemon the asked frame always comes directly after the previously asked frame, even if this is not the case in Blender (i.e. when manually moving the current frame to an arbitrary position or when the current frame moves beyond the end frame and thus starting over again).
- The only example provided is two-dimensional even though there’s no particular reason to not allowing 3d simulations.
- Only one Blender object can currently act as an obstacle, but the object naturally can contain multiple contiguous parts.
- The Python script is not nice to other active ScriptLinks, don't use the script when there are other ScripLinks present and you want them to function.
- Memory usage in Blender is high when running BBS. I don't know the reason for this, but keep this in mind. Don't make the animation too long as frame rate and responsiveness can really get below a point where usability is at least questionable.
- Visibility of objects during the animation is controlled using layers. Visible objects reside in layer one, the objects hidden at the current frame are in layer two.
- The script has only been tested with Blender 2.48 on Windows XP and Ubuntu 9.04.
Suggestions
Please let me know your comments, suggestions and questions: omaskrijn.If the above has been useful to you in some way, please consider adding your local architecture highlight to Archikey.com.