omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Is there a way to check whether an animation has ended?

    Pythonista
    2
    8
    4361
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • WTFruit
      WTFruit last edited by WTFruit

      I'm back, and I've moved on fairly quickly. It's an animation question now! I've been scouring the scene module documentation, and every example/tutorial I can find, but I can't figure this one out:

      I want to perform an action on a node, call a method to do some stuff, then perform another action, in that order. But since actions don't wait until other actions are finished before beginning, all three things are happening at the same time.

      Again, I've been scouring the documentation and I tried creating my own little solution as well but I can't seem to work something out!

      EDIT: I'd like to point out that I got the hang of the basics of action sequences, that's not the issue. It's the fact that in between the two actions, I want to call a non-action method.

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        I think Action.wait(seconds) is what you're looking for. Put it in an Action.sequence between two other actions, and there will be a pause between the two animations.

        WTFruit 1 Reply Last reply Reply Quote 0
        • WTFruit
          WTFruit @omz last edited by WTFruit

          @omz

          Thanks, but I don't need a pause between them. I need to call a non-action method! That's what I can't figure out.

          I tried putting in a check of the status (in this case to see if the rotation animation has reached its goal) but that won't work unless it's in the draw method of the scene since It will only be checked once. Using scene.draw() as a catch-all place to do checks like that seems... not ideal.

          1 Reply Last reply Reply Quote 0
          • omz
            omz last edited by

            Something like

            A.sequence(some_animation, A.call(self.do_something), other_animation)
            

            ?

            (with A = Action, as in most examples)

            WTFruit 1 Reply Last reply Reply Quote 0
            • WTFruit
              WTFruit @omz last edited by

              @omz

              Hmm. I did try that and had gotten an error, but if you think it should work I'll try it a bit more :). Thanks!

              1 Reply Last reply Reply Quote 0
              • WTFruit
                WTFruit last edited by

                @omz

                I can't get A.call() working :/ I get the error "Object is not callable". The offending line is:

                A.call(self.method())
                

                Where A = scene.Action.

                1 Reply Last reply Reply Quote 0
                • omz
                  omz last edited by

                  @WTFruit It should be A.call(self.method) (note the missing parentheses after self.method). You need to pass the actual function/method object that should be called, not the result of calling the method.

                  WTFruit 1 Reply Last reply Reply Quote 0
                  • WTFruit
                    WTFruit @omz last edited by

                    @omz

                    Huh okay! Very small detail that I would have missed but makes sense now. Thanks :)

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Powered by NodeBB Forums | Contributors