Blender Kitsu: Add Frame Range Pop-up #128
@ -282,7 +282,7 @@ def get_frame_range(): # TODO return type
|
||||
return frame_in, frame_out
|
||||
|
||||
|
||||
def check_frame_range() -> bool:
|
||||
def check_frame_range(context) -> bool:
|
||||
"""
|
||||
Compare the current scene's frame range with that of the active shot on kitsu.
|
||||
If there's a mismatch, set kitsu_error.frame_range -> True. This will enable
|
||||
|
@ -394,7 +394,7 @@ class KITSU_OT_pull_frame_range(bpy.types.Operator):
|
||||
frame_in, frame_out = core.get_frame_range()
|
||||
|
||||
# Check if current frame range matches the one for active shot.
|
||||
if core.check_frame_range():
|
||||
if core.check_frame_range(context):
|
||||
self.report({"INFO"}, f"Frame range already up to date")
|
||||
return {"FINISHED"}
|
||||
|
||||
@ -402,7 +402,7 @@ class KITSU_OT_pull_frame_range(bpy.types.Operator):
|
||||
context.scene.frame_start = frame_in
|
||||
context.scene.frame_end = frame_out
|
||||
|
||||
if not core.check_frame_range():
|
||||
if not core.check_frame_range(context):
|
||||
self.report(
|
||||
{"ERROR"}, f"Failed to update frame range to {frame_in} - {frame_out}"
|
||||
)
|
||||
@ -425,7 +425,7 @@ class KITSU_OT_check_frame_range(bpy.types.Operator):
|
||||
return bool(prefs.session_auth(context) and cache.shot_active_get())
|
||||
|
||||
def execute(self, context: bpy.types.Context) -> Set[str]:
|
||||
if core.check_frame_range():
|
||||
if core.check_frame_range(context):
|
||||
self.report({"INFO"}, f"Frame Range is accurate")
|
||||
return {"FINISHED"}
|
||||
self.report({"ERROR"}, f"Failed: Frame Range Check")
|
||||
@ -482,7 +482,7 @@ def draw_frame_range_warning(self, context):
|
||||
|
||||
@persistent
|
||||
def load_post_handler_check_frame_range(dummy: Any) -> None:
|
||||
if not core.check_frame_range():
|
||||
if not core.check_frame_range(bpy.context):
|
||||
bpy.context.window_manager.popup_menu(
|
||||
draw_frame_range_warning,
|
||||
title="Warning: Frame Range Error.",
|
||||
|
Loading…
Reference in New Issue
Block a user