Attaching Geometry to Particles
syllabus | schedule | projects | class notes | resources | students | ARTC courses
Attaching Geometry to Particles
Open the dragonfly_Start.mb file
Select leftWing and shift click rightWing in the Outliner

Use Shift E to keyframe only the rotation of the wings at the following frames:
Use Middle Mouse button to go to a new frame with out updating the animation

    Frame 1 and 5 - rotate wings down
    Frame 2 and 4 - wings straight
    Frame 3 - wings up

Go into the Graph Editor and View menu Frame All

Curves - Post Infinity - Cycle with Offset

Make a grid of particles

    Number of particles = 1
    Particle spacing = 12
    Create Particle Grid -> Placement with textfield
    Min corner = -25, 0, -25
    Max corner = 25, 0, 25

Cursor in Window - Enter

Add Creation Expression to Position of the particles

    float $randY = rand(-3,3);
    float $randXZ = rand(-1,1);
    vector $offset = <<$randXZ, $randY, $randXZ>>;
    position = position + $offset;

Create (rewind till you get enough dispersion)

Solvers - Initial State - Set for Selected
Middle Mouse button drag the script to the shelf and delete it in the Expression window & press Edit

Select the dragonfly in the Outliner
Particles - Instancer(replacer) Options

Particle Instancer Name = flyInstanced

Select the dragonfly and Display - Hide - Hide Selection

Resizing the dragonfly:

In the attribute for the Particles:
Add Dynamic Attribute - General

    New: Attribute Name: bugScaler
    Data Type: Vector
    Attribute Type: Array
    Add Initial State Attribute: ON


Make a Creation Expression for this new bugScaler attribute

    if (frame==1)
        $randSize = rand (0.4, 1.5);
        bugScaler = <<$randSize, $randSize, $randSize >>;


Open the Particle Instancer section of the Attribute Editor
General Options: Scale = bugScaler

Rewind till you like the sizes then :

Solvers - Initial State - Set for Selected

Comment out the code by putting a // in front of the lines

Apply some fields to the particles

Playblast the animation