Skip to content

Commit

Permalink
Add --play-animation switch to enable initial simulation playback f…
Browse files Browse the repository at this point in the history
…or demos
  • Loading branch information
tribal-tec committed Dec 14, 2018
1 parent 532ba84 commit 92ba08d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions brayns/parameters/AnimationParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,27 @@

namespace
{
const std::string PARAM_ANIMATION_FRAME = "animation-frame";
constexpr auto PARAM_ANIMATION_FRAME = "animation-frame";
constexpr auto PARAM_PLAY_ANIMATION = "play-animation";
}

namespace brayns
{
AnimationParameters::AnimationParameters()
: AbstractParameters("Animation")
{
_parameters.add_options()(PARAM_ANIMATION_FRAME.c_str(),
po::value<uint32_t>(),
"Scene animation frame [float]");
_parameters.add_options()(PARAM_ANIMATION_FRAME, po::value<uint32_t>(),
"Scene animation frame [uint]")(
PARAM_PLAY_ANIMATION, po::bool_switch()->default_value(false),
"Start animation playback");
}

void AnimationParameters::parse(const po::variables_map& vm)
{
if (vm.count(PARAM_ANIMATION_FRAME))
_current = vm[PARAM_ANIMATION_FRAME].as<uint32_t>();
if (vm[PARAM_PLAY_ANIMATION].as<bool>())
_delta = 1;
markModified();
}

Expand Down

0 comments on commit 92ba08d

Please sign in to comment.