Created
March 14, 2015 06:07
-
-
Save adhihargo/5c973ec1b5ab2e387646 to your computer and use it in GitHub Desktop.
Tiny addon to show minimal amount of steps needed to make non-looping animation playback in Blender.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
from bpy.app.handlers import persistent | |
bl_info = { | |
"name": "Playback Once", | |
"author": "Adhi Hargo", | |
"version": (1, 0, 0), | |
"blender": (2, 67, 3), | |
"location": "", | |
"description": "Playback once.", | |
"warning": "", | |
"wiki_url": "", | |
"tracker_url": "", | |
"category": "Animation"} | |
@persistent | |
def stopPlaybackAtEnd(scene): | |
if scene.frame_current >= scene.frame_end: | |
bpy.ops.screen.animation_cancel() | |
def register(): | |
bpy.app.handlers.frame_change_pre.append(stopPlaybackAtEnd) | |
def unregister(): | |
bpy.app.handlers.frame_change_pre.remove(stopPlaybackAtEnd) | |
if __name__ == "__main__": | |
register() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment