# Exporting processing sketch issue

**URL:** <https://discourse.processing.org/t/exporting-processing-sketch-issue/2842>\
**Category:** Coding Questions\
**Created:** [August 22, 2018, 9:50am UTC](https://discourse.processing.org/t/exporting-processing-sketch-issue/2842 "2018-08-22T09:50:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![12345](https://avatars.discourse-cdn.com/v4/letter/1/ec9cab/32.png) [@12345](https://discourse.processing.org/u/12345)\
**Post date:** [August 22, 2018, 9:50am UTC](https://discourse.processing.org/t/exporting-processing-sketch-issue/2842/1 "2018-08-22T09:50:19Z")

</div>

Hi, I’m trying to export my sketch as frame images in order to make a movie. However, when I do, only the background of my sketch comes up. Have I missed something? I’ve used saveFrame in line 73.

```auto
timport ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;

import processing.serial.*;
import geomerative.*;

Minim minim;
AudioPlayer player;
AudioInput input;

RShape grp;
RPoint[][] pointPaths;

float z = 50;

String inString; // Input string from serial port
String val; // Data received from the serial port
int lf = 10;
Serial myPort;

int sensitivity=250;

boolean ignoringStyles = false;

void setup() 
{   

  
    //fullScreen();
    print (Serial.list());
    size(600, 600, P3D);

      minim = new Minim(this);
      player = minim.loadFile("WIND ONE.mp3");
      input = minim.getLineIn();
        player.play();
    // I know that the first port in the serial list on my mac
    // is always my FTDI adaptor, so I open Serial.list()[0].
    // On Windows machines, this generally opens COM1.
    // Open whatever port is the one you're using.
    String portName = Serial.list()[1];
    myPort = new Serial(this, portName, 9600);
    myPort.bufferUntil(lf);
    
      RG.init(this);
      RG.ignoreStyles(ignoringStyles);
  
      RG.setPolygonizer(RG.ADAPTATIVE);
    
    grp = RG.loadShape("A1.svg");
    grp.centerIn(g, 100, 1, 1);
    
    pointPaths = grp.getPointsInPaths();
  
}

void draw()
{
  //z = 10 * sin( frameCount/50.0 * PI);
  
  print(inString);
      background(206, 204, 204);
       loadShape("A1.svg").disableStyle(); // Ignore the colors in the SVG
  fill(3, 3, 3); // Set the SVG fill to blue
  stroke(3, 3, 3);
  
 
  saveFrame("A_####.jpg") ;

       for(int i = 0; i < player.bufferSize() - 1; i++)
    {
      inString=str(sensitivity*(player.left.get(i)));
    }
      float Random_var=(float(inString)/400)*50;
      translate(300,300,z);
      for(int i = 0; i<pointPaths.length; i++){
    
    translate((random((Random_var))),(random((Random_var))),z);

    if (pointPaths[i] != null) {
      beginShape();
     for(int j = 0; j<pointPaths[i].length; j++){
        vertex(pointPaths[i][j].x, pointPaths[i][j].y);
      }
      endShape();
    }
  }
      
    
  }
  
  void serialEvent(Serial p) { 
  inString = p.readString(); 
}type or paste code here

```

---

<div class="post-metadata">

**Author:** ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)\
**Post date:** [August 22, 2018, 10:01am UTC](https://discourse.processing.org/t/exporting-processing-sketch-issue/2842/2 "2018-08-22T10:01:15Z")

</div>

Traditionally, one would put a call to `saveFrame()` at the end of `draw()`, not in the middle of it. You can’t save an image of things you haven’t drawn yet!

---

<div class="post-metadata">

**Author:** ![12345](https://avatars.discourse-cdn.com/v4/letter/1/ec9cab/32.png) [@12345](https://discourse.processing.org/u/12345)\
**Post date:** [August 22, 2018, 10:24am UTC](https://discourse.processing.org/t/exporting-processing-sketch-issue/2842/3 "2018-08-22T10:24:31Z")

</div>

Thankyou! Just realised my error

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [August 22, 2018, 1:29pm UTC](https://discourse.processing.org/t/exporting-processing-sketch-issue/2842/4 "2018-08-22T13:29:00Z")

</div>

You can also use the VideoExport library available in the Contribution manager. Check the examples as it is straight forward to use.

Kf
