0
$\begingroup$

When I run bpy.ops.screen.animation_play() directly from the script ("Run script" button), it plays the timeline and works fine. But if I try to run it from Animation Nodes, it gives me an error:

"Operator bpy.ops.screen.animation_play.poll() failed. Context is incorrect."

All I have in AN is a script node with an "integer" input (for "1" or "0" -> play or stop), then I connect an integer node to the subprogram of the script.

Here's my simple test script

# animStatus = 1    # only used when testing script alone

if animStatus == 1:
    bpy.ops.screen.animation_play()    
elif animStatus == 0:
    bpy.ops.screen.animation_cancel(restore_frame=False)

enter image description here

$\endgroup$
4
  • 3
    $\begingroup$ Possible duplicate of poll() failed, context incorrect? - Example: bpy.ops.view3d.background_image_add() $\endgroup$
    – Omar Emara
    Commented Apr 5, 2019 at 18:10
  • $\begingroup$ Thanks, I had already looked at that thread, but it does not resolve my question/problem. $\endgroup$
    – KeepCool
    Commented Apr 8, 2019 at 18:46
  • $\begingroup$ You should edit your question to show that. What have you tried? Why didn't the other answer help you? $\endgroup$
    – Omar Emara
    Commented Apr 8, 2019 at 18:53
  • $\begingroup$ Thank you. I actually just received a reply from Jacques himself, and he did confirm that what I am trying to do is not really officially possible with Animation Nodes, unfortunately. I will mark this as my answer. $\endgroup$
    – KeepCool
    Commented Apr 8, 2019 at 20:51

1 Answer 1

1
$\begingroup$

Not really solved, but have received confirmation from Jacques Lucke that what I am trying to do (start/stop timeline with AN) is not something that AN was designed for, and is not recommended.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .