From 3cdc2c8e94d1f7dda4dd521d3880079b4971fcac Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn <40325124+DoobesURU@users.noreply.github.com> Date: Mon, 14 Sep 2020 10:31:19 -0400 Subject: [PATCH] Fix Rail Camera keyframe issue Keeps Korman from exporting a rail camera with only one keyframe (or duplicate location keyframes), which causes the client to crash. --- korman/exporter/camera.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/korman/exporter/camera.py b/korman/exporter/camera.py index 164f302..4c5b8e3 100644 --- a/korman/exporter/camera.py +++ b/korman/exporter/camera.py @@ -206,6 +206,9 @@ class CameraConverter: f1, f2 = fcurve.evaluate(begin), fcurve.evaluate(end) if abs(f1 - f2) > 0.001: break + # to avoid single/duplicate keyframe client crash (per Hoikas) + if any((len(i.keys) == 1 for i in (pos_ctrl.X, pos_ctrl.Y, pos_ctrl.Z) if i is not None)): + raise ExportError("'{}': Rail Camera must have more than one keyframe", bo.name) else: # The animation is a loop path.flags |= plAnimPath.kWrap