emFlock

(version
Last edited on March 17th, 2014)

Introduction

Introduction

This plugin for Softimage|XSI's ICE is a flocking solver.
It also contains a special set of nodes and compounds for flying and morphing point clouds.

On the emFlock2 web page you can:

  • download the demo version of this plugin.
  • download demo and tutorial scenes.
  • purchase the full version of this plugin.

Note: If you feel that something is not well explained (or not explained at all) then please write me a short e-mail. I will then update the documentation and/or make a demo scene as quickly as possible.

Tip: Check out the following sites for more information, videos and discussions:
si-community.com - the unofficial Softimage community
softimage.tv - the Softimage user based video library

Installation

Important:
- This plugin will only work correctly if the addon emTools is also installed, so please make sure you have the most recent emTools installed!
- Before installing this plugin you must uninstall any previous version.

Installing the addon:

  1. Open the "Plugin Manager". It is located under "File -> Plugin Manager":

  2. As mentioned above: please remove / uninstall any previous version of this plugin. This is really important, because if Softimage finds the same plugin twice then one (maybe even both) might not work.

  3. To install the plugin into the user directory simply right-click onto the folder "User Root" and choose "Install .xsiaddon...":

  4. A browser dialogue will be displayed: go to where you copied the .xsiaddon file, select it and click on "OK". The addon is then automatically installed.

  5. Close Softimage. The plugin is now fully installed and ready to be used. For more information concerning addons and how to install / uninstall them please check the chapter "Working with Addons" in the Softimage documentation.

Demo Version Restrictions

If you are using the full version of this plug-in then you can skip this chapter. If not, please read the following list of restrictions of the demo version:

  • The flocking solver (emFlock2) only works between frame 1 and frame 300.

  • The "Path Creator" compound (emFly) only works between frame 1 and frame 300.

  • Only up to 5,000 particles simultaneously are allowed. If the number of particles exceeds 5,000 then emFlock2 has no effect on the particles.

Note: when you change some parameters in the demo scenes, i.e. the emission rate, and the particles suddenly stop moving or explode, then you probably reached the limit of 5,000 particles. This is no bug, it is simply the demo version restriction

Quick Setups

There are many ways to create a basic emFlock2 setup.
These are the two easiest ones:

  1. The "explode me" compound:

This compound contains a standard emFlock2 setup.
Check the description of the explode me _ emFlock2 compound on how to use it.

  1. Starting from scratch:

    When you take a look at the available emFlock2 compounds you will see things like "Speed Control", "Flocking", "Align Orientation", etc.

    The question now is: "In what order must these compounds be used ?"

    And the answer is: "Simply start with the compound emFlock _ Root".

    The compound emFlock _ Root has input ports that are named just as the compounds that should be plugged into them.

The Compounds (Flocking)

The emFlock2 compounds can be accessed in the ICE Tree viewer.

Tip: all compounds contain the word "emFlock2" in their names, so simply enter "k2" in the search field to see all the available compounds.

The Compound "Root"

Root

This compound is sort of the "docking station" for all the other emFlock2 and emFly compounds. Its main purpose is to execute the compounds in the correct order.
Note that you are not obliged to use this compound. The order can be changed, but as a general rule one might say that the order presented here is best in most cases.

  • The Input Port(s) and Parameter(s):

    • Pre Flock/Fly

      • Execute _ Asteroids
        Plug an emFlock _ Asteroids compound into this port.
      • Execute _ Fly towards Area 1
        Plug one or more emFlock2 __ Fly towards Area compounds into this port.
      • Execute 1
        Plug any further compounds in here that need to be executed before the flocking/flying.
    • Flock/Fly

      • Execute (two ports)
        Plug a emFlock2 __ Flocking compound and/or a emFly ___ Fly compound into these ports. The order can be either "emFlock2 then emFly" or "emFly then emFlock2". Both orders work well, but produce a slightly different behavior.
    • Post Flock/Fly

  • The Output Port(s):

    • Execute
      Plug this into an execute port.

The Compound "Flocking"

Flocking

This is the main flocking compound. It calculates the flocking behavior for the particles.

