Skip to content

Commit 2688a9d

Browse files
committedJul 10, 2018
[3d] disable all edit ojects when playing animation
1 parent 64b91cc commit 2688a9d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed
 

‎src/app/3d/qgs3danimationwidget.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,19 @@ void Qgs3DAnimationWidget::setDefaultAnimation()
129129
setAnimation( animSettings );
130130
}
131131

132+
void Qgs3DAnimationWidget::setEditControlsEnabled( bool enabled )
133+
{
134+
cboKeyframe->setEnabled( enabled );
135+
btnAddKeyframe->setEnabled( enabled );
136+
cboInterpolation->setEnabled( enabled );
137+
}
138+
132139
void Qgs3DAnimationWidget::onPlayPause()
133140
{
134141
if ( mAnimationTimer->isActive() )
135142
{
136143
mAnimationTimer->stop();
137-
cboKeyframe->setEnabled( true );
144+
setEditControlsEnabled( true );
138145
}
139146
else
140147
{
@@ -143,8 +150,8 @@ void Qgs3DAnimationWidget::onPlayPause()
143150
sliderTime->setValue( 0 );
144151
}
145152

146-
cboKeyframe->setCurrentIndex( 0 ); // unset active keyframe
147-
cboKeyframe->setEnabled( false );
153+
cboKeyframe->setCurrentIndex( 0 ); // unset active keyframe
154+
setEditControlsEnabled( false );
148155
mAnimationTimer->start();
149156
}
150157
}

‎src/app/3d/qgs3danimationwidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class Qgs3DAnimationWidget : public QWidget, private Ui::Animation3DWidget
5555

5656
private:
5757
void initializeController( const Qgs3DAnimationSettings &animSettings );
58+
void setEditControlsEnabled( bool enabled );
5859
float askForKeyframeTime( float defaultTime, bool *ok );
5960
int findIndexForKeyframe( float time );
6061

0 commit comments

Comments
 (0)
Please sign in to comment.