From f77e7139896305003062cf7d6057fd8ab71847c0 Mon Sep 17 00:00:00 2001 From: Ichunjo Date: Thu, 22 Jul 2021 15:12:43 +0200 Subject: [PATCH] misc: add props and num to global DebugOutput attr --- vardefunc/misc.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/vardefunc/misc.py b/vardefunc/misc.py index a40a365..34d01e3 100644 --- a/vardefunc/misc.py +++ b/vardefunc/misc.py @@ -28,6 +28,8 @@ class DebugOutput(MutableMapping): """Utility class to ouput multiple clips""" + _props: int + _num: int _scale: int _ouputs: Dict[int, vs.VideoNode] @@ -85,6 +87,8 @@ def __init__(self, *clips: Output, props: int = 0, num: int = 0, scale: int = 1, def __init__(self, *clips: Output, props: int = 0, num: int = 0, scale: int = 1, clear_outputs: bool = False, check_curr_env: bool = True, **named_clips: Output) -> None: + self._props = props + self._num = num self._scale = scale rclips = [ @@ -183,17 +187,31 @@ def _resolve_clips(self, i: int, clip: Output, name: Optional[str]) -> Tuple[int def _resolve_input_operator(self, yield_func: Iterable[int], clips: OpInput, env: bool = True) -> DebugOutput: if isinstance(clips, dict): - self.__init__(**{name: (i, clip) for i, (name, clip) in zip(yield_func, clips.items())}, - check_curr_env=env) + self.__init__( + props=self._props, num=self._num, scale=self._scale, check_curr_env=env, + **{name: (i, clip) for i, (name, clip) in zip(yield_func, clips.items())}, + ) elif isinstance(clips, tuple): if isinstance(clips[0], vs.VideoNode): - self.__init__(*zip(yield_func, (c for c in clips if isinstance(c, vs.VideoNode))), check_curr_env=env) + self.__init__( + *zip(yield_func, (c for c in clips if isinstance(c, vs.VideoNode))), + props=self._props, num=self._num, scale=self._scale, check_curr_env=env, + ) else: - self.__init__(*zip(yield_func, (c for c in clips if isinstance(c, list))), check_curr_env=env) + self.__init__( + *zip(yield_func, (c for c in clips if isinstance(c, list))), + props=self._props, num=self._num, scale=self._scale, check_curr_env=env, + ) elif isinstance(clips, list): - self.__init__(*zip(yield_func, [clips]), check_curr_env=env) + self.__init__( + *zip(yield_func, [clips]), + props=self._props, num=self._num, scale=self._scale, check_curr_env=env, + ) else: - self.__init__(*zip(yield_func, [clips]), check_curr_env=env) + self.__init__( + *zip(yield_func, [clips]), + props=self._props, num=self._num, scale=self._scale, check_curr_env=env, + ) return self def _index_not_used_gen(self) -> Iterable[int]: