Main Content

exportScene

Export RoadRunner scene using MATLAB

    Description

    exportScene(rrApp,filename,formatname) exports the RoadRunner scene file to one of the file formats supported by RoadRunner.

    example

    exportScene(rrApp,filename,formatname,exportoptions) specifies an export option configuration, exportoptions.

    Examples

    collapse all

    Export a scene from a RoadRunner project to the ASAM OpenDRIVE format using MATLAB®.

    Open a project in RoadRunner using the roadrunner function by specifying the location in which to create a project. This example assumes that RoadRunner is installed in its default location in Windows.

    Specify the path to an existing project. For example, this code shows the path to a project located on C:\RR\MyProject. The function returns a roadrunner object, rrApp, that provides functions for performing basic workflow tasks such as opening, closing, and saving scenes and projects.

    projectFolder = "C:\RR\MyProject";
    rrApp = roadrunner(projectFolder);

    Open a scene in the project by using the openScene function with the roadrunner object and the RoadRunner scene you wish to open as input arguments. This example uses the FourWaySignal.rrscene scene, which is one of the scenes included by default in RoadRunner projects, and is located in the Scenes folder of the project.

    sceneName = "FourWaySignal.rrscene";
    openScene(rrApp,sceneName);

    Set export options by creating an openDriveExportOptions object to enable export of signals and objects from the file.

    options = openDriveExportOptions(OpenDriveVersion=1.5,ExportSignals=true,ExportObjects=true);

    Use the exportScene function to export the scene to ASAM OpenDRIVE. Specify your roadrunner object, the name of the file to which you want to export the scene, the export format, and the export options as input arguments to the exportScene function.

    filename = "FourWaySignal.xodr";
    formatname = "OpenDRIVE";
    exportScene(rrApp,filename,formatname,options);

    Input Arguments

    collapse all

    RoadRunner application associated with a project, specified as a roadrunner object. This object provides functions for performing common workflow tasks such as opening, closing, and saving scenes and projects. rrApp provides functions that support importing data from files and exporting scenes to other formats from RoadRunner.

    File path for the exported RoadRunner scene, specified as a character vector or string scalar. This argument specifies the absolute or relative file path of the file to which you are exporting the scene from the RoadRunner project. If you specify a relative path, then the path is relative to the Exports folder of the current project. If you specify an absolute path, then RoadRunner exports the scene to a file in the exact location specified. If any folders in the path are missing, RoadRunner tries to create them. filename can include the extension for the exported file or have no extension. If it has no extension, then RoadRunner appends the extension of the format specified by the formatname to the file name before exporting the scene.

    Example: exportScene(rrApp,"FourWaySignal.xodr","OpenDRIVE",options), "FourWaySignal.xodr" represents the file name of the exported file, which is relative to the Exports folder of the current project.

    Data Types: char | string

    Export format name, specified as a character vector or string scalar .This argument specifies the format name corresponding to a valid RoadRunner format. Format name options are case-insensitive. Supported formats are: AutoCAD®, Filmbox, glTF™, OpenFlight, OpenSceneGraph, ASAM OpenDRIVE®, USD, Apollo, CARLA, Metamoto®, Unity®, Unreal®, GeoJSON, and VTD.

    Example: While calling exportScene(rrApp,"FourWaySignal.xodr","OpenDRIVE",options), "OpenDRIVE" specifies that the file will be exported to ASAM OpenDRIVE format.

    Data Types: char | string

    Export options configuration, specified as one of the export options objects compatible with the specified format formatname. This argument specifies the options used when exporting the specified scene.

    Export FormatsDescription Properties
    apolloExportOptions

    Options for exporting a RoadRunner scene to Apollo.

    apolloExportOptions(Name=Value) creates an export options configuration object for the Apollo format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    ApolloVersion

    Apollo version to export to, specified as 3 or 5, respectively.

    Default: "auto"

    DatabaseVersion

    Identifier for the exported scene, specified as a numeric scalar. This property is useful for versioning exports of the same scene.

    Default: "auto"

    DatabaseName

    Name of the exported scene, specified as a string scalar or character vector.

    Default: "auto"

    DrivingSide

    Driving side of the exported scene, specified as: "Unspecified", "Left", or "Right".

    Default: "auto"

    ExportSignals

    Export all signals and signs mapped to junctions as <signal> entries, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ExportObjects

    Export all props as <object> entries, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ClampDistances

    Clamp distances in the RoadRunner scene to multiples of 1 cm, specified as a logical 1 (true) or 0 (false). Specifying this property as true can prevent RoadRunner from exporting very short roads.

    Default: "auto"

    Example: options = apolloExportOptions(DrivingSide="Right");

    autocadExportOptions

    Options for exporting a RoadRunner scene to AutoCAD.

    autocadExportOptions(Name=Value) creates an export options configuration object for the AutoCAD format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    SplitMeshes

    Split meshes by their segmentation type, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ResizeTextureDimensions

    Resize the dimensions of exported textures by rounding them up to the next highest power of two, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    TilesExportOptions

    Options for splitting meshes per tile, specified as a tilesExportOptions object.

    Default: "auto"

    Example: options = autocadExportOptions(SplitMeshes=true);

    tilesExportOptions

    Options for exporting tiles.

    tilesExportOptions(Name=Value) creates an options configuration object for exporting tiles, with properties specified as one or more name-value arguments. These fields correspond to options in the AutoCAD, Filmbox, glTF, OpenFlight, OpenSceneGraph, and USD export options.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    TileSize

    The size of exported tiles, specified as a two element double vector.

    Default: "auto"

    TileCenter

    The center location of exported tiles, specified as a two element double vector.

    Default: "auto"

    ExportIndividualTiles

    Export each tile as a separate file, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    Example: options = tilesExportOptions(TileSize=[100 100]);

    carlaExportOptions

    Options for exporting a RoadRunner scene to CARLA.

    carlaExportOptions(Name=Value) creates an export options configuration object for the CARLA format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    UnrealDatasmithOptions

    Options for exporting a Unreal Datasmith file, specified as a unrealDatasmithExportOptions object.

    Default: "auto"

    OpenDriveOptions

    Options for exporting an ASAM OpenDRIVE file, specified as an openDriveExportOptions object.

    Default: "auto"

    Example: options = carlaExportOptions(UnrealDatasmithOptions=unrealDatasmithExportOptions(SplitMeshes=true));

    datasmithRoadExportOptions

    Options for exporting a RoadRunner scene to DatasmithRoad.

    datasmithRoadExportOptions(Name=Value) creates an export options configuration object for the DatasmithRoad format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    UnrealDatasmithOptions

    Options for exporting a Unreal Datasmith file, specified as a unrealDatasmithExportOptions object.

    Default: "auto"

    OpenDriveOptions

    Options for exporting an ASAM OpenDRIVE file, specified as an openDriveExportOptions object.

    Default: "auto"

    Example: options = datasmithRoadExportOptions(UnrealDatasmithOptions=unrealDatasmithExportOptions(SplitMeshes=true));

    filmboxExportOptions

    Options for exporting a RoadRunner scene to Filmbox.

    filmboxExportOptions(Name=Value) creates an export options configuration object for the Filmbox format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    SplitMeshes

    Split meshes by their segmentation type, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ResizeTextureDimensions

    Resize the dimensions of exported textures by rounding them up to the next highest power of two, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    EmbedTextures

    Embed the exported textures inside the exported file, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    TilesExportOptions

    Options to split meshes per tile, specified as a tilesExportOptions object.

    Default: "auto"

    Example: options = filmboxExportOptions(ResizeTextureDimensions=true);

    geoJSONExportOptions

    Options for exporting a RoadRunner scene to GeoJSON.

    geoJSONExportOptions(Name=Value) creates an export options configuration object for the GeoJSON format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    ReduceFileSize

    Removes new lines from the exported GeoJSON file and decreases its size, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    Example: options = geoJSONExportOptions(ReduceFileSize=true);

    gltfExportOptions

    Options for exporting a RoadRunner scene to glTF.

    gltfExportOptions(Name=Value) creates an export options configuration object for the glTF format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    SplitMeshes

    Split meshes by their segmentation type, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ResizeTextureDimensions

    Resize the dimensions of exported textures by rounding them up to the next highest power of two, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    TilesExportOptions

    Options for splitting split meshes per tile, specified as a tilesExportOptions object.

    Default: "auto"

    Example: options = gltfExportOptions(SplitMeshes=true);

    metamotoExportOptions

    Options for exporting a RoadRunner scene to Metamoto.

    metamotoExportOptions(Name=Value) creates an export options configuration object for the Metamoto format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    FilmboxOptions

    Options for exporting a Filmbox file, specified as a filmboxExportOptions object.

    Default: "auto"

    OpenDriveOptions

    Options for exporting an ASAM OpenDRIVE file, specified as an openDriveExportOptions object.

    Default: "auto"

    GeoJSONOptions

    Options for exporting a GeoJSON file, specified as a geoJSONExportOptions object.

    Default: "auto"

    Example: options = metamotoExportOptions(GeoJSONOptions=geoJSONExportOptions(ReduceFileSize=true));

    openDriveExportOptions

    Options for exporting a RoadRunner scene to ASAM OpenDRIVE.

    openDriveExportOptions(Name=Value) creates an export options configuration object for the ASAM OpenDRIVE format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    OpenDriveVersion

    ASAM OpenDRIVE version to export to, specified as 1.4,1.5, or 1.6, specified as a scalar double.

    Default: 1.6

    DatabaseVersion

    Identifier for the exported scene, specified as a numeric scalar. This property is useful for versioning exports of the same scene.

    Default: 0.

    DatabaseName

    Name of the exported scene, specified as a string scalar or character vector.

    Default: "auto"

    DrivingSide

    Driving side of the exported scene, specified as: "Unspecified", "Left", or "Right".

    Default: "auto"

    ExportMarkingsAsLine

    Export additional lane marking data (spacing, dash length, and individual paint strip widths) using the <line> definition in ASAM OpenDRIVE, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ExportSignals

    Export all signals and signs mapped to junctions as <signal> entries, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ExportOpenCRG

    Export to ASAM OpenCRG® file, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ExportObjects

    Export all props as <object> entries, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ExportHeadingOffsetRelativeToOrientation

    Export the <hOffset> (heading offset) values of <signal> entries as being relative to <orientation>, which is the direction of travel of the road that the signal applies to, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ExportConflictPoints

    Export an <object> entry for every point in a junction where two roads intersect, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ExportSceneOriginReference

    Export a reference point origin at 0,0 in the scene, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ClampDistances

    Clamp distances in the RoadRunner scene to multiples of 1 cm, specified as a logical 1 (true) or 0 (false). Specifying this property as true can prevent RoadRunner from exporting very short roads.

    Default: "auto"

    Example: options = openDriveExportOptions(ExportSignals=true);

    openFlightExportOptions

    Options for exporting a RoadRunner scene to OpenFlight.

    openFlightExportOptions(Name=Value) creates an export options configuration object for the OpenFlight format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    SplitMeshes

    Split meshes by their segmentation type, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ResizeTextureDimensions

    Resize the dimensions of exported textures by rounding them up to the next highest power of two, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    TilesExportOptions

    Options for splitting meshes per tile, specified as a tilesExportOptions object.

    Default: "auto"

    Example: options = openFlightExportOptions(SplitMeshes=true);

    openSceneGraphExportOptions

    Options for exporting a RoadRunner scene to OpenSceneGraph.

    openSceneGraphExportOptions(Name=Value) creates an export options configuration object for the OpenSceneGraph format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    SplitMeshes

    Split meshes by their segmentation type, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ResizeTextureDimensions

    Resize the dimensions of exported textures by rounding them up to the next highest power of two, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    EmbedTextures

    Embed the exported textures inside the exported file, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    TilesExportOptions

    Options for splitting meshes per tile, specified as a tilesExportOptions object.

    Default: "auto"

    Example: options = openSceneGraphExportOptions(SplitMeshes=true);

    unityExportOptions

    Options for exporting a RoadRunner scene to Unity.

    unityExportOptions(Name=Value) creates an export options configuration object for the Unity format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    FilmboxOptions

    Options for exporting a Filmbox file, specified as a filmboxExportOptions object.

    Default: "auto"

    OpenDriveOptions

    Options for exporting an ASAM OpenDRIVE file, specified as an openDriveExportOptions object.

    Default: "auto"

    Example: options = unityExportOptions(FilmboxOptions=filmboxExportOptions(EmbedTextures=true));

    unrealExportOptions

    Options for exporting a RoadRunner scene to Unreal.

    unrealExportOptions(Name=Value) creates an export options configuration object for the Unreal format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    FilmboxOptions

    Options for exporting a Filmbox file, specified as a filmboxExportOptions object.

    Default: "auto"

    OpenDriveOptions

    Options for exporting an ASAM OpenDRIVE file, specified as an openDriveExportOptions object.

    Default: "auto"

    Example: options = unrealExportOptions(FilmboxOptions=filmboxExportOptions(EmbedTextures=true));

    unrealDatasmithExportOptions

    Options for exporting a RoadRunner scene to UnrealDatasmith.

    unrealDatasmithExportOptions(Name=Value) creates an export options configuration object for the UnrealDatasmith format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    SplitMeshes

    Split meshes by their segmentation type, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ResizeTextureDimensions

    Resize the dimensions of exported textures by rounding them up to the next highest power of two, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    TilesExportOptions

    Options for splitting meshes per tile, specified as a tilesExportOptions object.

    Default: "auto"

    Example: options = unrealDatasmithExportOptions(ResizeTextureDimensions=true);

    usdExportOptions

    Options for exporting a RoadRunner scene to USD.

    usdExportOptions(Name=Value) creates an export options configuration object for the USD format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    SplitMeshes

    Split meshes by their segmentation type, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    ResizeTextureDimensions

    Resize the dimensions of exported textures by rounding them up to the next highest power of two, specified as a logical 1 (true) or 0 (false).

    Default: "auto"

    TilesExportOptions

    Options for splitting meshes per tile, specified as a tilesExportOptions object.

    Default: "auto"

    Example: options = usdExportOptions(SplitMeshes=true);

    vtdExportOptions

    Options for exporting a RoadRunner scene to VTD.

    vtdExportOptions(Name=Value) creates an export options configuration object for the VTD format, with properties specified as one or more name-value arguments.

    If a default property value is "auto", the RoadRunner application determines what value to use and sets the property to that value.

    OpenSceneGraphOptions

    Options for export an OpenSceneGraph file, specified as an openSceneGraphExportOptions object.

    Default: "auto"

    OpenDriveOptions

    Options for export an ASAM OpenDRIVE file, specified as an openDriveExportOptions object.

    Default: "auto"

    Example: options = vtdExportOptions(OpenDriveOptions=openDriveExportOptions(ExportObjects=true));

    Data Types: char | string

    Version History

    Introduced in R2022a