About PySwarm



Swarming, flocking, schooling, and other realistic "live" animation behavior can be easily achieved using PySwarm simply by selecting the behaviors you wish to simulate, tweaking some animation parameters, importing the script into your scene, and rendering the resulting keyframe-based simulation.

The ideas PySwarm is built on have been used in a number of motion pictures, including Batman Returns in 1992 and Breaking the Ice (with the animated characters Stanley and Stella) in 1987. Most modern-day movies now use CGI effects built on the constructs created in the late 1980's.

Current Capabilities
PySwarm is making this same technology available to DAZ3D Carrara users. So far, here is what has been built into PySwarm.

Unlimited BOIDs
PySwarm was designed such that the number of BOIDs you can use in your animation is limited only by the amount of memory and CPU power. I have so far tested my system up to 225 BOIDs without a problem.

Initialization of BOIDs
A number of options allow you to either start your animation sequence where BOIDs are currently positioned, or to have them randomly dispersed within your scene.

Basic BOID Steering Rules
Craig Reynolds' early research into making flocking animation resulted in defining three basic rules that, when applied to each individual (BOID) within the flock, create amazingly realistic animation - cohesion, separation, and alignment. These rules are built into (and are the foundational components of) PySwarm.

To read about early work to create basic flocking animation, go to this link: BOIDs.

Additional Animation Rules
In addition, PySwarm supports the following capabilities:
 * Containment - Set up to 10 containment zones to restrict BOID movement. Three different primitive shapes are currently supported. Zones can be defined as "safe" (BOIDs stay within) or "restricted" (BOIDs remain outside of).
 * Attraction - Define an object in your Carrara scene that will attract or repel BOIDs. The object can be moved about in the scene to draw BOIDs along a defined path.
 * Landing - BOIDs can simulate landing (such as when butterflies strike the ground). You can set the duration of landing.

Movement Controls
A number of parameters allow you to control certain aspects of BOID movement.
 * Initial, minimum, and maximum speed
 * Limit turning and acceleration of BOIDs
 * Restrict movement to a 2 dimensional (x,y) plane within your Carrara scene
 * Activate banking in turns

Current Limitations
There are a number of limitations to the current version (V0.5) that are being worked on.

BOID Orientation
The current version of PySwarm assumes BOID objects are pointing towards (facing) the +X axis, with "up" being in the +Z axis (upwards). Objects oriented in different directions (e.g., facing the +Y axis) need to be adjusted by rotating child objects and potentially repositioning them accordingly.

V0.6 will have a solution for this problem.

Additional Animation Rules

 * Containment zones are currently defined by entering zone information into PIA. V0.6 will allow you to create and use objects in your Carrara scene as zones.
 * Containment currently works when BOIDs "ping" off the containers. That is, BOIDs react to zones when they are about to cross through a container wall. V0.6 will have a completely redesigned approach - by creating a long-distance look-ahead, where BOIDs actively maneuver to prevent them from colliding with zone walls.
 * Attractors currently affect BOIDs everywhere in the scene. V0.6 will allow you to set a distance value where BOIDs outside of that radius from the attractor are unaffected.
 * A Predator-Prey rule is scheduled to be implemented in V0.7.

Movement Controls
PySwarm V0.5 provides the following movement controls: V0.6 will expand this list to include the following:
 * Minimum and maximum speeds
 * Maximum turning and velocity change (acceleration)
 * Activate or deactivate banking
 * Limit movement to be within the X-Y plane (at a defined altitude)
 * A banking factor to inhibit or exaggerate banking angles
 * A maximum banking angle - Some BOIDs
 * A maximum banking rate - How much a BOID can bank, in degrees/second
 * A pitching factor to inhibit or exaggerate pitch angles
 * A minimum and maximum pitch angles - Some BOIDs cannot fly/swim straight up or down, but are instead restricted more in the X-Y plane (but not completely)

Motion Controls
PySwarm V0.5 requires that if BOIDs have any locomotion animation, you have to add this yourself. This can be done via NLA clips or other Carrara plug-ins.

Starting with V0.6, you will be able to define certain forms of motion animation cycles. This will be expanded in later versions of PySwarm.

Features and Quality
I pride myself on developing and offering a product that delivers both on features and quality. During this development,

Accessibility
Anyone who has Python and the PyCarrara plug-in installed on their WIndows-based computer can, with minimal effort, render complex-looking animation sequences.

Ease of Use
An essential feature of PySwarm is that, while the Python programming language (through the PyCarrara plug-in tool for Carrara) is used to perform the keyframe animation, PySwarm users do NOT have to know how to program in Python. In fact, PySwarm was engineered in a way that you don't even have to know a scripting language is even being used!

Fast Results
In addition, PySwarm makes the entire process of adjusting thePySwarm parameters, importing the script, and checking the results extremely fast and efficient. It usually takes just 1-2 minutes to go from editing the PySwarm parameters (through the PySwarm Interface App or PIA) to checking your results in Carrara's animation scrubber!

School of Angelfish
This demo shows the basic animation of angelfish



Flight of F15s
This demo shows a simple setup of 5 F15s buzzing a radio antenna.



Troubleshooting
To get information about current limitations with the current version of PySwarm and PIA,  as well as known problems and work-arounds,   go to the troubleshooting wiki page via the link here.