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?
-
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.
-
I think
Action.wait(seconds)
is what you're looking for. Put it in anAction.sequence
between two other actions, and there will be a pause between the two animations. -
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.
-
Something like
A.sequence(some_animation, A.call(self.do_something), other_animation)
?
(with
A = Action
, as in most examples) -
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!
-
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.
-
@WTFruit It should be
A.call(self.method)
(note the missing parentheses afterself.method
). You need to pass the actual function/method object that should be called, not the result of calling the method. -
Huh okay! Very small detail that I would have missed but makes sense now. Thanks :)