Skip to content
Permalink
Browse files

[3d] disable all edit ojects when playing animation

  • Loading branch information
nirvn committed Jul 10, 2018
1 parent 64b91cc commit 2688a9d781aed2c1c834d3b51a4e867883770607
Showing with 11 additions and 3 deletions.
  1. +10 −3 src/app/3d/qgs3danimationwidget.cpp
  2. +1 −0 src/app/3d/qgs3danimationwidget.h
@@ -129,12 +129,19 @@ void Qgs3DAnimationWidget::setDefaultAnimation()
setAnimation( animSettings );
}

void Qgs3DAnimationWidget::setEditControlsEnabled( bool enabled )
{
cboKeyframe->setEnabled( enabled );
btnAddKeyframe->setEnabled( enabled );
cboInterpolation->setEnabled( enabled );
}

void Qgs3DAnimationWidget::onPlayPause()
{
if ( mAnimationTimer->isActive() )
{
mAnimationTimer->stop();
cboKeyframe->setEnabled( true );
setEditControlsEnabled( true );
}
else
{
@@ -143,8 +150,8 @@ void Qgs3DAnimationWidget::onPlayPause()
sliderTime->setValue( 0 );
}

cboKeyframe->setCurrentIndex( 0 ); // unset active keyframe
cboKeyframe->setEnabled( false );
cboKeyframe->setCurrentIndex( 0 ); // unset active keyframe
setEditControlsEnabled( false );
mAnimationTimer->start();
}
}
@@ -55,6 +55,7 @@ class Qgs3DAnimationWidget : public QWidget, private Ui::Animation3DWidget

private:
void initializeController( const Qgs3DAnimationSettings &animSettings );
void setEditControlsEnabled( bool enabled );
float askForKeyframeTime( float defaultTime, bool *ok );
int findIndexForKeyframe( float time );

0 comments on commit 2688a9d

Please sign in to comment.
You can’t perform that action at this time.