Note: this compound only exposes the two output ports for the velocities, but you can enter the compound to access further output ports.

  • The Input Port(s) and Parameter(s):

    Note: many of the input ports have a "per object or point of point cloud" context, so that you can create complex setups by giving each particle a different behavior.

    • Enable
      Enables/disables the compound.
    • Strength
      Sets the amount of influence this compound has on the particles.
    • Mind emFly
      Defines how much emFly shall be considered during calculations. This is typically set to 1.

    • View Cone

      • Distance
        The view distance. A particle will only "see" another particle if its distance is less than this value.
      • Angle
        The view angle (in degrees). A particle will only "see" another particle if it is contained in the view cone.
      • Angle Falloff
        Falloff (in degrees) for the view cone.
        The picture below illustrates the view parameters.
    • Behavior

      • Multithreading
        Enables/disables multithreading.
      • Maximum_Number_of_Neighbors
        Defines the maximum number of neighbors that will be used to calculate the flocking behavior. Using larger values results in longer calculation times and more memory usage.
      • Size Mode
        Defines how the particle's size will be used when calculating the flocking. "Consider Size (Medium)" is the default value and has a good quality/performance ratio.
      • Ignore_smaller_Neighbors
        This can be used to make big particles ignore smaller particles, just as a "big fish" will probably more or less ignore a "small fish". The value defines at what point a particle is considered to be "small". Example: a particle of size 4 would ignore all particles of size 1 or lower if "Ignore_smaller_Neighbors" is set to 0.25.
      • Desired Distance to Neighbors
        Defines the distance a particle wants to have to the other particles. Small values will produce denser flocks.
      • Privacy_Distance
        This distance defines the so-called "privacy distance". If particles are closer than this value they will really want to separate!
      • Privacy_Strength
        The strength of the privacy behavior.
      • Velocity_Alignment
        Defines how much a particle aligns its velocity to its neighbor particles.
      • Cohesion_Strength
        Defines how much a particle wants to join its neighbors.
      • Collision - Strength
        The amount of collision.
      • Collision - Radius(Mul)
        A multiplier for the radius when calculating collisions.
  • The Output Port(s):

    In most cases you will probably only use the port "Set Flocking Velocities". It simply sets the particle velocity to the velocity calculated by emFlock2.

    But the emFlock2 node also calculates the neighbors' positions, distances, etc. This data can be used to perform additional tasks, like for example:

    • set the particle's color depending on the distance of the nearest neighbor.
    • give particles without neighbors an additional behavior.
    • implement an alternative flocking behavior with ICE.

    Note: you must enter the compound to access all of the output ports.

    • Flocking Velocities
      The new velocities.
    • Set Flocking Velocities
      Sets the particle velocity to the new velocities. This is identical to plugging the above port into a "Set Particle Velocity" node.
    • No Error
      A boolean value that indicates whether everything went fine (=true) or if an error occurred (false).
    • Number of Neighbors
      The amount of neighbors for each particle.
    • Neighbor IDs
      An array of integers per particle that contains the IDs of the neighbor particles.
    • Neighbor Positions
      An array of 3D vectors per particle that contains the positions of the neighbor particles.
    • Point->Neighbor Vectors
      An array of 3D vectors per particle that contains the vectors going from the particle to its neighbors.
    • Neighbor Distances
      An array of scalars per particle that contains the distances of the neighbor particles. These values are equal the lengths of the vectors Point->Neighbor.
    • Neighbor Angles
      An array of scalars per particle that contains the angles between the particles velocity vector and the vectors Point->Neighbors.
The following picture illustrates how the view cone, the view cone falloff and the view distance are to be understood. The view cone and view distance are very similar to a spot light, anything contained in the cone is visible for the particle. The green particle in the picture is influenced by the particles surrounding it. The more red a particle is the more influence it has on the green particle.

 

The Compound "Asteroids"

Asteroids

This little compound lets you define a so-called "playfield" for the particles. It is simply a bounding volume described by two global positions. Whenever particles leave the playfield they will try to go back in, depending on the "mode".

  • The Input Port(s) and Parameter(s):

    • Active
      Enables/disables the compound.
    • Mind emFly
      Defines how much emFly shall be considered during calculations. This is typically set to 1.
    • Mode
      There are currently two modes available:
      • "Asteroids"
        Just as in the classic video game "Asteroids" everything that leaves the playfield on one side simply re-enters it on the opposite side. If for example a particles leaves the playfield on the right side then it will re-enter it on the left side.
      • "Home, Sweet Home"
        This mode is less rigid than the "Asteroids" mode. When a particle leaves the playfield then it will attempt to fly back into it. Most of the demo scenes use this mode to prevent the flock from flying into Nirvana.
    • Border Thickness
      The thickness (in SI units) of a border used to fade the effect.
    • Playfield's Corner 1/2
      The two global positions of the playfield's corners.
  • The Output Port(s):

    • Execute
      Plug this into an execute port.

