Skip to content

Commit

Permalink
Fix 'paste animation frame' without selecting an animation
Browse files Browse the repository at this point in the history
m_currentAnim was not initiailized until an animation name was selected
in the animation list. If it was invalid, copy/paste animation frame
would have no affect.

Animation mode doesn't require selecting an animation. Now m_currentAnim
defaults to the correct animation.
  • Loading branch information
zturtleman committed Jul 20, 2024
1 parent 7bf246d commit 4f94175
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/implui/animwidget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,22 @@ void AnimWidget::initialize( Model * model, bool isUndo )
}
else
{
m_currentAnim = 0;
m_currentFrame = 0;
m_mode = Model::ANIMMODE_SKELETAL;

if ( m_skelAnimCount > 0 )
{
m_model->setCurrentAnimation( m_mode, indexToAnim( m_animName->currentIndex() ) );
m_currentAnim = indexToAnim( m_animName->currentIndex() );
m_model->setCurrentAnimation( m_mode, m_currentAnim );
}
else if ( m_frameAnimCount > 0 )
{
m_mode = Model::ANIMMODE_FRAME;
m_model->setCurrentAnimation( m_mode, indexToAnim( m_animName->currentIndex() ) );
m_currentAnim = indexToAnim( m_animName->currentIndex() );
m_model->setCurrentAnimation( m_mode, m_currentAnim );
}
m_model->setCurrentAnimationFrame( 0 );
m_model->setCurrentAnimationFrame( m_currentFrame );

refreshPage();

Expand Down

0 comments on commit 4f94175

Please sign in to comment.