<!-- TITLE: Session Recording/Playback --> This feature provides a method for recording all views, renderables, and time control to a file which can be played-back at a later time. # Getting Started With This Feature This feature is not yet included in the master branch. The **feature/sessionRecording** branch must be checked-out from github. All subsequent build & run steps are identical to the standard instructions for OpenSpace. See [this page](/developer/compiling/general/) for more details about configuring & building OpenSpace. # Notes About Controls and File Management Currently things are done with lua commands in the console, but GUI controls are coming soon. You can pick anywhere in the filesystem to save the file (in the future there will be a playback directory where all of these files are stored). # Recording a Session To start a recording, open the console with the **\`** key and enter: `openspace.sessionRecording.startRecording('C:/filename.dat');` Now use OpenSpace as you would normally, moving the camera around, adjusting layer visibility, time, whatever. When you want to finish recording, open the console again and enter: `openspace.sessionRecording.stopRecording();` and you can go back to using OpenSpace. # Playback of a Recorded Session There are two ways to handle the simulation time when playing back a session. The most common method is to allow OpenSpace to set the simulation time (the current time visible in the menu) to exactly what it was when recorded. To play back a session in this manner, use the syntax: `openspace.sessionRecording.startPlayback('C:/filename.dat');` Playback can also be performed without changing the current simulation time, in which case there are three different time options that can be used: 1. Recorded Time - recorded actions will play back relative to the time that the recording started, or the time that the playback started. For example, if a layer was turned on 3 seconds after starting recording, then in the playback it will turn on 3 seconds after playback started (regardless of what simulation time is). 2. Application Time - recorded actions will play back relative to the time that the OpenSpace application started. Consider the example of a session file that, at the time it was recorded, OpenSpace had been running for 10 minutes. In a later session, a user starts OpenSpace and then starts playback of that file 1 minute later. In this case, the playback will begin 9 minutes after that point (regardless of what simulation time is). 3. Simulation Time - recorded actions will be locked to the simulated time in OpenSpace, and will not play back unless the time is set to the specific date & time. With this mode, it is necessary to manually set the simulation time to before what it was when recorded. Playback will begin when the current simulation time reaches the recorded simulation time. Syntax for these different playback modes is: 1. `openspace.sessionRecording.startPlaybackRecordedTime('C:/filename.dat');` 2. `openspace.sessionRecording.startPlaybackApplicationTime('C:/filename.dat');` 3. `openspace.sessionRecording.startPlaybackSimulationTime('C:/filename.dat');` Currently mouse camera control is disabled during playback. Log messages will indicate when playback is finished. You can abort the playback by entering: `openspace.sessionRecording.stopPlayback();` # Known Issues Problems currently occur when playing back files that contain some types of time manipulation. If playback gets in a strange state because of this, then the `openspace.sessionRecording.stopPlayback()` command can be used to end playback. Camera positions are time dependent, so things can look different if you don't playback in simulation mode and the time is set far in the past/future.