Fix end_frame computation in osg_stats.py

If begin_frame is not the first frame then begin_frame + number of frames points
to a frame after end_frame with shift begin_frame - first_frame.
7220-lua-add-a-general-purpose-lexical-parser
elsid 2 years ago
parent d1c602ce85
commit 2a660be8a2
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -123,7 +123,7 @@ def collect_per_frame(sources, keys, begin_frame, end_frame, frame_number_name):
assert begin_frame < end_frame assert begin_frame < end_frame
result = collections.defaultdict(lambda: collections.defaultdict(list)) result = collections.defaultdict(lambda: collections.defaultdict(list))
begin_frame = max(begin_frame, min(v[0][frame_number_name] for v in sources.values())) begin_frame = max(begin_frame, min(v[0][frame_number_name] for v in sources.values()))
end_frame = min(end_frame, begin_frame + max(len(v) for v in sources.values())) end_frame = min(end_frame, max(v[-1][frame_number_name] for v in sources.values()) + 1)
for name in sources.keys(): for name in sources.keys():
for key in keys: for key in keys:
result[name][key] = [0] * (end_frame - begin_frame) result[name][key] = [0] * (end_frame - begin_frame)

Loading…
Cancel
Save