From 537329cdd0ce34bde8acd838c78660fed15adbec Mon Sep 17 00:00:00 2001 From: "David J. Bremer" Date: Thu, 5 Dec 2024 18:41:17 -0500 Subject: [PATCH] Fix off by one error, for transient glb pushed from EnSight, without the ANSYS_scene_timevalue tag. --- src/ansys/pyensight/core/utils/omniverse_glb_server.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ansys/pyensight/core/utils/omniverse_glb_server.py b/src/ansys/pyensight/core/utils/omniverse_glb_server.py index f2b955c8d4d..22ac0ffff45 100644 --- a/src/ansys/pyensight/core/utils/omniverse_glb_server.py +++ b/src/ansys/pyensight/core/utils/omniverse_glb_server.py @@ -682,10 +682,13 @@ def _build_scene_timeline(self, scene_idx: int, input_timeline: List[float]) -> if timeline[1] - timeline[0] <= 0.0: timeline = [0.0, float(num_scenes - 1)] # carve time into the input timeline. - delta = (timeline[1] - timeline[0]) / float(num_scenes) + delta = (timeline[1] - timeline[0]) / float(num_scenes-1) output: List[float] = [] output.append(float(scene_idx) * delta + timeline[0]) - output.append(output[0] + delta) + if scene_idx < num_scenes-1: + output.append(output[0] + delta) + else: + output.append(output[0]) return output @staticmethod