Made the add-on not immediately crash on Blender 2.8
This commit is contained in:
parent
59e6491110
commit
2fce27f8cb
@ -5,6 +5,7 @@
|
||||
- Replace BAM with BAT🦇.
|
||||
- Don't crash the texture browser when an invalid texture is seen.
|
||||
- Support colour strips as Attract shots.
|
||||
- Blender 2.8 support (work in progress).
|
||||
|
||||
|
||||
## Version 1.8 (2018-01-03)
|
||||
|
@ -931,7 +931,10 @@ def activate():
|
||||
|
||||
log.info('Activating Attract')
|
||||
attract_is_active = True
|
||||
bpy.app.handlers.scene_update_post.append(scene_update_post_handler)
|
||||
|
||||
# TODO: properly fix 2.8 compatibility; this is just a workaround.
|
||||
if hasattr(bpy.app.handlers, 'scene_update_post'):
|
||||
bpy.app.handlers.scene_update_post.append(scene_update_post_handler)
|
||||
draw.callback_enable()
|
||||
|
||||
|
||||
@ -942,11 +945,13 @@ def deactivate():
|
||||
attract_is_active = False
|
||||
draw.callback_disable()
|
||||
|
||||
try:
|
||||
bpy.app.handlers.scene_update_post.remove(scene_update_post_handler)
|
||||
except ValueError:
|
||||
# This is thrown when scene_update_post_handler does not exist in the handler list.
|
||||
pass
|
||||
# TODO: properly fix 2.8 compatibility; this is just a workaround.
|
||||
if hasattr(bpy.app.handlers, 'scene_update_post'):
|
||||
try:
|
||||
bpy.app.handlers.scene_update_post.remove(scene_update_post_handler)
|
||||
except ValueError:
|
||||
# This is thrown when scene_update_post_handler does not exist in the handler list.
|
||||
pass
|
||||
|
||||
|
||||
def register():
|
||||
|
Reference in New Issue
Block a user