Skip to content

Commit

Permalink
[Playback] Fix WriteStateCreator to pass period only if it has a valu…
Browse files Browse the repository at this point in the history
…e. Because WriteState use isSet value... (#4919)

* [Playback] Fix WriteStateCreator to pass period only if it has a value. Because WriteState use isSet value...

* Update Sofa/Component/Playback/src/sofa/component/playback/WriteState.cpp

Co-authored-by: Frederick Roy <[email protected]>

---------

Co-authored-by: Frederick Roy <[email protected]>
  • Loading branch information
epernod and fredroy authored Aug 19, 2024
1 parent 1c1c360 commit a060e91
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ void WriteStateCreator::addWriteState(sofa::core::behavior::BaseMechanicalState
if (!m_times.empty())
ws->d_time.setValue(m_times);

ws->d_period.setValue(m_period);
if (m_period > 0.0)
{
ws->d_period.setValue(m_period);
}

ws->init();
ws->f_listening.setValue(true); //Activated at init
Expand Down

0 comments on commit a060e91

Please sign in to comment.