Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created March 11, 2019 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/7966e8a9c70de78007deafee654beca2 to your computer and use it in GitHub Desktop.
Save zeffii/7966e8a9c70de78007deafee654beca2 to your computer and use it in GitHub Desktop.
@persistent
def sv_update_handler(scene):
"""
Update sverchok node groups on frame change events.
"""
if not has_frame_changed(scene):
return
for ng in sverchok_trees():
try:
# print('sv_update_handler')
ng.process_ani()
except Exception as e:
print('Failed to update:', str(e)) #name,
# something like this
if sverchok.settings.dont_loop_animation:
if scene.last_frame == scene.frame_current:
bpy.ops.screen.animation_cancel() # restore_frame=True)
return
scene.update()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment