Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[3d] disable all edit ojects when playing animation
  • Loading branch information
nirvn committed Jul 10, 2018
1 parent 64b91cc commit 2688a9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/app/3d/qgs3danimationwidget.cpp
Expand Up @@ -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
{
Expand All @@ -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();
}
}
Expand Down
1 change: 1 addition & 0 deletions src/app/3d/qgs3danimationwidget.h
Expand Up @@ -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 );

Expand Down

0 comments on commit 2688a9d

Please sign in to comment.