diff --git a/ivas_processing_scripts/processing/chains.py b/ivas_processing_scripts/processing/chains.py index aeaaa11f2101336f8dba141c544db483649f9504..2ecac3da00995587e676728a60ac13e2ac99d78d 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 8bf668bb319e44fc43c4d9150bd016e3f8a3d5fd..6a5f23d440e54d538f392f597c51074b5f81703e 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",