lobal proc makeBlobby(string $shapeNode, float $pmb_size, float $pmb_jitter, float $pmb_max, float $pmb_gravity, int $fileid)
    {
    $result = `polyEvaluate -v $shapeNode`; 
    int $num = $result[0];
    
    fprint($fileid, "Blobby " + $num + " [\n");
    
    // Make each blob an ellipsoid and provide its array
    // index. The indices monotonously increment by 16.
    for($n = 0; $n < $num; $n++)
        fprint($fileid, "1001 " + ($n * 16) + "\n");
      
    // Add the blending code "0" and the number of blobs to blend.
    fprint($fileid, "0 " + $num);
      
    // Specify the indices of all the blobs.
    for($n = 0; $n < $num; $n++)
        fprint($fileid, " " + $n);
    fprint($fileid, "]\n");
    fprint($fileid, "[\n");
            
    // Specify the transformations of each blob
    string $row1, $row2, $row3;
    float $jitter_neg = -$pmb_jitter;
    for($n = 0; $n < $num; $n++) {
        float $ran_jitter = `rand $jitter_neg $pmb_jitter`;
        if ($ran_jitter < -$pmb_size) $ran_jitter = -$pmb_size;
        $ran_size = $pmb_size + $ran_jitter;
        float $ran_growth = (`currentTime -q` - 1) / `rand 0.001 $pmb_gravity` * $ran_size;    
        $ran_size += $ran_growth;
        if ($ran_size > $pmb_max) $ran_size -= $ran_size;
        string $vert = $shapeNode + ".vtx[" + $n + "]";
        $pos = `pointPosition -w $vert`;
        //$pos_ran0 = `rand -2 2`;
        $pos_ran1 = `rand 0.01 $ran_size`;
        //$pos_ran2 = `rand -2 2`;
        //$pos[0] += $ran_growth * $pos_ran0;
        $pos[1] += $ran_growth / $pos_ran1;
        //$pos[2] += $ran_growth * $pos_ran2;
        $row1 = $ran_size + " 0 0 0 ";
        $row2 = " 0 " + $ran_size + " 0 0 ";
        $row3 = " 0 0 " + $ran_size + " 0 ";
        $row4 = $pos[0] + " " + 
                $pos[1] + " " + 
                $pos[2] + " 1\n";
        fprint($fileid, $row1 + $row2 + $row3 + $row4);
        }
    fprint($fileid, "]\n");
    fprint($fileid, "[\"\"]\n");
    }