The Compound "Speed Control"

Speed Control

This compound controls the speed of particles.

  • The Input Port(s) and Parameter(s):

    • Active
      Enables/disables the compound.
    • Mind emFly
      Defines how much emFly shall be considered during calculations. This is typically set to 1.

    • Cruising Speed
      You can define a so-called "Cruising Speed". This is the speed a particle would like to have (but not necessarily has). Depending on the value of the parameter "Strength" the particle will slowly try to reach its cruising speed.
      A typical example would be a fish that accelerates in order to avoid another fish. Once the fish is avoided it will slowly return to its normal cruising speed.

      • Use
        Enables/disables cruising.
      • Speed
        The cruising speed.
      • Strength
        The strength of the cruising effect.
    • Speed Clamp Interval
      This defines a velocity range for the particles, so that the speed will never drop below the minimum nor exceed the maximum speed interval.

      • Use
        Enables/disables the speed interval.
      • Minimum
        The minimum speed.
      • Maximum
        The maximum speed.
    • Simple Drag Force

      • Use
        Enables/disables the drag.
      • Amount
        The amount of drag.
    • Kick Start
      The speed control has one little problem: when a particle has no speed then it doesn't work properly. The "kick start" fixes that problem by adding a little velocity to particles that are not - or hardly - moving.

      • Give slow Particles a Kick in the Butt
        Enables/disables kick start.
      • Kick Strength
        The strength of the effect.
      • Kick Direction
        Defines the direction of the kick-velocity.
      • Custom Direction
        A 3D vector defining a direction.
  • The Output Port(s):

    • Speed
      The new speed.
    • Velocity
      The new velocity.
    • Set Velocity
      Set the particle velocity equal the new velocity.

The Compound "Fly towards Area"

Fly towards Area

This compound modifies the direction of particles (while maintaining their speed) so that they fly towards a goal defined by a position and a radius, similar to a Disc Area Light. This is similar to "fly towards goal", except that the goal is an area rather than a point.

  • The Input Port(s) and Parameter(s):

    • Active
      Enables/disables the compound.
    • Strength
      The strength of the goal. Note that you can use values greater than 1 as well as negative values.
    • Mind emFly
      Defines how much emFly shall be considered during calculations. This is typically set to 1.

    • Disc

      • Area Position
        The position of the disc.
      • Area Radius
        The radius of the disc.
    • Distance Falloff
      Use this to fade the effect over the distance.

      • Enable
        Enables/disables distance falloff.
      • Length
        The length (in SI units) of the distance falloff.
    • Cone Falloff
      Use this to fade the effect over a view cone.

      • Enable
        Enables/disables cone falloff.
      • Cone Angle
        The angle of the cone.
      • Spread Angle
        The spread angle of the cone.
    • Rotational Velocity
      Limits the rotational velocity so that the particles turn more smoothly towards the goal.

      • Limit Rotational Velocity
        Enables/disables the limit of rotation velocity.
      • Maximum Rotational Velocity
        The maximum allowed rotational velocity.
  • The Output Port(s):

    • Speed
      The new speed.
    • Velocity
      The new velocity.
    • Set Velocity
      Set the particle velocity equal the new velocity.

 

Thanks to its radius the goal has an area so that particles do not fly towards the center of the goal but rather to the closest point of the area. The picture on the right shows the trajectories of particles that move towards a point goal (top) and an area goal (bottom).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The Compound "Align Orientation"

Align Orientation

An all-in-one orientation alignment compound.

Use it to align the orientation of particles. You can choose one of the six particle's local axes that shall be used. Furthermore you can specify either the velocity vector or a custom point in space to that the orientation is to be aligned.

