refactor and fixes for episode handling gav
This commit is contained in:
@@ -64,6 +64,18 @@ def load_trackers():
|
||||
print(e)
|
||||
|
||||
|
||||
def _load_settings_after_startup():
|
||||
"""Apply the config once Blender has a normal context available."""
|
||||
if not getattr(bpy.context, 'scene', None):
|
||||
return 0.5
|
||||
|
||||
try:
|
||||
bpy.ops.vse_toolbox.load_settings()
|
||||
except RuntimeError as e:
|
||||
print(f'Could not load VSE Toolbox settings at startup: {e}')
|
||||
return None
|
||||
|
||||
|
||||
def load_prefs():
|
||||
prefs = get_addon_prefs()
|
||||
prefs_config_file = prefs.config_path
|
||||
@@ -97,6 +109,11 @@ def load_prefs():
|
||||
except AttributeError:
|
||||
pass # Scene not available yet during register()
|
||||
|
||||
# Loading preferences only sets the config path and tracker credentials;
|
||||
# apply the project configuration once Blender has finished registering
|
||||
# and provides a normal context (register() uses _RestrictContext).
|
||||
bpy.app.timers.register(_load_settings_after_startup, first_interval=0.1)
|
||||
|
||||
|
||||
class Trackers(PropertyGroup):
|
||||
def __iter__(self):
|
||||
|
||||
Reference in New Issue
Block a user