src/main/java/com/tajnyprojekt/tpanimation/TpAnimation.java
private void updateRendering() {
        // save sketch's frame
        parent.save(String.format(getOutputPathPattern(), outputIndexOffset + renderedFrames));

        // update progress
        renderedFrames++;
        if (isForwardPlayback) {
            currentFrame++;
        }
        else {
            currentFrame--;
        }

        if (isForwardPlayback && currentFrame == numberOfFrames - 1
                || !isForwardPlayback && currentFrame == 0) { // end of loop
            loopCount++;
            loopEndCallback();
            if (isMirroring) {
                isForwardPlayback = !isForwardPlayback;
            }
            else {
                if (isForwardPlayback) {
                    currentFrame = 0;
                }
                else {
                    currentFrame = numberOfFrames - 1;
                }
            }
        }


        progress = PApplet.map(currentFrame, 0, numberOfFrames - 1, 0.0f, 1.0f);
        log(String.format("rendering %d",
                PApplet.floor(100 * renderedFrames / (float) totalNumberFrames)) + "%");

        // check if finished
        if (renderedFrames >= totalNumberFrames) {
            log("rendered " + renderedFrames + " frames\nrendering done.");
            finish();
            if (exitOnRenderFinish) {
                parent.exit();
            }
        }
    }
/**
     * Updates the state and progress of playback when <b>rendering</b> frames based on frame counting.
     */
Updates the state and progress of playback when rendering frames based on frame counting.
Updates the state and progress of playback when rendering frames based on frame counting .
private void updateRendering() {
        parent.save(String.format(getOutputPathPattern(), outputIndexOffset + renderedFrames));
        renderedFrames++;
        if (isForwardPlayback) {
            currentFrame++;
        }
        else {
            currentFrame--;
        }
        if (isForwardPlayback && currentFrame == numberOfFrames - 1
                || !isForwardPlayback && currentFrame == 0) { 
            loopCount++;
            loopEndCallback();
            if (isMirroring) {
                isForwardPlayback = !isForwardPlayback;
            }
            else {
                if (isForwardPlayback) {
                    currentFrame = 0;
                }
                else {
                    currentFrame = numberOfFrames - 1;
                }
            }
        }
        progress = PApplet.map(currentFrame, 0, numberOfFrames - 1, 0.0f, 1.0f);
        log(String.format("rendering %d",
                PApplet.floor(100 * renderedFrames / (float) totalNumberFrames)) + "%");
        if (renderedFrames >= totalNumberFrames) {
            log("rendered " + renderedFrames + " frames\nrendering done.");
            finish();
            if (exitOnRenderFinish) {
                parent.exit();
            }
        }
    }
private void updateRendering ( ) { parent . save ( String . format ( getOutputPathPattern ( ) , outputIndexOffset + renderedFrames ) ) ; renderedFrames ++ ; if ( isForwardPlayback ) { currentFrame ++ ; } else { currentFrame -- ; } if ( isForwardPlayback && currentFrame == numberOfFrames - 1 || ! isForwardPlayback && currentFrame == 0 ) { loopCount ++ ; loopEndCallback ( ) ; if ( isMirroring ) { isForwardPlayback = ! isForwardPlayback ; } else { if ( isForwardPlayback ) { currentFrame = 0 ; } else { currentFrame = numberOfFrames - 1 ; } } } progress = PApplet . map ( currentFrame , 0 , numberOfFrames - 1 , 0.0f , 1.0f ) ; log ( String . format ( "rendering %d" , PApplet . floor ( 100 * renderedFrames / ( float ) totalNumberFrames ) ) + "%" ) ; if ( renderedFrames >= totalNumberFrames ) { log ( "rendered " + renderedFrames + " frames\nrendering done." ) ; finish ( ) ; if ( exitOnRenderFinish ) { parent . exit ( ) ; } } }
Updates the state and progress of playback when <b>rendering</b> frames based on frame counting.
Updates the state and progress of playback when <b > rendering< / b > frames based on frame counting .
// save sketch's frame // update progress // end of loop // check if finished