The additional parameters "Rotational Velocity", "Up Vector", "Reduce Flipping", etc. let you create a soft orientation alignment that won't have any hard flipping. So basically this node aligns the orientation slowly so that the animation always looks nice.

  • The Input Port(s) and Parameter(s):

    • Active
      Enables/disables the compound.
    • Mind emFly
      Defines how much emFly shall be considered during calculations. This is typically set to 1.

    • Align Direction

      • Direction
        One of the six local vectors that shall be aligned.
      • Constraint
        The point or vector at which the direction vector shall be aligned.
      • Custom Position
        A position in space at which the direction vector shall point at.
        This is only used if "Constraint" is set to "Point at Custom Position".
      • Limit Rotational Velocity
        Enables/disables the limit of rotational velocity.
      • Maximum Rotational Velocity
        The maximum allowed rotational velocity.
    • Align Up Vector

      • Use Up Vector
        Enables/disables the up vector.
      • Up Vector
        One of the six local vectors that shall be used as up vector.
      • Point at
        A point in space at which the up vector shall point at.
      • Reduce Flipping
        Enables/disables the reduction of flipping.
      • Limit Rotational Velocity
        Enables/disables the limit of rotational velocity.
      • Maximum Rotational Velocity
        The maximum allowed rotational velocity.
  • The Output Port(s):

    • Orientation
      The new orientation.
    • Set Orientation
      Set the particle orientation equal the new orientation.

The Compound "Align Velocity on Plane"

Align Velocity on Plane

This compound affects the alignment of the velocity vector.

For a given plane (defined by its normal vector) the velocity of the particles will slowly be modified in order to be parallel to the plane. The parameter "Strength" controls how fast the velocity is aligned.
This node is can be very handy because even though it modifies the velocity it still gives other effects enough room to operate.

A typical example:
You have a flock of fish that, most of the time, swim parallel to the ground. Sometimes a fish needs to avoid another fish so it might swim up to avoid it. Once that is done this node will make the fish slowly go back to its "normal" swimming direction.

  • The Input Port(s) and Parameter(s):

    • Active
      Enables/disables the compound.
    • Strength
      The strength of the effect.
    • Mind emFly
      Defines how much emFly shall be considered during calculations. This is typically set to 1.
    • Plane Normal Vector
      The normal vector of the plane (note that you need not normalize the vector as it is done internally anyway).
      For example the vector (0, 1, 0) would define the xz-plane.
  • The Output Port(s):

    • Speed
      The new speed.
    • Velocity
      The new velocity.
    • Set Velocity
      Set the particle velocity equal the new velocity.

The Compound "Neighboring"

Neighboring

A compound to get some neighbor information.

  • The Input Port(s) and Parameter(s):

    • Cutoff Distance
      Cutoff distance for the neighbor search.
    • Maximum Number of Neighbors
      The maximum number of neighbors or -1 for no maximum.
  • The Output Port(s):

    • Number of Neighbors
      The amount of neighbors for each particle.
    • Neighbor IDs
      An array of integers per particle that contains the IDs of the neighbor particles.
    • Neighbor Positions
      An array of 3D vectors per particle that contains the positions of the neighbor particles.
    • Point->Neighbor Vectors
      An array of 3D vectors per particle that contains the vectors going from the particle to its neighbors.
    • Neighbor Distances
      An array of scalars per particle that contains the distances of the neighbor particles. These values are equal the lengths of the vectors Point->Neighbor.

The Compound "explode me _ emFlock2"

explode me

This compound contains a standard emFlock2 setup.
Usage:

  1. Drag and drop this compound into your ICE Tree.
  2. Select and explode it.
  3. Connect it to your ICE Tree.

The Compounds (Flying)

The emFly compounds can be accessed in the ICE Tree viewer.

Tip: all compounds contain the word "emFly" in their names, so simply enter "emFly" in the search field to see all the available compounds.

These compounds are all part of the emFly plugin. Latter is part of emFlock2. Even though emFlock2 is not necessarily required for emFly it does have the advantage of working "very well" together with emFly.

So what exactly does emFly do? As the name suggests it will let particles fly around. Furthermore it can let particles land at certain positions and then let them take off again.

A particle that is driven by emFly will go through four phases which can be triggered automatically or manually:

  1. Phase 1: emFly is idle.
    The particles just do whatever they are doing.
  2. Phase 2: the so-called "fly" mode is triggered (activated).
    The particles start flying along some previously defined paths. These paths consist either of one path for all particles or of one path per particle. Each path has a beginning and an end.
  3. Phase 3: the so-called "landing" is triggered.
    The particle switches from "fly" mode to "land" mode. The landing position is equal the end of the path. Furthermore it is possible to specify a landing orientation, size, scale and color.
    Once a particle has landed it sticks to the landing position until the next phase is triggered.
  4. Phase 4: the so-called "take off" is triggered.
    A particle that has previously landed will start taking off thus leaving its landing position and gradually go back to Phase 1. When the take off is completed emFly is idle again and ready to be re-initialized for a next "fly" - "land" - "take off" session.

