Code in blue is to be added to each specific file.


modelerui.h

#include "camera.h"

...

class ModelerUI {
public:
    ...
     
    // this is just a quick fix. a lot of code should've been reused/shared with
    // the existing script loading function
    void autoLoadNPlay() {
        if (m_pwndGraphWidget->loadScript("animator.ani")) {
            endTime(m_pwndGraphWidget->endTime());
            activeCurvesChanged();
            // load the camera keyframes
            m_pwndModelerView->m_curve_camera->loadKeyframes("animator.ani.cam");
            // sychronize the indicator window with the loaded keyframes
            m_pwndIndicatorWnd->clearIndicators();
            for (int ikf = 0; ikf < m_pwndModelerView->m_curve_camera->numKeyframes(); ++ikf)
                m_pwndIndicatorWnd->addIndicator(m_pwndModelerView->m_curve_camera->keyframeTime(ikf));

            simulate(true);
            animate(true);
        }
    }

    ...
};

modelerapp.cpp

int ModelerApplication::Run()
{
    if (m_numControls == -1)
    {
        fprintf(stderr, "ERROR: ModelerApplication must be initialized before Run()!\n");
        return -1;
    }

    // Just tell FLTK to go for it.
    Fl::visual( FL_RGB | FL_DOUBLE );
    m_ui->show();
    Fl::add_timeout(0, ModelerApplication::RedrawLoop, NULL);

    m_ui->autoLoadNPlay();

    return Fl::run();
}