We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Stop *all* parameter animations in scene at once

Home Forums Puzzles Stop *all* parameter animations in scene at once

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #59163
    rollos5son
    Participant

    Good evening from the USA!

    I have a scene set up where clicking either of two buttons will trigger a different parametric animation of a group of shapes; to animate the individual objects, I pass them to an animation procedure (see screenshot) via loop, assigning each its own start and stop positions.

    I’d like to have all animations stop and reset if a button is clicked while they are still running.

    How would I do this? Or is there a better approach? I can’t figure this out.

    Attachments:
    You must be logged in to view attached files.
    #59167
    xeon
    Customer

    Hello back from the USA – SoCal – Happy Holidays.
    There are several methods of animation and you have selected one method that is based on the animate parameter. Without knowing the reasoning behind this decision I could not say whether its the best way or not or what way I would recommend.

    However, a simple way to create a reset is to create a reset “flag”.
    See attached image. I have created an event that would be linked to your reset object.

    Since your animation parameter is only .25 seconds…one might consider just doing a test on the flag at the end of the animation so that the reset ends gracefully but I don’t know your needs so this is an option.

    Note, parametric animating is pretty great but can really eat up processing if not managed and can really start to slow things down if the list of items being animated is large.

    If you would like to discuss…let me know. Xeon@r66d.com.

    Attachments:
    You must be logged in to view attached files.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #59170
    kdv
    Participant

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #59189
    rollos5son
    Participant

    Thanks all for the tips!


    @kdv77kdv
    – I tried something similar but missed putting the animation code under a “do” statement, thanks for pointing that out.

    I also ran into an issue with clearing the param animations after stopping (could this be an added feature?), so I’m going to roll with NLA instead (which was a bit more tedious to set up but not as bad as I’d expected).

    #59195
    kdv
    Participant

    I also ran into an issue with clearing the param animations after stopping

    And what exactly are you clearing??? It’s not enough just to stop them?

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #59196
    rollos5son
    Participant

    @kdv77kdv – maybe I missed something with my setup, but what happens is when I ‘restart’ the animations through my procedure they resume at the points they would have been if they had still been running, instead of from my defined start points. To me, it looks as if the process driving the animations is still running in the background even when the animation itself is stopped. Definitely would like to know the cause and resolution, if it exists, of that behavior.

    #59202
    kdv
    Participant

    just kill them all

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #59204
    rollos5son
    Participant

    @kdv77kdv

    The NLAs are showing the same behavior, so it looks like it’s the loops I need to kill (my old-school linear brain never can get used to the behavior of object-based code). I tried the break puzzle but that seemed to only go buggy and not stop the loops. Hopefully just me not applying it correctly.

    PS Thanks for the code snippet, may still be able to use at some point.

    #59205
    rollos5son
    Participant

    ‘Cliff Notes’ version of the below: Timer puzzle code can be used as a loop with a ‘kill switch’!

    Finally making some progress here – I found this bit about Timer puzzles and it seems to provide the behavior I require; kill the timer and I also kill any processes it’s driving! Leaving here in case someone has the same issue.

    [Edit: Yes, this did the trick! I just use the timer as my loop! Definitely is working for me, at least at this stage of my project. Thanks again! :good: ]

    How to stop a procedure?

    #59209
    kdv
    Participant

    Wrong usage can lead to the wrong behavior ))) There is no need to clear smth after animations have been stoped via the stop animate param puzzle. When restarted they start from the very begining.

    https://v3d.net/a3r
    a double click toggles animations state

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.