Main Content

saveScene

Save RoadRunner scene using MATLAB

    Description

    saveScene(rrApp) saves any modifications to the scene currently open in the specified RoadRunner instance. If you have modified any assets in the scene, then this function also saves the current project.

    example

    saveScene(rrApp,filename) saves any modifications to the specified scene filename. If you have modified any assets in the scene, then this function also saves the project to which the scene belongs.

    Examples

    collapse all

    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 an existing scene in the current RoadRunner project.

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

    Save the RoadRunner scene to a new location.

    newFilename = "FourWaySignal1.rrscene";
    saveScene(rrApp,newFilename);

    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.

    RoadRunner scene file to open, specified as a character vector or string scalar. This argument specifies the absolute or relative path to the scene file you want to save. If you specify a relative path, then the path is relative to the Scenes folder of the current project. If you do not have a scene open, then RoadRunner returns an error. If any folders in the specified file path do not exist, then RoadRunner creates them recursively. filename must end with .rrscene or have no extension. If it has no extension, then RoadRunner appends the .rrscene extension to the file name before opening the scene. If the file being saved already exists, then RoadRunner overwrites it.

    Example: saveScene(rrApp,"FourWaySignal1.rrscene") saves "FourWaySignal1.rrscene" located in the Scenes folder of the current project.

    Data Types: char | string

    Version History

    Introduced in R2022a