def execute(self, context):
        """Render the point cloud and export the result as image sequence."""
        log_report(
            "INFO", "Export opengl render as image sequencemation: ...", self
        )
        scene = context.scene
        save_point_size = scene.opengl_panel_settings.save_point_size

        # The export helper stores the path in self.filepath (even if it is a
        # directory)
        output_dp = self.filepath
        log_report("INFO", "Output Directory Path: " + str(output_dp), self)

        if not os.path.isdir(output_dp):
            os.mkdir(output_dp)

        # Used to cache the results
        image_name = "OpenGL Export"
        ext = "." + scene.opengl_panel_settings.render_file_format
        save_alpha = scene.opengl_panel_settings.save_alpha
        selected_cam = get_selected_camera()
        use_camera_keyframes = (
            scene.opengl_panel_settings.use_camera_keyframes_for_rendering
        )
        if (
            use_camera_keyframes
            and selected_cam is not None
            and selected_cam.animation_data is not None
        ):
            animation_indices = get_object_animation_indices(selected_cam)
        else:
            animation_indices = get_scene_animation_indices()

        draw_manager = DrawManager.get_singleton()
        coords, colors = draw_manager.get_coords_and_colors(visible_only=True)
        for idx in animation_indices:
            bpy.context.scene.frame_set(idx)
            current_frame_fn = str(idx).zfill(5) + ext
            current_frame_fp = os.path.join(output_dp, current_frame_fn)

            log_report(
                "INFO", "Output File Path: " + str(current_frame_fp), self
            )
            render_opengl_image(
                image_name, selected_cam, coords, colors, save_point_size
            )
            save_image_to_disk(image_name, current_frame_fp, save_alpha)

        log_report("INFO", "Save opengl render as animation: Done", self)
        return {"FINISHED"}
Render the point cloud and export the result as image sequence.
photogrammetry_importer/panels/render_operators.py