From c9a51347121b5f4f61058e820cccb7de3f0a879e Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 7 Aug 2025 15:38:16 +0200 Subject: [PATCH] [fix] missing support in IVAS_rend for trajectory and render_config --- ivas_processing_scripts/processing/chains.py | 15 ++++++++++++ ivas_processing_scripts/processing/ivas.py | 24 ++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/ivas_processing_scripts/processing/chains.py b/ivas_processing_scripts/processing/chains.py index aeaaa11f..2ecac3da 100755 --- a/ivas_processing_scripts/processing/chains.py +++ b/ivas_processing_scripts/processing/chains.py @@ -482,6 +482,16 @@ def get_processing_chain( # add optional IVAS_rend rendering step after each condition if cond_cfg.get("ivas_rend"): rend_cfg = cond_cfg["ivas_rend"] + + # check if trajectory is a path or boolean, boolean will trigger a search in the input dir + trajectory, trajectory_dir = get_trajectory_or_dir( + rend_cfg.get("trajectory"), cfg.input_path + ) + + # check if render config search is enabled + render_config = rend_cfg.get("render_config") + render_config_dir = cfg.input_path if render_config else None + chain["processes"].append( IVAS_rend( { @@ -490,6 +500,11 @@ def get_processing_chain( "out_fmt": rend_cfg.get("fmt", tmp_out_fmt), "bin": get_abs_path(rend_cfg.get("bin", None)), "opts": rend_cfg.get("opts"), + "trajectory": trajectory, + "trajectory_dir": trajectory_dir, + "only_3dof": rend_cfg.get("only_3dof"), + "render_config": render_config, + "render_config_dir": render_config_dir, "use_windows_codec_binaries": cfg.use_windows_codec_binaries, } ) diff --git a/ivas_processing_scripts/processing/ivas.py b/ivas_processing_scripts/processing/ivas.py index 8bf668bb..6a5f23d4 100755 --- a/ivas_processing_scripts/processing/ivas.py +++ b/ivas_processing_scripts/processing/ivas.py @@ -471,6 +471,30 @@ class IVAS_rend(Processing): if self._use_wine: cmd.insert(0, "wine") + # search for a trajectory file if the trajectory dir is specified + if getattr(self, "trajectory_dir", None): + trj_name = out_file.name.split(".")[0] + self.trajectory = self.trajectory_dir.joinpath(f"{trj_name}.wav.ht.csv") + if not self.trajectory.exists(): + raise FileNotFoundError( + f"Trajectory file {self.trajectory} not found! Please check the configuration" + ) + + # truncate to 3DoF if needed + if getattr(self, "only_3dof", None): + trj_3dof = out_file.with_suffix(".3dof.ht.csv") + truncate_trajectory_3dof(self.trajectory, trj_3dof) + self.trajectory = trj_3dof + + if getattr(self, "trajectory", None): + cmd.extend(["-T", self.trajectory]) + + # add renderer config if specified + if getattr(self, "render_config", None): + rend_cfg_name = out_file.name.split(".")[0] + rend_cfg_file = self.render_config_dir.joinpath(f"{rend_cfg_name}.wav.cfg") + cmd.extend(["-render_config", rend_cfg_file]) + cmd.extend( [ "-fs", -- GitLab