Processing at Eclipse Run A Sketch More Than Once

Hi all,

I'm using Processing via Eclipse for parametric modeling purposes with multiple classes. I only want to hit Run button once in Eclipse, but want my code to run multiple times through an iteration. In order to do that I created a main class in Eclipse that calls the real main class of my Processing code. The main method of this main class is below:

static public void main(String[] passedArgs) {

    for(int i=0; i<3; i++) {
        PApplet.main(new String[] {"ffg7.Perry" });
        coeffVariationUp[i] = (float) (1 - i*0.01);
        coeffVariationDown[i] = (float) (1 + i*0.01);
        aa = coeffVariationUp[i];
        bb = coeffVariationDown[i];
        mS = m + (i+1) + ".3dm";
        fS = f + (i+1) + ".txt";

        Perry Igniter = new Perry();
        Igniter.setup();            
    }

}

Here Perry class is the actual main class of my processing code, and the setup() method is the "void setup(){ } function of Processing. My code completes all the work inside this setup() method, and never calls the draw() method.

With the main method shown above, my code runs successfully for the first iteration and gives me all the output data that I need. But it stops there and the second iteration never starts.

I'm thinking about this for a while now and couldn't figure out the reason. Any help would be appreciated. Thanks, Mert

Sign In or Register to comment.