Search in sources :

Example 1 with Scheduler

use of artisynth.core.driver.Scheduler in project artisynth_core by artisynth.

the class Workspace method requestUpdateAction.

private void requestUpdateAction() {
    if (myRequestedUpdateAction == null) {
        myRequestedUpdateAction = new UpdateAction();
        Scheduler scheduler = myMain.getScheduler();
        if (scheduler.requestAction(myRequestedUpdateAction)) {
        // System.out.println ("$sched");
        } else {
            SwingUtilities.invokeLater(myRequestedUpdateAction);
        // System.out.println ("$swing");
        }
    }
}
Also used : Scheduler(artisynth.core.driver.Scheduler)

Example 2 with Scheduler

use of artisynth.core.driver.Scheduler in project artisynth_core by artisynth.

the class MovieMakerDialog method waypointCapture.

private void waypointCapture() {
    // disable play (otherwise destroys waypoints)
    boolean savedBegin = beginRecordOnStart.isEnabled();
    beginRecordOnStart.setEnabled(false);
    beginRecordOnStart.setSelected(false);
    // manual control of scheduler and rendering
    Scheduler scheduler = myMain.getScheduler();
    ViewerManager manager = myMain.getViewerManager();
    try {
        // reset to beginning
        scheduler.reset();
        manager.render();
        manager.paint();
        // starts recording
        startMovie();
        // we're manually doing this
        myMovieMaker.setGrabbing(false);
        myMovieMaker.resetFrameCounter();
        myMovieMaker.forceGrab();
        while (scheduler.fastForward()) {
            manager.render();
            manager.paint();
            myMovieMaker.forceGrab();
        }
        stopMovie();
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        System.err.println("Failed to create movie");
    }
    beginRecordOnStart.setEnabled(savedBegin);
    beginRecordOnStart.setSelected(savedBegin);
}
Also used : Scheduler(artisynth.core.driver.Scheduler) ViewerManager(artisynth.core.driver.ViewerManager) InternalErrorException(maspack.util.InternalErrorException)

Aggregations

Scheduler (artisynth.core.driver.Scheduler)2 ViewerManager (artisynth.core.driver.ViewerManager)1 InternalErrorException (maspack.util.InternalErrorException)1