Cleanup: avoid using context in versioning code
Also extract versioning into a function that makes it's purpose clear.
This commit is contained in:
@@ -20,10 +20,8 @@ import bpy
|
||||
from bpy.app.handlers import persistent
|
||||
|
||||
|
||||
@persistent
|
||||
def load_handler(_):
|
||||
from bpy import context
|
||||
screen = context.screen
|
||||
def do_version_file_browser():
|
||||
screen = bpy.data.screens["Video Editing"]
|
||||
for area in screen.areas:
|
||||
if area.type == 'FILE_BROWSER':
|
||||
space = area.spaces.active
|
||||
@@ -31,6 +29,11 @@ def load_handler(_):
|
||||
params.use_filter_folder = True
|
||||
|
||||
|
||||
@persistent
|
||||
def load_handler(_):
|
||||
do_version_file_browser()
|
||||
|
||||
|
||||
def register():
|
||||
bpy.app.handlers.load_factory_startup_post.append(load_handler)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user