Example #1
0
void TimelineWidget::animatedProcessorAdded(const AnimatedProcessor* processor) {

    AnimatedProcessor* proc = const_cast<AnimatedProcessor*>(processor);    // Maybe we should do this another way, but today we feel quick and dirty
    ProcessorTimelineWidget* processorTimelineWidget = new ProcessorTimelineWidget(processor->getProcessorName(), proc, timeBox_->width()+172, this);
    scrollAreaLayout_->addWidget(processorTimelineWidget);
    processorTimelineWidgets_.push_back(processorTimelineWidget);

    connect(processorTimelineWidget, SIGNAL(sceneRequest(QMatrix)), this, SIGNAL(sceneOrder(QMatrix)));
    connect(processorTimelineWidget, SIGNAL(scrollBarRequest(int)), this, SIGNAL(scrollBarOrder(int)));
    connect(processorTimelineWidget, SIGNAL(renderAt(float)), this, SLOT(renderAt(float)));
    connect(processorTimelineWidget, SIGNAL(keyframeAdded()), overviewTimeline_, SLOT(renderPreviews()));
    connect(overviewTimeline_, SIGNAL(barMovement(int)), processorTimelineWidget, SIGNAL(barMovement(int)));
    connect(this, SIGNAL(sceneOrder(QMatrix)), processorTimelineWidget, SIGNAL(sceneOrder(QMatrix)));
    connect(this, SIGNAL(scrollBarOrder(int)), processorTimelineWidget, SIGNAL(scrollBarOrder(int)));
    connect(this, SIGNAL(currentFrameChanged(int)), processorTimelineWidget, SIGNAL(currentFrameChanged(int)));
    connect(this, SIGNAL(recordSignal()), processorTimelineWidget, SLOT(showAnimatedPropertyTimelines()));
    connect(this, SIGNAL(showActiveTimelines()),  processorTimelineWidget, SLOT(showAnimatedPropertyTimelines()));

    connect(this, SIGNAL(resizeSignal(int)),processorTimelineWidget, SLOT(setFixedWidthSlot(int)));

    connect(this, SIGNAL(durationChanged(int)), processorTimelineWidget, SIGNAL(durationChanged(int)));
    connect(processorTimelineWidget, SIGNAL(viewResizeSignal(int)), this, SIGNAL(viewResizeSignal(int)));
    connect(processorTimelineWidget, SIGNAL(viewFrameChange(int)), overviewTimeline_, SIGNAL(currentFrameChanged(int)));

    // Disable canvas size for animation
    std::vector<PropertyTimeline*> vec = proc->getPropertyTimelines();
    std::vector<PropertyTimeline*>::iterator it = vec.begin();
    while (it != vec.end()) {
        if ((*it)->getPropertyName() == "Canvas Size" && dynamic_cast<TemplatePropertyTimeline<tgt::ivec2>*>(*it))
            (*it)->setActiveOnRendering(false);
        ++it;
    }
}
Example #2
0
TimelineWidget::TimelineWidget(Animation* animation, AnimationEditor* parent, NetworkEvaluator* networkEval)
        : QWidget(parent)
        , animation_(animation)
        , currentTime_(0)
        , changed_(false)
{
    // register as observer in the core
    animation_->addObserver(this);
    setMinimumWidth(550);

    mainLayout_ = new QVBoxLayout(this);
    QHBoxLayout* controlLayout = new QHBoxLayout();

    timeBox_ = new QGroupBox(tr("Time"), this);
    QHBoxLayout* timeLayout = new QHBoxLayout();
    timeBox_->setLayout(timeLayout);
    timeCounter_ = new QLabel(this);
    timeCounter_->setText("00:00");
    timeBox_->setFixedWidth(timeBox_->width());
    timeLayout->addWidget(timeCounter_);

    mainLayout_->addLayout(controlLayout);
    controlLayout->addWidget(timeBox_);
    controlLayout->addSpacerItem(new QSpacerItem(180,0));
    overviewTimeline_ = new OverviewWidget(this, networkEval);
    controlLayout->addWidget(overviewTimeline_);

    connect(this, SIGNAL(viewResizeSignal(int)), overviewTimeline_, SLOT(updateViewportRect(int)));
    connect(this, SIGNAL(autoPreview(bool)), overviewTimeline_, SLOT(autoPreview(bool)));
    connect(this, SIGNAL(durationChanged(int)), overviewTimeline_, SLOT(setDuration(int)));
    connect(overviewTimeline_, SIGNAL(currentFrameChanged(int)), this, SIGNAL(currentFrameChanged(int)));
    connect(overviewTimeline_, SIGNAL(recordAt(int)), this, SIGNAL(recordAt(int)));
    connect(parent, SIGNAL(currentFrameChanged(int)), overviewTimeline_, SLOT(setCurrentFrame(int)));
    connect(overviewTimeline_, SIGNAL(currentFrameChanged(int)), parent, SLOT(setCurrentFrame(int)));
    connect(this, SIGNAL(scrollBarOrder(int)), overviewTimeline_, SLOT(scrollBarOrder(int)));
    connect(this, SIGNAL(sceneOrder(QMatrix)), overviewTimeline_, SLOT(sceneOrder(QMatrix)));

    mainLayout_->setMargin(1);
    mainLayout_->setSpacing(1);
    mainLayout_->setAlignment(Qt::AlignTop);

    scrollArea_ = new QScrollArea();
    QWidget* container = new QWidget(scrollArea_);
    scrollArea_->setWidget(container);
    scrollAreaLayout_ = new QVBoxLayout(container);;
    scrollAreaLayout_->setSizeConstraint(QLayout::SetMinimumSize);
    mainLayout_->addWidget(scrollArea_);
    scrollArea_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    scrollArea_->setAlignment(Qt::AlignTop);

    populateProcessors();
}
//-------------------------------------------------------------------------
bool FKCW_SceneExMgr_SceneExTransition::initWithDuration(float t, FKCW_SceneExMgr_SceneEx *scene)
{
	CCAssert( scene != NULL, "Argument scene must be non-nil");

	if (FKCW_SceneExMgr_SceneEx::init())
	{
		m_fDuration = t;
		m_pInScene = scene;
		m_pInScene->retain();
		m_pOutScene = FKCW_SceneExMgr_SceneExMgr::sharedManager()->getRunningScene();
		if (m_pOutScene == NULL)
		{
			m_pOutScene = new FKCW_SceneExMgr_SceneEx();
			m_pOutScene->init();
		}
		m_pOutScene->retain();

		CCAssert( m_pInScene != m_pOutScene, "Incoming scene must be different from the outgoing scene" );

		sceneOrder();

		return true;
	}
	else
	{
		return false;
	}
}
bool TransitionScene::initWithDuration(float t, Scene *scene)
{
    CCASSERT( scene != nullptr, "Argument scene must be non-nil");

    if (Scene::init())
    {
        _duration = t;

        // retain
        _inScene = scene;
        _inScene->retain();
        _outScene = _director->getRunningScene();
        if (_outScene == nullptr)
        {
            _outScene = Scene::create();
        }
        _outScene->retain();

        CCASSERT( _inScene != _outScene, "Incoming scene must be different from the outgoing scene" );

        sceneOrder();

        return true;
    }
    else
    {
        return false;
    }
}
Example #5
0
bool CCTransitionScene::initWithDuration(float t, CAWindow *scene)
{
    CCAssert( scene != NULL, "Argument scene must be non-nil");

    if (CAWindow::init())
    {
        m_fDuration = t;

        // retain
        m_pInScene = scene;
        m_pInScene->retain();
        m_pOutScene = CCDirector::sharedDirector()->getRunningScene();
        if (m_pOutScene == NULL)
        {
            m_pOutScene = CAWindow::create();
            m_pOutScene->init();
        }
        m_pOutScene->retain();

        CCAssert( m_pInScene != m_pOutScene, "Incoming scene must be different from the outgoing scene" );
        
        sceneOrder();

        return true;
    }
    else
    {
        return false;
    }
}
Example #6
0
//------------------------------------------------------------------------------
bool QTransitionPageTurn::initWithDuration(float t, CCScene* scene, bool backwards)
{
    // XXX: needed before [super init]
    m_bBack = backwards;
   
    if (CCScene::init() && initScenes(scene, &m_pInScene, &m_pOutScene))
    {
        m_fDuration = t;        
        sceneOrder();
        return true;
    }
    return false;
}