def parse_meshroom_file(
        cls,
        meshroom_ifp,
        use_workspace_images,
        image_dp,
        image_fp_type,
        suppress_distortion_warnings,
        sfm_node_type,
        sfm_node_number,
        mesh_node_type,
        mesh_node_number,
        prepare_node_number,
        op=None,
    ):
        """Parse a :code:`Meshroom` file.

        Supported file formats are :code:`.mg`, :code:`.sfm` or :code:`.json`.
        """
        log_report("INFO", "parse_meshroom_file: ...", op)
        log_report("INFO", "meshroom_ifp: " + meshroom_ifp, op)

        ext = os.path.splitext(meshroom_ifp)[1].lower()
        if ext == ".mg":
            (
                meshroom_ifp,
                mesh_fp,
                image_idp_workspace,
            ) = cls.parse_meshrom_mg_file(
                meshroom_ifp,
                sfm_node_type,
                sfm_node_number,
                mesh_node_type,
                mesh_node_number,
                prepare_node_number,
                op,
            )
            if (
                use_workspace_images
                and image_idp_workspace is not None
                and os.path.isdir(image_idp_workspace)
            ):
                image_dp = image_idp_workspace
                log_report("INFO", "Using image directory in workspace.", op)
        else:
            assert ext == ".json" or ext == ".sfm"
            mesh_fp = None

        if meshroom_ifp is not None:
            cams, points = cls.parse_meshroom_sfm_file(
                meshroom_ifp,
                image_dp,
                image_fp_type,
                suppress_distortion_warnings,
                op,
            )
        else:
            log_report(
                "WARNING",
                "Meshroom project does not contain cameras or points. Have"
                " you saved the project (i.e. the *.mg file)?",
                op,
            )
            cams = []
            points = []

        log_report("INFO", "parse_meshroom_file: Done", op)
        return cams, points, mesh_fp, image_dp
Parse a :code:`Meshroom` file.

        Supported file formats are :code:`.mg`, :code:`.sfm` or :code:`.json`.
        
photogrammetry_importer/file_handlers/meshroom_file_handler.py