Blender Kitsu: Add Frame Range Pop-up #128
@ -383,23 +383,10 @@ class KITSU_OT_pull_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]:
|
||||
active_shot = cache.shot_active_pull_update()
|
||||
|
||||
if "3d_start" not in active_shot.data:
|
||||
self.report(
|
||||
{"ERROR"},
|
||||
f"Failed to pull frame range. Shot {active_shot.name} missing '3d_start'.",
|
||||
)
|
||||
return {"CANCELLED"}
|
||||
|
||||
frame_in = int(active_shot.data["3d_start"])
|
||||
frame_out = int(active_shot.data["3d_start"]) + int(active_shot.nb_frames) - 1
|
||||
frame_in, frame_out = core.get_frame_range()
|
||||
|
||||
# Check if current frame range matches the one for active shot.
|
||||
if (
|
||||
frame_in == context.scene.frame_start
|
||||
and frame_out == context.scene.frame_end
|
||||
):
|
||||
if core.check_frame_range():
|
||||
self.report({"INFO"}, f"Frame range already up to date")
|
||||
return {"FINISHED"}
|
||||
|
||||
@ -407,9 +394,11 @@ class KITSU_OT_pull_frame_range(bpy.types.Operator):
|
||||
context.scene.frame_start = frame_in
|
||||
context.scene.frame_end = frame_out
|
||||
|
||||
# Update error prop.
|
||||
context.scene.kitsu_error.frame_range = False
|
||||
|
||||
if not core.check_frame_range():
|
||||
self.report(
|
||||
{"ERROR"}, f"Failed to update frame range to {frame_in} - {frame_out}"
|
||||
)
|
||||
return {"CANCELLED"}
|
||||
# Log.
|
||||
self.report({"INFO"}, f"Updated frame range {frame_in} - {frame_out}")
|
||||
return {"FINISHED"}
|
||||
|
Loading…
Reference in New Issue
Block a user