the title is pretty straightforward. In my application I have one-time-run animation that I'd like without the gray frame around the image that comes with the Animate[] primitive. Is there an elegant way to do it, or is it possible at all?
I found out I can use an animator with AppearanceElements->None to manipulate a Dynamic variable to move the animation, but:
- The "hidden"
Animatorleaves a blank output line - I need to show different animations depending on user input (buttons), and I'm not able to restart the
Animatorwhen a different animation is selected
Currently this is the best result I have achieved (simplistic example):
step = 0;
cAnim[x_] := Graphics3D[Rotate[Cuboid[], x Degree, {0, 0, 1}]]
sqAnim[x_] := Graphics[Rotate[Rectangle[], x Degree]];
anim = Dynamic[cAnim[step]];
Animator[Dynamic[step], {0, 90}, AppearanceElements -> None,
AnimationRepetitions -> 1]
{ Button["CUBE", anim = Dynamic[cAnim[step]]],
Button["SQUARE", anim = Dynamic[sqAnim[step]]]}
Dynamic[anim]
This way I can change between the two animations, but the Animator just keeps running and doesn't restart on change (and of course I have no idea how to do it).
It's highly probable I'm just overlooking a simple solution (maybe not even involving Animate or Animator), but to the best of my efforts I couldn't find it.
Thanks in advance for any help.
Animatorhas this advantage that it can run completely FronEnd side (when used withDynamicModulevariables), the problem is that there is no api for it except of built-in animator buttons. Less efficient but a more flexible way would be to useScheduledTasks. – Kuba May 08 '17 at 20:48