The above modes were implemented in a way so that the particles fly in a natural and "organic" way but land at very specific positions with exact end orientations, sizes, colors, etc. This allows one to create point clouds with many particles that – at a given moment – will all combine themselves into a given shape...

=> emFly is good for morphing point clouds from one shape into another shape.

The Compound "Fly"

Fly

  • The Input Port(s) and Parameter(s):

    • Triggers

      • Trigger Flying
        If checked then the "fly" mode is triggered.
        Note that this only has an effect if no other mode ("fly", "landing", "take off", etc.) is active.
      • Trigger Landing
        If checked then the "landing" mode is triggered regardless of where the particle is.
        Note that this only has an effect if the particle is in "fly" mode.
      • Trigger Taking Off
        If checked then the "taking off" mode is triggered.
        Note that this only has an effect if the particle is in "landed" mode.
      • Reset
        If checked then all internal emFly flags and variables are reset.
    • Fly

      • Strength
        The strength of the flying.
        Important: setting this to zero will not disable any automatic landing or taking off, it only applies to the flying (= following the pathleader).
      • Show Path Positions and Pathleader
        If enabled then the path positions and pathleaders are displayed in the viewports.

      • Pathleader Incrementation

        • Pathleader Distance
          The minimum allowed distance between the pathleader and the particle. If the distance is too small then the pathleader will continue its way along the path.
        • Pathleader Increment
          The incrementation amount of the pathleader when the particle gets too close.
        • Increment when Pathleader is behind Particle
          If enabled then the pathleader moves along the path when "behind" the particle. This helps preventing particles from never reaching their goal.
        • Amount
          The incrementation amount when the pathleader is behind the particle.
        • Permanent Pathleader Increment
          The amount of constant incrementation of the pathleader. If this is greater than zero then the pathleader moves along the path no matter where the particle is.
      • Engage Landing when..

        • Condition
          Defines the condition at which the "landing" mode is automatically triggered.
        • End-Range
          Defines the end-range for the automatic landing.
        • Timeout (Seconds)
          Defines the timeout for the automatic landing.
    • End Values (Land / Take Off)

      • Use End Orientation
        If checked then the end orientation is used.
      • Use End Size
        If checked then the end size is used.
      • Use End Scale
        If checked then the end scale is used.
      • Use End Color
        If checked then the end color is used.
    • Land

      • Mode
        Defines the landing duration mode.
        There are three different modes:
        1. "Automatic Duration"
          The duration for the landing is automatically calculated based on the particle's current speed and the landing position.
          This mode produces the smoothest landings but in some cases the landing can take very long.
        2. "Automatic Duration <= T"
          Same as above but with a time limit:
          the landing duration is calculated automatically but it won't exceed T.
        3. "Fixed Duration = T"
          A fixed landing duration equal T.
      • T (Seconds)
        A duration (in seconds) that is used for the landing depending on the above "mode" value.
    • Take Off

      • Duration (Seconds)
        The duration (in seconds) of the take off.
    • Evolution

      • Enable Evolution
        Enables/disables evolution.
      • In Geometry Name
        The name of the input evolution geometry.
        This must be the same geometry as used for the Initialize Evolution compound.

      • Set Landing End Values (if available)

        • Set End Rotation
          Use the end rotation of the evolution geometry.
        • Set End Size
          Use the end size of the evolution geometry.
        • Set End Scale
          Use the end scale of the evolution geometry.
        • Set End Color
          Use the end color of the evolution geometry.
  • The Output Port(s):

    • Execute
      Plug this into an execute port.

The Compound "Trigger"

Trigger

Use this compound to trigger the different emFly modes.

  • The Input Port(s) and Parameter(s):

    • Trigger Flying
      If checked then the "fly" mode is triggered.
      Note that this only has an effect if no other mode ("fly", "landing", "take off", etc.) is active.
    • Trigger Landing
      If checked then the "landing" mode is triggered regardless of where the particle is.
      Note that this only has an effect if the particle is in "fly" mode.
    • Trigger Taking Off
      If checked then the "taking off" mode is triggered.
      Note that this only has an effect if the particle is in "landed" mode.
    • Reset
      If checked then all internal emFly flags and variables are reset.
  • The Output Port(s):

    • Execute
      Plug this into an execute port.

The Compound "Set Data"

Set Data

This compounds sets the data that is used for the flying, landing and take off.

