0

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

KeepCool
  • 111
  • 2

1 Answers1

1

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.

KeepCool
  • 111
  • 2