Omni.kit.viewport_legacy.deferred_capture() issue

Hi all
It capture well if only has a viewport. If create more than one viewport, omni.kit.viewport_legacy.deferred_capture() only save one viewport to file.

def _capture_viewport(self, vp, vp_name):
  global frame_count
  frame_path = pathlib.Path(
      self._capture_save_dir).joinpath(vp_name + "_" + str(frame_count) +
                                       ".png")
  
  def _capture_helper(viewport_rp_resource):
      self._renderer.capture_next_frame_rp_resource(
          str(frame_path), viewport_rp_resource)
  
  omni.kit.viewport_legacy.deferred_capture(
      vp,
      _capture_helper,
      is_hdr=False,
      subscription_name="omni.kit.capture capture helper")
  self._renderer.wait_async_capture()
  print(f"capture frame:{frame_count} path:{frame_path}")
  frame_count = frame_count + 1

for i in range(len(viewports)):
  vp = view_port_factory.get_viewport_window(viewports[i])
  vp_name = view_port_factory.get_viewport_window_name(
      viewports[i])
  if vp.is_visible():
      self._capture_viewport(vp, vp_name)

How can I fix this?

Hello @user76666! I contacted the development team for more help here. I will post back here when I have more information!