When you let your particles fly around you have two possible scenarios concerning the path and the end values. The usage of this compound depends on what scenario you have:

  • Scenario a)
    The path and end values are constant and do not change over time.
    Plug this compound into an "Execute on Emit" port when emitting your particles and enable the "Reset" trigger. That way the emFly paths and end values are only set and initialized once at the particle's birth.
    The main advantage: better performance. Depending on how many particles you have the "Path Creator" compound can be costly and slow down your simulation.

  • Scenario b)
    The path and/or the end values change over time.
    For this scenario you must update the paths and/or end values at each frame. To do that you must plug this compound into an execute port that gets executed at each frame.
    Note that you should not enable the "Reset" trigger in this case.

  • The Input Port(s) and Parameter(s):

    • Do What

      • Set Path Positions
        If enabled then the path positions are set (existing values are overwritten).
      • Set End Values
        If enabled then the end orientation, size, scale and color are set (existing values are overwritten).
      • Reset Flags and Variables
        If enabled then the internal emFly flags and variables are reset.
    • Inputs / Values

      • In Path Position
        The positions of the path as an array of 3D vectors. Typically a emFly _ Path Creator compound is plugged in here, but you can of course use your own arrays of 3D vectors.
      • In End Orientation
        The end orientation for the landing.
      • In End size
        The end size for the landing.
      • In End Scale
        The end scale for the landing.
      • In End color
        The end color for the landing.
  • The Output Port(s):

    • Execute
      Plug this into an execute port.

The Compound "Reset SiScCol"

Reset SiScCol

This compound resets the particle data "Size", "Scale" and "Color" from the values "Init_Size", "Init_Scale" and "Init_Color".
If you are using end values in your emFly construct and want the particles to return to their original size, scale and color after take off then this compound must be executed before the emFly ___ Fly compound.

  • The Output Port(s):

    • Execute
      Plug this into an execute port.

The Compound "Path Creator"

Path Creator

This compound creates a so-called "path" which is basically nothing more than an array of positions that define a (linear) spline. The paths are "per point" so that each particle can have its own path.
emFly will make the particles fly along their path in respect to whatever else is driving the particles (e.g. emFlock2).

When using emFly to make thousands of particles fly around and land on a specific point in space (= the last point of the path) this compound will allow you to create complex arrays of paths based on any combination of input objects like 3D vectors, object centers, curves, polygon meshes, point clouds, etc. In a certain way it works exactly like drawing a spline: you specify a few control points that define a curve, only that here a control point can be a whole polygon mesh (or surface, or curve, ...).
A possible path could be:
  Control Point 0: the current particle position.
  Control Point 1: the global position of a null.
  Control Point 2: the points of a polygon mesh A.
  Control Point 3: the points of a polygon mesh B.
The particles would start their flight at their current position, then fly through the null, then fly through the points of polygon mesh A and finally fly to (and land at) the points of polygon mesh B.

This compound is generally used for the emFly _ Set Data compound.

Tip: enable the parameter "Show Path Positions and Pathleader" in the compound emFly ___ Fly to see the paths in the viewport.

  • The Input Port(s) and Parameter(s):

    • Control Point N
      The control points for the particles' paths.
      Plug as many 3D vectors and/or arrays of 3D vectors and/or emFly _ Get Point Data compounds in here as you wish.

    • Bezier Settings

      • Use Bezier
        If enabled then the paths will be bezier curves.
      • Level-of-Detail
        The level of detail when calculating the bezier curves. Values ranging from 2-5 are generally sufficient whereas bigger values will only cost performance without considerably improving the result.
    • Path Settings

      • Number-of-Output-Points
        This defines the final amount of points for the path.
      • Laplacian-Smooth-Strength
        The strength of the Laplacian smoothing.
        Note: what Laplacian smoothing does is the same as what the "Deform -> Smooth" does with polygon meshes: it removes the spikiness.
      • Laplacian-Smooth-Iterations
        Amount of iterations for the Laplacian smoothing.
    • Volume that may not contain Positions
      You can specify a volume that shall not contain path positions.
      Use this if you want your paths to go around objects.>/i>

      • Use Volume
        Enable/disable the usage of the volume.
      • Avoid this (closed) Volume
        The geometry of the volume.
        Note: it should be a closed volume !
  • The Output Port(s):

    • Array of Path Positions
      The final "per point" paths.
      Plug this output port into the input port "In Path Positions" of the compound emFly _ Set Data.

The Compound "Get Point Data"

Get Point Data

