exportScene
Description
exportScene(
exports the RoadRunner scene file to one of the file formats supported by RoadRunner.rrApp
,filename
,formatname
)
exportScene(
specifies an export option configuration, rrApp
,filename
,formatname
,exportoptions
)exportoptions
.
Examples
Export Scene from RoadRunner to ASAM OpenDRIVE®
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
rrApp
— RoadRunner application
roadrunner
object
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.
filename
— File path for the exported RoadRunner scene
character vector | string scalar
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
formatname
— Export format name
character vector | string scalar
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
exportoptions
— Export options configuration
valid export options object
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 Formats | Description | Properties | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apolloExportOptions | Options for exporting a RoadRunner scene to Apollo.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
autocadExportOptions | Options for exporting a RoadRunner scene to AutoCAD.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
tilesExportOptions | Options for exporting tiles.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
carlaExportOptions | Options for exporting a RoadRunner scene to CARLA.
If a default property value is
|
Example: | ||||||||||||||||||||||||||||||
carlaFilmboxExportOptions | Options for exporting a RoadRunner scene to CARLA.
If a default property value is
|
Example: | ||||||||||||||||||||||||||||||
datasmithRoadExportOptions | Options for exporting a RoadRunner scene to DatasmithRoad.
If a default property value is
|
Example: | ||||||||||||||||||||||||||||||
filmboxExportOptions | Options for exporting a RoadRunner scene to Filmbox.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
geoJSONExportOptions | Options for exporting a RoadRunner scene to GeoJSON.
If a default property value is
|
Example: | ||||||||||||||||||||||||||||||
gltfExportOptions | Options for exporting a RoadRunner scene to glTF.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
metamotoExportOptions | Options for exporting a RoadRunner scene to Metamoto.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
openDriveExportOptions | Options for exporting a RoadRunner scene to ASAM OpenDRIVE.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
openFlightExportOptions | Options for exporting a RoadRunner scene to OpenFlight.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
openSceneGraphExportOptions | Options for exporting a RoadRunner scene to OpenSceneGraph.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
unityExportOptions | Options for exporting a RoadRunner scene to Unity.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
unrealExportOptions | Options for exporting a RoadRunner scene to Unreal.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
unrealDatasmithExportOptions | Options for exporting a RoadRunner scene to UnrealDatasmith.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
usdExportOptions | Options for exporting a RoadRunner scene to USD.
If a
default property value is |
Example:
| ||||||||||||||||||||||||||||||
vtdExportOptions | Options for exporting a RoadRunner scene to VTD.
If a default property value is
|
Example:
| ||||||||||||||||||||||||||||||
rfproExportOptions | Options for exporting a RoadRunner scene to rFpro.
If a default
property value is |
Example:
| ||||||||||||||||||||||||||||||
syntheticOpenCRGOptions (since R2024a) | Options for a synthetic ASAM OpenCRG file.
If a default property value is
|
Example:
|
Data Types: char
| string
Version History
Introduced in R2022aR2024b: Export each asset of a scene as a separate USD file
As of R2024b, you can specify to export each asset of a scene as a separate USD file using the ExportIndividualAssets
property of the
usdExportOptions
object.
R2024a: New properties for gltfExportOptions
and openDriveExportOptions
As of R2024a, you can specify these new properties for the
openDriveExportOptions
object:
EnforceConnectedRoadContinuity
— Option to enforce continuity between the reference lines of roads connected end-to-end.SyntheticOpenCRGOptions
— Option to specify synthetic ASAM OpenCRG file options.ApplyParkingSlope
— Option to apply parking slope.
R2024a also introduces the property EmbedTextures
for the
gltfExportOptions
object. This enables you to embed the exported
textures inside the exported file.
R2024a: Specify options for configuring a synthetic ASAM OpenCRG file with syntheticOpenCRGOptions
As of R2024a, you can specify options for configuring a synthetic ASAM OpenCRG file using the syntheticOpenCRGOptions
object.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)