This compound will map (or distribute) the points of the input geometry onto the particles, meaning that a point of the input geometry is assigned to each particle.
The output ports will always output the position (per point of point cloud) and additional data. Latter can be defined as you wish, for example you might want to use point sizes with a point cloud but weight map values when using a polygon mesh.

This compound is generally used for the emFly _ Path Creator compound.

Note: feel free to enter the compound to make modifications to it. You could for example implement an own point mapping.

  • The Input Port(s) and Parameter(s):

    • In Name of Geometry
      Plug the name of your input geometry in here.

    • Mapping

      • Mapping
        Defines how the input points are mapped onto the particles.
    • Deform

      • Push
        Move the input points in direction of their normals.
        This only works with meshes.
      • Relax
        Amount of relaxation of the input geometry. This is sort of a smoothing.
      • Randomize
        Amount of randomness
      • Seed
        Random Seed.
      • Distribution Type
        Defines how the random values are distributed around the mean value.
    • Data References 1-4
      Four additional data types can be specified for output. By default "Orientation", "Size", "Scale" and "Color" are outputted. In certain cases some of the default data types might not be available. A polygon mesh for example does not have a point "Orientation", but you could for example get the available "PointNormal" and "PointUpVector" and then convert those values into an orientation (=rotation) using the "Direction to Rotation" node.
      Use the textfield or the "Explore" and "Pick" buttons to define the data types for the output.

  • The Output Port(s):

    • Position per Point
      3D vector per point of point cloud.
    • Data1-4 per Point
      Data per point of point cloud. The type of the data depends on which data is specified in the parameter group "Data References 1-4" (see input ports).

The Compound "Get Flags"

Get Flags

This compound returns information about the current emFly status of a particle. For example you could check if a particle is still flying or if it has engaged the landing process.

  • The Output Port(s):

    • Active
      If 'true' then emFly is active.
      Note: to activate emFly the mode "fly" must be triggered. Once "fly" has been triggered emFly is active and the other modes (landing, taking off) can be triggered too.
    • Flying
      If 'true' then the particle is currently flying.
      Note: a particle is not flying when it is landing, has landed, is taking off or has taken off.
    • Landing
      If 'true' then the particle is currently landing.
    • Done Landing
      If 'true' then the particle finished landing.
    • Taking Off
      If 'true' then the particle is taking off.
    • Done Taking Off
      If 'true' then the particle finished taking off.
      Note: when a particle has finished taking of then it is in fact "finished with everything" => if this port outputs 'true' then the next port outputs 'true', too.
    • Finished with Everything
      If 'true' then all phases are finished and emFly is idle.

The Compound "Get Flags per Object"

Get Flags per Object

This compound is identical to the emFly _ Get Flags compound except for one very important thing:

The output data is "per Object" and not "per Point".

This allows you to test if a certain percentage of all the particles has a certain state.
For example you could test if all particles have landed and - if that is the case - make them take off.

  • The Input Port(s) and Parameter(s):

  • Percent
    The percent of active particles that must have a certain state in order for this compound to return 'true'.

  • The Output Port(s):

The Compound "Get Percentages"

Get Percentages

Use this compound to get information concerning the percentage of landing / taking off.

  • The Output Port(s):

    • Percentage Landing
      The percentage (0 to 1) of the landing.
        0: not yet engaged landing.
        1: finished landing.
        Something between 0 and 1: currently landing.
    • Percentage Taking Off
      The percentage (0 to 1) of the taking off.
        0: not took off yet.
        1: finished taking off.
        Something between 0 and 1: currently taking off.

The Compound "Initialize Evolution"

Initialize Evolution

This special compound is used to initialize the so-called "evolution".

Evolution drives the order in which particles land. It is typically used to have a flock of particles 'build' an object from left to right or from top to bottom etc.

More information about the usage of this compound can be found in the following video tutorial:

emFlock2 2.30 Tutorial 06 - Evolution
emFlock2 2.33 Tutorial 07 - Update (Evolution)

 

Tips and Tricks, Trouble Shooting

Tips and Tricks, Trouble Shooting

  • Tips and Tricks:

    • Don't use the Softimage "Simulation Root" compound.
      It is recommended to not use the above compound, especially when working with emFly and goals.

    • Watch the "old" video tutorials!
      Aside from a few enhancements the usage of emFlock2 (without emFly) is practically identical to the usage of emFlock version 1.xx. Those video tutorials are therefore still up-to-date.

  • Trouble Shooting:

    • PROBLEM (emFly/Evolution): weird things are happening and particles do not land as expected.
      SOLUTION: the point cloud with the emFlock2 setup must lay in the world's origin (i.e. its global position must be 0, 0, 0) or else some calculations produce faulty results.

    • PROBLEM (emFly): You are using a point cloud as an input for creating a path and somehow weird things happen.
      SOLUTION: the input point cloud probably has some sort of "Delete Points" in its ICE Tree. The problem is in fact the factory node "Point Index to Location": it has a bug and outputs faulty locations with point clouds. The workaround consists of creating a new point cloud and to clone the points into it. Then use that point cloud as input.

    • PROBLEM (emFlock): The playback isn't smooth even though you only have a few particles.
      SOLUTION: some older processor types seem to have a little problem with the multithreading in emFlock. The solution consists of making emFlock singlethreaded: enter the "emFlock __ Flocking" compound, double-click on the compound in there and disable multithreading for the octree creation and the neighboring. Note that this only makes sense when you are working with a rather small amount of particles (< 5000).

    • PROBLEM (emFly Evolution): Some points don't land on the evolution geometry.
      EXPLANATION: there is a bug in Softimage. When points get deleted the point indices are somehow not correct any more and that results in a buggy behavior of some factory nodes ("Point Index to Location").
      SOLUTION: instead of using a point cloud directly as input you need to make a copy of it (= clone the particles into a new point cloud) and use the copy as input.

    • KNOWN ISSUE (emFly Evolution): Don't copy/paste the "Initialize Evolution" compound.
      When copy/pasting the "Initialize Evolution" compound then the copy might not work properly, so it is recommended to always get a "fresh" compound.
      This issue has been detected in Softimage 2012 SAP.

Version History

Version History

  • New in Version 2.0:

    • new set of emFly compounds to create complex paths for particles, have them fly around those paths and morph into a final shape.
    • enhanced emFlock2 compounds that work well with the emFly compounds.
    • new compound for neighboring.
    • a few bug fixes.
    • a few optimizations.
  • New in Version 2.1:

    • new compound "emFly Dynamic Particle Count". (This compound is self-explanatory)
    • new compound "emFly Equal Distribution _ Calc/Set". (Watch this video tutorial on how to use them).
    • a few bug fixes.
    • a few optimizations.
  • New in Version 2.2:

    • the compounds "Fly towards Area", "Speed Control", "Align Orientation" and "Align Velocity on Plane" have some new output ports.
    • the compound "Flocking" has two new parameters for collision control.
    • a few bug fixes.
    • the internal caching as well as the multithreading have been optimized.
    • memory usage has been optimized.
    • the licensing has been improved.
    • subframe Sampling has been fixed/improved.
    • compatibility: scenes that were built with a version prior to 2.2 will still work fine. The simulation will look slightly different though.
  • New in Version 2.304:

    • the new "Evolution" functionality.
    • all compounds have been made public.
    • a few bug fixes.
    • compatibility: scenes that were built with a version prior to 2.3 will still work fine.
    • now supports the new "emBatch" render node licensing.
  • New in Version 2.330:

    • ICE Tree Viewer: all compounds are now in the task "Mootzoid - emFlock2".
    • the compound "Initialize Evolution" has a new mode called "Custom Scalar ICE Data" which can be used to sort the evolution landing positions by any available scalar ICE data on the source, e.g. weight maps or texture maps.
    • the internal C++ function that calculates the intersection/collision between two ellipsoids has been revised. This means that the collision and avoidance behavior is now better than before and it is now possible to create "tighter" flocks that still look good. Even some liquid-like simulations are possible to a certain extent (see demo scene "Bacteria_Pseudo_Liquid").
    • compatibility: scenes that were built with a version prior to 2.33 will still work fine.
    • a little bug fix regarding the threading.
  • New in Version 2.334:

    • An important bug fix regarding Softimage 2013 and 2014:
      for some reason Softimage 2013 and 2014 would crash when dropping more than one "explode me", "Flocking", "Path Creator" or "Neighboring" compound into an ICE Tree (i.e. any compound that has the emFlock2 custom ICE node in it).
      In the previous release some internal changes were made regarding the input port groups, perhaps that confused Softimage 2013 and above.
      This issue has been fixed in v.2.334.
  • New in Version 2.370:

    • the addon is now built separately for Softimage 2012, 2013, etc. using the respective SDK.
    • a few minor bug fixes regarding the internal calculations of orientations.

Limitations and Remarks

Limitations and Remarks

  • emFlock2 is only available for 64 bit systems (Windows and Linux).