diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 0d4a5c7c86..af1aee4d42 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -1187,7 +1187,7 @@ int main(int argc, char** argv) { configurationFilePath ); - // If the user requested a commandline-based configuation script that should + // If the user requested a commandline-based configuration script that should // overwrite some of the values, this is the time to do it if (!commandlineArguments.configurationOverride.empty()) { LDEBUG("Executing Lua script passed through the commandline:"); diff --git a/data/assets/apollo8.profile b/data/assets/apollo8.profile new file mode 100644 index 0000000000..f9a9c003fc --- /dev/null +++ b/data/assets/apollo8.profile @@ -0,0 +1,35 @@ +#Version +1.0 + +#Asset +scene/solarsystem/planets/earth/moon/moon required +scene/solarsystem/missions/apollo/apollo8 required +scene/solarsystem/planets/earth/earth required + +#Property +setPropertyValueSingle NavigationHandler.OrbitalNavigator.MinimumAllowedDistance 0.000000 +setPropertyValueSingle Scene.Moon.Renderable.LodScaleFactor 24.0 + +#Keybinding +E Jump to right before the earthrise photo Set Earthrise time /Missions/Apollo/8 false "openspace.time.setPause(true); openspace.time.setDeltaTime(1); openspace.time.setTime('1968 DEC 24 16:37:31'); openspace.navigation.setNavigationState({Anchor = 'Apollo8', Position = { 1.494592E1, 3.236777E1, -4.171296E1 }, ReferenceFrame = 'Root', Up = { 0.960608E0, -0.212013E0, 0.179675E0 }}); openspace.setPropertyValue('*Trail.Renderable.Enabled', false)" +U Jump to time right before Apollo 8 liftoff, with its trail enabled Set Apollo 8 launch time /Missions/Apollo/8 false "openspace.time.setTime('1968-12-21T12:51:37.00'); openspace.setPropertyValueSingle('Scene.Apollo8LaunchTrail.Renderable.Enabled', true)" +K Toggles Moon Kaguya color layer Toggle Kaguya layer on the Moon /Missions/Apollo false propertyHelper.invert('Scene.Moon.Renderable.Layers.ColorLayers.Kaguya_Utah.Enabled') +T Toggles the trails of the Apollo 8 orbits, focused around the Moon Toggle Apollo 8 orbits /Missions/Apollo/8 false propertyHelper.invert('Scene.Apollo8MoonTrail.Renderable.Enabled') +SHIFT+T Toggles the trails of the Apollo 8 Launch, focused around the Earth Toggle Apollo 8 launch trail /Missions/Apollo/8 false propertyHelper.invert('Scene.Apollo8LaunchTrail.Renderable.Enabled') +CTRL+T Toggles the trails of the full Apollo 8, with Earth's frame of reference Toggles Apollo 8 full trail /Missions/Apollo/8 false propertyHelper.invert('Scene.Apollo8EarthBarycenterTrail.Renderable.Enabled') +S Toggles shading for the Moon Toggle Moon shading /Missions/Apollo false propertyHelper.invert('Scene.Moon.Renderable.PerformShading') +PAGE_UP Set camera focus to Apollo 8 Focus on Apollo 8 /Missions/Apollo/8 false "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Apollo8'); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)" +PAGE_DOWN Set camera focus to the Moon Focus on Moon /Missions/Apollo false "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Moon'); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)" +HOME Set camera focus to the Earth Focus on Earth /Missions/Apollo false "openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth'); openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)" + +#Time +absolute 1968-12-21T12:51:51.0 + +#Camera +goToGeo "Earth" 20 -60 15000000 + +#MarkNodes +Earth +Moon +Apollo8 +Apollo8Launch diff --git a/data/assets/apollo_sites.profile b/data/assets/apollo_sites.profile new file mode 100644 index 0000000000..f014e5b36d --- /dev/null +++ b/data/assets/apollo_sites.profile @@ -0,0 +1,36 @@ +#Version +1.0 + +#Asset +scene/solarsystem/planets/earth/moon/moon required +scene/solarsystem/missions/apollo/apollo8 required +scene/solarsystem/missions/apollo/apollo11 required +scene/solarsystem/missions/apollo/a17_lem required +scene/solarsystem/missions/apollo/apollo_globebrowsing required +scene/solarsystem/missions/apollo/apollo_11_lem_flipbook required +scene/solarsystem/missions/apollo/insignias_map required + +#Property +setPropertyValueSingle Scene.Moon.Renderable.Layers.ColorLayers.A17_travmap.BlendMode 0 +setPropertyValueSingle Scene.Apollo11LemDescentModel.Renderable.RotationVector { 273.750,28.0,309.85 } +setPropertyValueSingle Scene.Apollo11LemLandedModel.Renderable.RotationVector { 273.750,28.0,309.85 } +setPropertyValueSingle Scene.Moon.Renderable.PerformShading false + +#Keybinding +m Focus on Moon Focus on Moon /Missions/Apollo false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Moon'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);" +F9 Disable apollo site on moon when switching Disable Apollo site /Missions/Apollo false "openspace.setPropertyValue('Scene.Moon.Renderable.Layers.ColorLayers.A17_*.Enabled', false); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_11.Enabled', false); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A11_M177481212_p_longlat.Enabled', false); openspace.setPropertyValueSingle('Scene.Apollo11MoonTrail.Renderable.Enabled', false); openspace.setPropertyValueSingle('Scene.Apollo11LemTrail.Renderable.Enabled', false); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_17.Enabled', false);" +F11 Setup for A11 site Setup A11 site /Missions/Apollo/11 false "openspace.time.setTime('1969 JUL 20 20:17:40'); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_11.Enabled', true); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A11_M177481212_p_longlat.Enabled', true); openspace.setPropertyValueSingle('Scene.Moon.Renderable.LodScaleFactor', 20.11); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Apollo11LemPosition'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil); openspace.setPropertyValueSingle('Scene.Apollo11MoonTrail.Renderable.Enabled', true); openspace.setPropertyValueSingle('Scene.Apollo11LemTrail.Renderable.Enabled', true);" +F7 Setup for A17 site Setup A17 site /Missions/Apollo/17 false "openspace.time.setTime('1972 DEC 12 19:47:11'); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_travmap.BlendMode', 0.000000); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_travmap.Enabled', true); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.HeightLayers.LRO_NAC_Apollo_17.Enabled', true); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_LEM.Enabled', true); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_LEM.BlendMode', 0.000000); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_NAC_Alt_p.Enabled', true); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_NAC_Alt_p.BlendMode', 0.000000); openspace.setPropertyValueSingle('Scene.Moon.Renderable.LodScaleFactor', 20.17); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Apollo17LemModel'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil); openspace.setPropertyValueSingle('Scene.Moon.Renderable.Layers.ColorLayers.A17_station7.BlendMode', 0.000000);" + +#Time +absolute 1972 DEC 12 19:47:11 + +#Camera +goToGeo "Moon" 20 -60 15000000 + +#MarkNodes +Moon +Apollo11LemModel +Apollo17LemModel +Apollo11 +Apollo11LunarLander diff --git a/data/assets/dawn.profile b/data/assets/dawn.profile new file mode 100644 index 0000000000..533e43d6dc --- /dev/null +++ b/data/assets/dawn.profile @@ -0,0 +1,18 @@ +#Version +1.0 + +#Asset +scene/solarsystem/missions/dawn/ceres required +scene/solarsystem/missions/dawn/dawn required +scene/solarsystem/missions/dawn/vesta required + +#Time +absolute 2011 AUG 06 00:00:00 + +#Camera +setNavigationState "Dawn" 526781518487.171326, 257168309890.072144, -1381125204152.817383 + +#MarkNodes +Dawn +Ceres +Vesta diff --git a/data/assets/default.profile b/data/assets/default.profile new file mode 100644 index 0000000000..b708a2d253 --- /dev/null +++ b/data/assets/default.profile @@ -0,0 +1,17 @@ +#Version +1.0 + +#Asset +scene/solarsystem/planets/earth/earth required + +#Time +relative -1d + +#Camera +goToGeo "Earth" 58.5877 16.1924 20000000 + +#MarkNodes +Earth +Mars +Moon +Sun diff --git a/data/assets/default_full.profile b/data/assets/default_full.profile new file mode 100644 index 0000000000..e6c2522523 --- /dev/null +++ b/data/assets/default_full.profile @@ -0,0 +1,23 @@ +#Version +1.0 + +#Asset +scene/solarsystem/planets/earth/earth required +scene/solarsystem/planets/jupiter/minor_moons required +scene/solarsystem/planets/saturn/minor_moons required +scene/solarsystem/planets/uranus/minor_moons required +scene/solarsystem/planets/neptune/inner_moons required +scene/solarsystem/planets/neptune/irregular_prograde_moons required +scene/solarsystem/planets/neptune/irregular_retrograde_moons required + +#Time +relative -1d + +#Camera +goToGeo "Earth" 58.5877 16.1924 20000000 + +#MarkNodes +Earth +Mars +Moon +Sun diff --git a/data/assets/gaia.profile b/data/assets/gaia.profile new file mode 100644 index 0000000000..82d54557b1 --- /dev/null +++ b/data/assets/gaia.profile @@ -0,0 +1,22 @@ +#Version +1.0 + +#Module +Gaia openspace.printFatal('Could not load scene due to missing module "gaia"') + +#Asset +scene/solarsystem/planets/earth/earth required +scene/milkyway/gaia/gaiastars required +scene/milkyway/gaia/apogee required +scene/milkyway/gaia/galah required +scene/solarsystem/missions/gaia/gaia required +scene/solarsystem/missions/gaia/trail required + +#Property +setPropertyValueSingle Scene.Stars.Renderable.Enabled false + +#Camera +setNavigationState "Earth" 1000000000000.0, 1000000000000.0, 1000000000000.0 + +#MarkNodes +Gaia diff --git a/data/assets/insight.profile b/data/assets/insight.profile new file mode 100644 index 0000000000..0491c3e059 --- /dev/null +++ b/data/assets/insight.profile @@ -0,0 +1,29 @@ +#Version +1.0 + +#Asset +scene/solarsystem/missions/insight/edl required + +#Property +setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false +setPropertyValueSingle Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset -469.300000 +setPropertyValueSingle Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset -470.800006 +setPropertyValueSingle Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled true +setPropertyValueSingle Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier 2.81690 +setPropertyValueSingle Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma 0.938970 +setPropertyValueSingle Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma 2.394370 +setPropertyValueSingle Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled true + + +#Keybinding +i Setup Insight landing layers Setup Insight layers /Missions/Insight false "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', -469.300000); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', -470.800006); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', true); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', true); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 2.816900); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 0.938970); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 2.394370); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', true);" +SHIFT+i Undo Insight landing layers setup Unset Insight layers /Missions/Insight false "openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.Mola_Utah.Settings.Offset', 0); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Settings.Offset', 0); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.insight_ctx.Enabled', false); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.HeightLayers.OnMarsHiRISELS.Enabled', false); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Enabled', false); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Multiplier', 1.0); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.OnMarsHiRISELS.Settings.Gamma', 1.0); openspace.setPropertyValueSingle('Scene.Mars.Renderable.Layers.ColorLayers.MOC_WA_Color_Utah.Settings.Gamma', 1.0);" + +#Time +absolute 2018 NOV 26 19:39:03.68 + +#Camera +setNavigationState "Insight" "Root" 8.430115E0, -1.791710E1, 2.813660E0 0.494659E0,0.357162E0,0.792306E0 + +#MarkNodes +Insight diff --git a/data/assets/juno.profile b/data/assets/juno.profile new file mode 100644 index 0000000000..d2bb28a316 --- /dev/null +++ b/data/assets/juno.profile @@ -0,0 +1,37 @@ +#Version +1.0 + +#Asset +scene/solarsystem/missions/juno/juno required + +#Keybinding +1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)" +2 Setting the simulation speed to 5 seconds per realtime second Set sim speed 5 /Simulation Speed false "openspace.time.interpolateDeltaTime(5)" +3 Setting the simulation speed to 10 seconds per realtime second Set sim speed 10 /Simulation Speed false "openspace.time.interpolateDeltaTime(10)" +4 Setting the simulation speed to 20 seconds per realtime second Set sim speed 20 /Simulation Speed false "openspace.time.interpolateDeltaTime(20)" +5 Setting the simulation speed to 40 seconds per realtime second Set sim speed 40 /Simulation Speed false "openspace.time.interpolateDeltaTime(40)" +6 Setting the simulation speed to 90 seconds per realtime second Set sim speed 90 /Simulation Speed false "openspace.time.interpolateDeltaTime(90)" +7 Setting the simulation speed to 360 seconds per realtime second Set sim speed 360 /Simulation Speed false "openspace.time.interpolateDeltaTime(360)" +8 Setting the simulation speed to 720 seconds per realtime second Set sim speed 720 /Simulation Speed false "openspace.time.interpolateDeltaTime(720)" +9 Setting the simulation speed to 2880 seconds per realtime second Set sim speed 2880 /Simulation Speed false "openspace.time.interpolateDeltaTime(2880)" +0 Setting the simulation speed to 14400 seconds per realtime second Set sim speed 14400 /Simulation Speed false "openspace.time.interpolateDeltaTime(14400)" +Shift+1 Setting the simulation speed to 28800 seconds per realtime second Set sim speed 28800 /Simulation Speed false "openspace.time.interpolateDeltaTime(28800)" +Shift+2 Setting the simulation speed to 57600 seconds per realtime second Set sim speed 57600 /Simulation Speed false "openspace.time.interpolateDeltaTime(57600)" +Shift+3 Setting the simulation speed to 115200 seconds per realtime second Set sim speed 115200 /Simulation Speed false "openspace.time.interpolateDeltaTime(115200)" +Shift+4 Setting the simulation speed to 230400 seconds per realtime second Set sim speed 230400 /Simulation Speed false "openspace.time.interpolateDeltaTime(230400)" +Shift+5 Setting the simulation speed to 460800 seconds per realtime second Set sim speed 460800 /Simulation Speed false "openspace.time.interpolateDeltaTime(460800)" +Shift+6 Setting the simulation speed to 921600 seconds per realtime second Set sim speed 921600 /Simulation Speed false "openspace.time.interpolateDeltaTime(921600)" +Shift+7 Setting the simulation speed to 1843200 seconds per realtime second Set sim speed 1843200 /Simulation Speed false "openspace.time.interpolateDeltaTime(1843200)" +Shift+8 Setting the simulation speed to 3686400 seconds per realtime second Set sim speed 3686400 /Simulation Speed false "openspace.time.interpolateDeltaTime(3686400)" +Shift+9 Setting the simulation speed to 7372800 seconds per realtime second Set sim speed 7372800 /Simulation Speed false "openspace.time.interpolateDeltaTime(7372800)" +Shift+0 Setting the simulation speed to 14745600 seconds per realtime second Set sim speed 14745600 /Simulation Speed false "openspace.time.interpolateDeltaTime(14745600)" + +#Time +absolute 2016-07-01T10:05:00.00 + +#Camera +setNavigationState "Juno" "Root" 1.243398E8, 7.176068E7, -1.519733E7 -0.377400E0, 0.764573E0, 0.522492E0 + +#MarkNodes +Jupiter +Juno diff --git a/data/assets/messenger.profile b/data/assets/messenger.profile new file mode 100644 index 0000000000..8a508388d9 --- /dev/null +++ b/data/assets/messenger.profile @@ -0,0 +1,41 @@ +#Version +1.0 + +#Module +Volume asset.require('scene/solarsystem/missions/messenger/mercurymagnetosphere') openspace.printWarning("Volume module is not loaded, skipping asset: mercurymagnetosphere") + +#Asset +scene/solarsystem/missions/messenger/messengerSC required + +#Keybinding +1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)" +2 Setting the simulation speed to 5 seconds per realtime second Set sim speed 5 /Simulation Speed false "openspace.time.interpolateDeltaTime(5)" +3 Setting the simulation speed to 10 seconds per realtime second Set sim speed 10 /Simulation Speed false "openspace.time.interpolateDeltaTime(10)" +4 Setting the simulation speed to 20 seconds per realtime second Set sim speed 20 /Simulation Speed false "openspace.time.interpolateDeltaTime(20)" +5 Setting the simulation speed to 40 seconds per realtime second Set sim speed 40 /Simulation Speed false "openspace.time.interpolateDeltaTime(40)" +6 Setting the simulation speed to 90 seconds per realtime second Set sim speed 90 /Simulation Speed false "openspace.time.interpolateDeltaTime(90)" +7 Setting the simulation speed to 360 seconds per realtime second Set sim speed 360 /Simulation Speed false "openspace.time.interpolateDeltaTime(360)" +8 Setting the simulation speed to 720 seconds per realtime second Set sim speed 720 /Simulation Speed false "openspace.time.interpolateDeltaTime(720)" +9 Setting the simulation speed to 2880 seconds per realtime second Set sim speed 2880 /Simulation Speed false "openspace.time.interpolateDeltaTime(2880)" +0 Setting the simulation speed to 14400 seconds per realtime second Set sim speed 14400 /Simulation Speed false "openspace.time.interpolateDeltaTime(14400)" +Shift+1 Setting the simulation speed to 28800 seconds per realtime second Set sim speed 28800 /Simulation Speed false "openspace.time.interpolateDeltaTime(28800)" +Shift+2 Setting the simulation speed to 57600 seconds per realtime second Set sim speed 57600 /Simulation Speed false "openspace.time.interpolateDeltaTime(57600)" +Shift+3 Setting the simulation speed to 115200 seconds per realtime second Set sim speed 115200 /Simulation Speed false "openspace.time.interpolateDeltaTime(115200)" +Shift+4 Setting the simulation speed to 230400 seconds per realtime second Set sim speed 230400 /Simulation Speed false "openspace.time.interpolateDeltaTime(230400)" +Shift+5 Setting the simulation speed to 460800 seconds per realtime second Set sim speed 460800 /Simulation Speed false "openspace.time.interpolateDeltaTime(460800)" +Shift+6 Setting the simulation speed to 921600 seconds per realtime second Set sim speed 921600 /Simulation Speed false "openspace.time.interpolateDeltaTime(921600)" +Shift+7 Setting the simulation speed to 1843200 seconds per realtime second Set sim speed 1843200 /Simulation Speed false "openspace.time.interpolateDeltaTime(1843200)" +Shift+8 Setting the simulation speed to 3686400 seconds per realtime second Set sim speed 3686400 /Simulation Speed false "openspace.time.interpolateDeltaTime(3686400)" +Shift+9 Setting the simulation speed to 7372800 seconds per realtime second Set sim speed 7372800 /Simulation Speed false "openspace.time.interpolateDeltaTime(7372800)" +Shift+0 Setting the simulation speed to 14745600 seconds per realtime second Set sim speed 14745600 /Simulation Speed false "openspace.time.interpolateDeltaTime(14745600)" + +#Time +absolute 2011 MAY 13 00:05:18 + +#Camera +setNavigationState "Mercury" "Root" 2.423690E11, 1.979038E11, -2.241483E10 -0.492046E0, 0.666088E0, 0.560551E0 + +#MarkNodes +Mercury +Messenger +Sun diff --git a/data/assets/newhorizons.profile b/data/assets/newhorizons.profile new file mode 100644 index 0000000000..ff3a46a096 --- /dev/null +++ b/data/assets/newhorizons.profile @@ -0,0 +1,60 @@ +#Version +1.0 + +#Asset +scene/solarsystem/missions/newhorizons/newhorizons required +scene/solarsystem/missions/newhorizons/model required + +#Property +setPropertyValueSingle NavigationHandler.OrbitalNavigator.FollowAnchorNodeRotationDistance 20.000000 +setPropertyValueSingle Scene.Pluto.Renderable.Enabled false +setPropertyValueSingle Scene.Charon.Renderable.Enabled false +setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false + +#Keybinding +a Sets the focus of the camera on 'NewHorizons'. Focus on New Horizons /New Horizons false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'NewHorizons');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)" +SHIFT+a Sets the focus of the camera on 'NewHorizons'. Anchor at New Horizons, Aim at Pluto /New Horizons false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'NewHorizons');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', 'Pluto');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)" +s Sets the focus of the camera on 'Pluto' Focus on Pluto /New Horizons false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Pluto') ;openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)" +d Sets the focus of the camera on 'Charon'. Focus on New Charon /New Horizons false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Charon');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)" +F7 Toggles New Horizons image projection. Toggle NH Image Projection /New Horizons false [[local enabled = openspace.getPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.PerformProjection'); openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.PerformProjection', not enabled); openspace.setPropertyValue('Scene.CharonProjection.Renderable.ProjectionComponent.PerformProjection', not enabled)]] +F8 Removes all image projections from Pluto and Charon. Clear image projections /New Horizons false "openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.ClearAllProjections', true); openspace.setPropertyValue('Scene.CharonProjection.Renderable.ProjectionComponent.ClearAllProjections', true)" +F9 Jumps to the 14th of July 2015 at 0900 UTC and clears all projections. Reset time and projections /New Horizons false "openspace.time.setTime('2015-07-14T09:00:00.00');openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.ClearAllProjections', true);openspace.setPropertyValue('Scene.CharonProjection.Renderable.ProjectionComponent.ClearAllProjections', true)" +KP_8 Increases the height map exaggeration on Pluto. Pluto HeightExaggeration + /New Horizons false propertyHelper.increment('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000) +CTRL+I Increases the height map exaggeration on Pluto. Pluto HeightExaggeration + /New Horizons false propertyHelper.increment('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000) +KP_2 Decreases the height map exaggeration on Pluto. Pluto HeightExaggeration - /New Horizons false propertyHelper.decrement('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000) +CTRL+K Decreases the height map exaggeration on Pluto. Pluto HeightExaggeration - /New Horizons false propertyHelper.decrement('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000) +KP_9 Increases the height map exaggeration on Charon. Charon HeightExaggeration + /New Horizons false propertyHelper.increment('Scene.CharonProjection.Renderable.HeightExaggeration', 5000) +CTRL+O Increases the height map exaggeration on Charon. Charon HeightExaggeration + /New Horizons false propertyHelper.increment('Scene.CharonProjection.Renderable.HeightExaggeration', 5000) +KP_3 Decreases the height map exaggeration on Charon. Charon HeightExaggeration - /New Horizons false propertyHelper.decrement('Scene.CharonProjection.Renderable.HeightExaggeration', 5000) +CTRL+L Decreases the height map exaggeration on Charon. Charon HeightExaggeration - /New Horizons false propertyHelper.decrement('Scene.CharonProjection.Renderable.HeightExaggeration', 5000) +o Toggles the visibility of the trail behind Pluto. Toggle Pluto Trail /New Horizons false propertyHelper.invert('Scene.PlutoBarycentricTrail.Renderable.Enabled') +j Toggles the visibility of the text labels of Pluto, Charon, Hydra, Nix, Kerberos, and Styx. Toggle Pluto Labels /New Horizons false renderableHelper.toggle('Scene.PlutoText') .. renderableHelper.toggle('Scene.CharonText') .. renderableHelper.toggle('Scene.HydraText') .. renderableHelper.toggle('Scene.NixText') .. renderableHelper.toggle('Scene.KerberosText') .. renderableHelper.toggle('Scene.StyxText') +l Toggles the visibility of the labels for the New Horizons instruments. Toggle New Horizons Labels /New Horizons false propertyHelper.fadeInOut('Scene.Labels.Renderable.Opacity', 2.0) +m Draws the instrument field of views in a solid color or as lines. Toggle instrument FOVs /New Horizons false propertyHelper.invert('Scene.NH_LORRI.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_LEISA.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_PAN1.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_PAN2.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_RED.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_BLUE.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_FT.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_METHANE.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_RALPH_MVIC_NIR.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_ALICE_AIRGLOW.Renderable.SolidDraw') .. propertyHelper.invert('Scene.NH_ALICE_SOC.Renderable.SolidDraw') +Shift+t Toggles the visibility of the shadow visualization of Pluto and Charon. Toggle Shadows /New Horizons false renderableHelper.toggle('Scene.PlutoShadow') .. renderableHelper.toggle('Scene.CharonShadow') +t Toggles the trail of New Horizons. Toggle NH Trail /New Horizons false renderableHelper.toggle('Scene.NewHorizonsTrailPluto') +h Disables visibility of the trails Hide Trails /Rendering false "local list = openspace.getProperty('*Trail.Renderable.Enabled'); for _,v in pairs(list) do openspace.setPropertyValueSingle(v, not openspace.getPropertyValue(v)) end" +1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)" +2 Setting the simulation speed to 5 seconds per realtime second Set sim speed 5 /Simulation Speed false "openspace.time.interpolateDeltaTime(5)" +3 Setting the simulation speed to 10 seconds per realtime second Set sim speed 10 /Simulation Speed false "openspace.time.interpolateDeltaTime(10)" +4 Setting the simulation speed to 20 seconds per realtime second Set sim speed 20 /Simulation Speed false "openspace.time.interpolateDeltaTime(20)" +5 Setting the simulation speed to 40 seconds per realtime second Set sim speed 40 /Simulation Speed false "openspace.time.interpolateDeltaTime(40)" +6 Setting the simulation speed to 60 seconds per realtime second Set sim speed 60 /Simulation Speed false "openspace.time.interpolateDeltaTime(60)" +7 Setting the simulation speed to 120 seconds per realtime second Set sim speed 120 /Simulation Speed false "openspace.time.interpolateDeltaTime(120)" +8 Setting the simulation speed to 360 seconds per realtime second Set sim speed 360 /Simulation Speed false "openspace.time.interpolateDeltaTime(360)" +9 Setting the simulation speed to 540 seconds per realtime second Set sim speed 540 /Simulation Speed false "openspace.time.interpolateDeltaTime(540)" +0 Setting the simulation speed to 1080 seconds per realtime second Set sim speed 1080 /Simulation Speed false "openspace.time.interpolateDeltaTime(1080)" +Shift+1 Setting the simulation speed to 2160 seconds per realtime second Set sim speed 2160 /Simulation Speed false "openspace.time.interpolateDeltaTime(2160)" +Shift+2 Setting the simulation speed to 4320 seconds per realtime second Set sim speed 4320 /Simulation Speed false "openspace.time.interpolateDeltaTime(4320)" +Shift+3 Setting the simulation speed to 8640 seconds per realtime second Set sim speed 8640 /Simulation Speed false "openspace.time.interpolateDeltaTime(8640)" + +#Time +absolute 2015-07-14T08:00:00.00 + +#Camera +setNavigationState "NewHorizons" "Root" -6.572656E1, -7.239404E1, -2.111890E1 0.102164, -0.362945, 0.926193 + +#MarkNodes +Pluto +NewHorizons +Charon diff --git a/data/assets/osirisrex.profile b/data/assets/osirisrex.profile new file mode 100644 index 0000000000..eec35f2466 --- /dev/null +++ b/data/assets/osirisrex.profile @@ -0,0 +1,45 @@ +#Version +1.0 + +#Asset +scene/solarsystem/missions/osirisrex/model required +scene/solarsystem/missions/osirisrex/osirisrex required + +#Property +setPropertyValueSingle NavigationHandler.OrbitalNavigator.FollowAnchorNodeRotationDistance 20.000000 +setPropertyValueSingle Scene.Pluto.Renderable.Enabled false +setPropertyValueSingle Scene.Charon.Renderable.Enabled false +setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false + +#Keybinding +a Sets the focus of the camera on 'OsirisRex'. Focus on OsirisRex /Missions/Osiris Rex false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'OsirisRex'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)" +s Sets the focus of the camera on 'Bennu' Focus on Bennu /Missions/Osiris Rex false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'BennuBarycenter'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)" +F8 Sets the time to the approach at Bennu. Set Bennu approach time /Missions/Osiris Rex false "openspace.printInfo('Set time: Approach'); openspace.time.setTime('2018-SEP-11 21:31:01.183')" +F9 Sets the time to the preliminary survey of Bennu. Set Bennu survey time /Missions/Osiris Rex false "openspace.printInfo('Set time: Preliminary Survey'); openspace.time.setTime('2018-NOV-20 01:13:12.183')" +F10 Sets the time to the orbital B event. Set orbital B event time /Missions/Osiris Rex false "openspace.printInfo('Set time: Orbital B'); openspace.time.setTime('2019-APR-08 10:35:27.186')" +F11 Sets the time to the recon event. Set recon event time /Missions/Osiris Rex false "openspace.printInfo('Set time: Recon'); openspace.time.setTime('2019-MAY-25 03:50:31.195')" +q Toggles the visibility of the text marking the location of the Sun. Toggle Sun marker /Missions/Osiris Rex false propertyHelper.invert('Scene.SunMarker.Renderable.Enabled') +1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)" +2 Setting the simulation speed to 5 seconds per realtime second Set sim speed 5 /Simulation Speed false "openspace.time.interpolateDeltaTime(5)" +3 Setting the simulation speed to 10 seconds per realtime second Set sim speed 10 /Simulation Speed false "openspace.time.interpolateDeltaTime(10)" +4 Setting the simulation speed to 20 seconds per realtime second Set sim speed 20 /Simulation Speed false "openspace.time.interpolateDeltaTime(20)" +5 Setting the simulation speed to 40 seconds per realtime second Set sim speed 40 /Simulation Speed false "openspace.time.interpolateDeltaTime(40)" +6 Setting the simulation speed to 60 seconds per realtime second Set sim speed 60 /Simulation Speed false "openspace.time.interpolateDeltaTime(60)" +7 Setting the simulation speed to 120 seconds per realtime second Set sim speed 120 /Simulation Speed false "openspace.time.interpolateDeltaTime(120)" +8 Setting the simulation speed to 360 seconds per realtime second Set sim speed 360 /Simulation Speed false "openspace.time.interpolateDeltaTime(360)" +9 Setting the simulation speed to 540 seconds per realtime second Set sim speed 540 /Simulation Speed false "openspace.time.interpolateDeltaTime(540)" +0 Setting the simulation speed to 1080 seconds per realtime second Set sim speed 1080 /Simulation Speed false "openspace.time.interpolateDeltaTime(1080)" +Shift+1 Setting the simulation speed to 2160 seconds per realtime second Set sim speed 2160 /Simulation Speed false "openspace.time.interpolateDeltaTime(2160)" +Shift+2 Setting the simulation speed to 4320 seconds per realtime second Set sim speed 4320 /Simulation Speed false "openspace.time.interpolateDeltaTime(4320)" +Shift+3 Setting the simulation speed to 8640 seconds per realtime second Set sim speed 8640 /Simulation Speed false "openspace.time.interpolateDeltaTime(8640)" + +#Time +absolute 2018 10 30 23:00:00.500 + +#Camera +setNavigationState "OsirisRex" 26974590199.661884, 76314608558.908020, -127086452897.101791 + +#MarkNodes +OsirisRex +BennuBarycenter +Earth diff --git a/data/assets/rosetta.profile b/data/assets/rosetta.profile new file mode 100644 index 0000000000..0b0bd37881 --- /dev/null +++ b/data/assets/rosetta.profile @@ -0,0 +1,35 @@ +#Version +1.0 + +#Module +Volume asset.require('scene/solarsystem/missions/messenger/mercurymagnetosphere') openspace.printWarning("Volume module is not loaded, skipping asset: mercurymagnetosphere") + +#Asset +scene/solarsystem/missions/rosetta/67p required +scene/solarsystem/missions/rosetta/rosetta required + +#Property +setPropertyValue Scene.67P.Renderable.PerformShading false +setPropertyValue Scene.ImagePlaneRosetta.Renderable.Enabled false + +#Keybinding +a Sets the focus of the camera on '67P'. Focus on 67P /Missions/Rosetta false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', '67P'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)" +s Sets the focus of the camera on 'Rosetta' Focus on Rosetta /Missions/Rosetta false "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Rosetta'); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', ''); openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)" +F5 Jumps to the time of initial approach of Rosetta to 67P. Set initial approach time /Missions/Rosetta false "openspace.time.setTime('2014-08-01T03:05:18.101')" +F6 Jumps to the time when the Philae lander is released. Set lander release time /Missions/Rosetta false "openspace.time.setTime('2014-11-12T08:20:00.00')" +F8 Removes all image projections from 67P. Clear 67P projections /Missions/Rosetta false "openspace.setPropertyValue('Scene.67P.Renderable.ProjectionComponent.ClearAllProjections', true)" +e Toggles the visibility of all trails further from the Sun than 67P. Toggle outer planetary trails /Missions/Rosetta false renderableHelper.toggle('Scene.JupiterTrail')..renderableHelper.toggle('Scene.SaturnTrail')..renderableHelper.toggle('Scene.UranusTrail')..renderableHelper.toggle('Scene.NeptuneTrail') +i Toggles the visibility of the free floating image plane. Toggle image plane /Missions/Rosetta false renderableHelper.toggle('Scene.ImagePlaneRosetta') +g Toggles the visibility of Philae's trail. Toggle Philae trail /Missions/Rosetta false renderableHelper.toggle('Scene.PhilaeTrail') +p Enables or disables the image projection on 67P. Toggle 67P projection /Missions/Rosetta false propertyHelper.invert('Scene.67P.Renderable.ProjectionComponent.PerformProjection') + +#Time +absolute 2014-08-01T03:05:00.000 + +#Camera +setNavigationState "67P" "Root" -7.294781E5 , -6.657894E5, 2.509047E6 0.146529E0, 0.944727E0, 0.293290E0 + +#MarkNodes +67P +Rosetta +Philae diff --git a/data/assets/touch.profile b/data/assets/touch.profile new file mode 100644 index 0000000000..237a1c79b5 --- /dev/null +++ b/data/assets/touch.profile @@ -0,0 +1,25 @@ +#Version +1.0 + +#Module +Touch local webGui = asset.require('util/webgui'); webGui.setCefRoute("ontouch") openspace.printFatal('Could not load scene due to missing module "touch"') + +#Asset +scene/solarsystem/planets/earth/earth required +util/webgui required + +#Property +setPropertyValueSingle Scene.Pluto.Renderable.Enabled false +setPropertyValueSingle Scene.Charon.Renderable.Enabled false +setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false + +#Time +relative -1d + +#Camera +setNavigationState "Earth" 58.5877,16.1924,20000000 + +#MarkNodes +Earth +Mars +Moon diff --git a/data/assets/voyager.profile b/data/assets/voyager.profile new file mode 100644 index 0000000000..150344f1e1 --- /dev/null +++ b/data/assets/voyager.profile @@ -0,0 +1,54 @@ +#Version +1.0 + +#Asset +scene/solarsystem/planets/jupiter/minor_moons required +scene/solarsystem/planets/saturn/minor_moons required +scene/solarsystem/planets/uranus/minor_moons required +scene/solarsystem/planets/neptune/inner_moons required +scene/solarsystem/planets/neptune/irregular_prograde_moons required +scene/solarsystem/planets/neptune/irregular_retrograde_moons required +scene/solarsystem/missions/voyager/voyager1 required +scene/solarsystem/missions/voyager/voyager2 required + +#Keybinding +1 Setting the simulation speed to 1 seconds per realtime second Set sim speed 1 /Simulation Speed false "openspace.time.interpolateDeltaTime(1)" +2 Setting the simulation speed to 5 seconds per realtime second Set sim speed 5 /Simulation Speed false "openspace.time.interpolateDeltaTime(5)" +3 Setting the simulation speed to 10 seconds per realtime second Set sim speed 10 /Simulation Speed false "openspace.time.interpolateDeltaTime(10)" +4 Setting the simulation speed to 20 seconds per realtime second Set sim speed 20 /Simulation Speed false "openspace.time.interpolateDeltaTime(20)" +5 Setting the simulation speed to 40 seconds per realtime second Set sim speed 40 /Simulation Speed false "openspace.time.interpolateDeltaTime(40)" +6 Setting the simulation speed to 90 seconds per realtime second Set sim speed 90 /Simulation Speed false "openspace.time.interpolateDeltaTime(90)" +7 Setting the simulation speed to 360 seconds per realtime second Set sim speed 360 /Simulation Speed false "openspace.time.interpolateDeltaTime(360)" +8 Setting the simulation speed to 720 seconds per realtime second Set sim speed 720 /Simulation Speed false "openspace.time.interpolateDeltaTime(720)" +9 Setting the simulation speed to 2880 seconds per realtime second Set sim speed 2880 /Simulation Speed false "openspace.time.interpolateDeltaTime(2880)" +0 Setting the simulation speed to 14400 seconds per realtime second Set sim speed 14400 /Simulation Speed false "openspace.time.interpolateDeltaTime(14400)" +Shift+1 Setting the simulation speed to 28800 seconds per realtime second Set sim speed 28800 /Simulation Speed false "openspace.time.interpolateDeltaTime(28800)" +Shift+2 Setting the simulation speed to 57600 seconds per realtime second Set sim speed 57600 /Simulation Speed false "openspace.time.interpolateDeltaTime(57600)" +Shift+3 Setting the simulation speed to 115200 seconds per realtime second Set sim speed 115200 /Simulation Speed false "openspace.time.interpolateDeltaTime(115200)" +Shift+4 Setting the simulation speed to 230400 seconds per realtime second Set sim speed 230400 /Simulation Speed false "openspace.time.interpolateDeltaTime(230400)" +Shift+5 Setting the simulation speed to 460800 seconds per realtime second Set sim speed 460800 /Simulation Speed false "openspace.time.interpolateDeltaTime(460800)" +Shift+6 Setting the simulation speed to 921600 seconds per realtime second Set sim speed 921600 /Simulation Speed false "openspace.time.interpolateDeltaTime(921600)" +Shift+7 Setting the simulation speed to 1843200 seconds per realtime second Set sim speed 1843200 /Simulation Speed false "openspace.time.interpolateDeltaTime(1843200)" +Shift+8 Setting the simulation speed to 3686400 seconds per realtime second Set sim speed 3686400 /Simulation Speed false "openspace.time.interpolateDeltaTime(3686400)" +Shift+9 Setting the simulation speed to 7372800 seconds per realtime second Set sim speed 7372800 /Simulation Speed false "openspace.time.interpolateDeltaTime(7372800)" +Shift+0 Setting the simulation speed to 14745600 seconds per realtime second Set sim speed 14745600 /Simulation Speed false "openspace.time.interpolateDeltaTime(14745600)" + +#Property +setPropertyValueSingle Scene.Pluto.Renderable.Enabled false +setPropertyValueSingle Scene.Charon.Renderable.Enabled false +setPropertyValueSingle Scene.PlutoBarycenterTrail.Renderable.Enabled false + +#Time +absolute 1977 SEP 10 12:00:00 + +#Camera +setNavigationState "Voyager_1" "Root" 526781518487.171326, 257168309890.072144, -1381125204152.817383 + +#MarkNodes +Earth +Voyager 1 +Voyager 2 +Jupiter +Saturn +Uranus +Neptune diff --git a/include/openspace/engine/configuration.h b/include/openspace/engine/configuration.h index 0c8139f8c9..46ceb35780 100644 --- a/include/openspace/engine/configuration.h +++ b/include/openspace/engine/configuration.h @@ -44,6 +44,7 @@ struct Configuration { std::string windowConfiguration = "${CONFIG}/single.xml"; std::string asset; + std::string profile; std::vector globalCustomizationScripts; std::map pathTokens = { { "CACHE" , "CACHE = \"${BASE}/cache\"" } diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index e4e006ba41..b0bf52e2c0 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -108,6 +108,8 @@ private: void loadFonts(); void runGlobalCustomizationScripts(); + void configureLogging(); + std::string generateFilePath(std::string openspaceRelativePath); std::unique_ptr _scene; std::unique_ptr _assetManager; diff --git a/modules/webbrowser/src/browserinstance.cpp b/modules/webbrowser/src/browserinstance.cpp index 61f14ad7ad..f641502079 100644 --- a/modules/webbrowser/src/browserinstance.cpp +++ b/modules/webbrowser/src/browserinstance.cpp @@ -84,9 +84,14 @@ void BrowserInstance::initialize() { void BrowserInstance::loadUrl(std::string url) { ghoul_assert(_isInitialized, "BrowserInstance should be initialized"); - LDEBUG(fmt::format("Loading URL: {}", url)); - CefString cefUrl = std::move(url); - _browser->GetMainFrame()->LoadURL(cefUrl); + if (!url.empty()) { + LDEBUG(fmt::format("Loading URL: {}", url)); + CefString cefUrl = std::move(url); + _browser->GetMainFrame()->LoadURL(cefUrl); + } + else { + LWARNING("Provided browser URL is empty"); + } } bool BrowserInstance::loadLocalPath(std::string path) { diff --git a/openspace.cfg b/openspace.cfg index a4e93df633..39cba26018 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -45,8 +45,7 @@ SGCTConfig = sgct.config.single{} -- Sets the scene that is to be loaded by OpenSpace. A scene file is a description -- of all entities that will be visible during an instance of OpenSpace - -Asset = "default" +--Asset = "default" -- Asset = "default_full" -- Asset = "newhorizons" -- Asset = "rosetta" @@ -60,6 +59,11 @@ Asset = "default" -- Asset = "apollo_sites" -- Asset = "touch" +-- Sets the profile that should be loaded by OpenSpace. Profiles are going to replace +-- assets in a future versions and shouldn't be used at the same time as the 'Asset' +-- setting above +Profile = "default" + -- These scripts are executed after the initialization of each scene, thus making -- it possible to have global overrides to default values or execute other scripts -- regardless of the scene that is loaded diff --git a/scripts/convert_profile_to_scene.lua b/scripts/convert_profile_to_scene.lua new file mode 100644 index 0000000000..0b852fe290 --- /dev/null +++ b/scripts/convert_profile_to_scene.lua @@ -0,0 +1,473 @@ +version = '' +modulesTable = {} +assetsTable = {} +propertiesTable = {} +timeTable = {} +cameraTable = {} +markNodesTable = {} +keybindingsTable = {} +resultTable = {} +insideSection = false +currFunction = 'None' +currSection = 'None' +numLinesVersion = 0 +lineIndex = 1 + + +function printError(message) + print('Error @ line ' .. lineIndex .. ': ' .. message) +end + +function splitByTab(inputstr) + sep = "\t" + t = {} + for match in (inputstr .. sep):gmatch('(.-)' .. sep) do + table.insert(t, match) + end + return t; +end + +function parseVersion(line) + numLinesVersion = numLinesVersion + 1 + if numLinesVersion > 1 then + printError('Too many lines in Version section') + os.exit() + else + lineS = splitByTab(line) + if tableLen(lineS) > 1 then + printError('No tabs allowed in version entry') + os.exit() + else + version = line + end + end +end + +function parseMarkNodes(line) + lineS = splitByTab(line) + if tableLen(lineS) > 1 then + printError('No tabs allowed in MarkNodes entry') + os.exit() + else + table.insert(markNodesTable, line) + end +end + +function parseModule(line) + t = {} + t = splitByTab(line) + if tableLen(t) ~= 3 then + printError('3 fields requried in a Module entry') + os.exit() + else + table.insert(modulesTable, t) + end +end + +function parseAsset(line) + t = {} + t = splitByTab(line) + if tableLen(t) ~= 2 then + printError('2 fields required in a Asset entry') + os.exit() + else + local req = 'required' + if t[2] == 'requested' then + req = 'requested' + end + table.insert(assetsTable, {t[1], req}) + end +end + +function parseProperty(line) + t = {} + t = splitByTab(line) + if tableLen(t) ~= 3 then + printError('3 fields required in a Property entry') + os.exit() + elseif isBlank(t[1]) then + printError('Property set command (arg 1/3) is required') + os.exit() + elseif isBlank(t[2]) then + printError('Property name (arg 2/3) is required') + os.exit() + elseif isBlank(t[3]) then + printError('Property value to set (arg 3/3) is required') + os.exit() + end + + if t[1] ~= 'setPropertyValue' and t[1] ~= 'setPropertyValueSingle' then + printError('Property set command "' .. t[1] .. '" is not supported') + os.exit() + end + + table.insert(propertiesTable, t) +end + +function parseKeybinding(line) + local numReqFields = 6 + t = {} + t = splitByTab(line) + if tableLen(t) < numReqFields then + printError(numReqFields .. ' fields required in a Keybinding entry') + os.exit() + elseif isBlank(t[1]) then + printError('Keybinding key (arg 1/6) is required') + os.exit() + elseif isBlank(t[2]) then + printError('Keybinding documentation (arg 2/6) is required') + os.exit() + elseif isBlank(t[3]) then + printError('Keybinding name (arg 3/6) is required') + os.exit() + elseif isBlank(t[4]) then + printError('Keybinding GuiPath (arg 4/6) is required') + os.exit() + elseif isBlank(t[5]) then + printError('Keybinding local(T/F) (arg 5/6) is required') + os.exit() + elseif isBlank(t[6]) then + printError('Keybinding script to execute (arg 6/6) is required') + os.exit() + end + + --If there are more than 6 fields then combine the final fields together + --assuming that this is a lua script that contains tabs + if tableLen(t) > numReqFields then + for i=(numReqFields + 1),tableLen(t) do + t[numReqFields] = t[numReqFields]..t[i] + end + end + + if t[5] ~= 'true' and t[5] ~= 'false' then + printError('Keybinding local arg must be true or false') + os.exit() + end + + table.insert(keybindingsTable, { t[1], t[2], t[3], t[4], t[5], t[6] }) +end + +function parseTime(line) + t = {} + t = splitByTab(line) + if tableLen(t) ~= 2 then + printError('2 fields required in a Time entry') + os.exit() + elseif isBlank(t[1]) then + printError('Time set type (arg 1/2) is required') + os.exit() + elseif isBlank(t[2]) then + printError('Time value to set (arg 2/2) is required') + os.exit() + end + + if t[1] ~= 'absolute' and t[1] ~= 'relative' then + printError('Time set type "' .. t[1] .. '" is not supported') + os.exit() + end + + table.insert(timeTable, t) +end + +function parseCamera(line) + t = {} + t = splitByTab(line) + + local cmd = t[1] + if cmd == 'setNavigationState' then + if tableLen(t) ~= 8 then + printError('8 fields required in camera "setNavigationState" line') + os.exit() + elseif isBlank(t[2]) then + printError('Camera setNavigationState Anchor (arg 1/7) is required') + os.exit() + elseif isBlank(t[5]) then + printError('Camera setNavigationState position vector (arg 4/7) is required') + os.exit() + end + elseif cmd == 'goToGeo' then + if tableLen(t) ~= 5 then + printError('5 fields required in camera "goToGeo" line') + os.exit() + elseif isBlank(t[3]) then + printError('Camera goToGeo Latitude (arg 2/4) is required') + os.exit() + elseif isBlank(t[4]) then + printError('Camera goToGeo Longitude (arg 3/4) is required') + os.exit() + end + else + printError('Camera position command "' .. cmd .. '" is not supported') + os.exit() + end + + table.insert(cameraTable, t) +end + +function file_exists(file) + local f = io.open(file, 'rb') + if f then + f:close() + end + return f ~= nil +end + +function lines_from(file) + if not file_exists(file) then + return {} + end + lines = {} + for line in io.lines(file) do + lines[#lines + 1] = line + end + return lines +end + +function determineSection(header) + header = header:sub(2) + for _,i in pairs(parsingSections) do + if i.section == header then + currSection = i.section + currFunction = i.func + return true + end + end + return false +end + +function isBlank(line) + return line:match('%S') == nil +end + +function parseCurrentSection(line) + currFunction(line) +end + +function tableLen(T) + local size = 0 + for _ in pairs(T) do + size = size + 1 + end + return size +end + +function parseProfile(fileIn) + local lines = lines_from(fileIn) + + for k,v in pairs(lines) do + if insideSection then + if isBlank(v) then + insideSection = false + else + parseCurrentSection(v) + end + elseif v:sub(1, 1) == '#' then + if determineSection(v) then + insideSection = true + end + end + lineIndex = lineIndex + 1 + end + + resultTable['Version'] = version + resultTable['Module'] = modulesTable + resultTable['Asset'] = assetsTable + resultTable['Property'] = propertiesTable + resultTable['Time'] = timeTable + resultTable['Camera'] = cameraTable + resultTable['MarkNodes'] = markNodesTable + resultTable['Keybinding'] = keybindingsTable + + return resultTable +end + +function tableSize(T) + local size = 0 + for _ in pairs(T) do + size = size + 1 + end + return size +end + +function generateAsset(T, fileOut) + file = io.open(fileOut, 'w') + io.output(file) + + --Module section + for i,j in pairs(T['Module']) do + if not isBlank(j[2]) and not isBlank(j[3]) then + ModuleStr = ModuleStr .. 'if openspace.modules.isLoaded("' .. j[1] .. '") then\n' + ModuleStr = ModuleStr .. ' ' .. j[2] .. '\nelse\n' .. ' ' .. j[3] .. '\nend\n' + elseif not isBlank(j[3]) then + ModuleStr = ModuleStr .. 'if not openspace.modules.isLoaded("' .. j[1] .. '") then\n' + ModuleStr = ModuleStr .. ' ' .. j[3] .. '\nend\n' + elseif not isBlank(j[2]) then + ModuleStr = ModuleStr .. 'if openspace.modules.isLoaded("' .. j[1] .. '") then\n' + ModuleStr = ModuleStr .. ' ' .. j[2] .. '\nend\n' + end + end + + --Asset section + AssetStr = AssetStr .. 'asset.require("base");\n' + AssetStr = AssetStr .. 'local assetHelper = asset.require("util/asset_helper")\n' + AssetStr = AssetStr .. 'local propertyHelper = asset.require("util/property_helper")\n' + AssetStr = AssetStr .. 'local sceneHelper = asset.require("util/scene_helper")\n' + AssetStr = AssetStr .. 'local renderableHelper = asset.require("util/renderable_helper")\n' + local assetType = '' + for i,j in pairs(T['Asset']) do + if isBlank(j[2]) then + assetType = 'require' + else + if (j[2] == 'required') then + assetType = 'require' + elseif (j[2] == 'requested') then + assetType = 'request' + else + printError('Asset arg 2/2 must be either "required" or "requested"') + os.exit() + end + end + AssetStr = AssetStr .. 'asset.' .. assetType .. '("' .. j[1] .. '")\n' + end + + --Keybindings section + if not (tableSize(T['Keybinding']) == 0) then + KeyStr = KeyStr .. 'local Keybindings = {\n' + for i,j in pairs(T['Keybinding']) do + KeyStr = KeyStr..' {\n' + KeyStr = KeyStr..' Key = "' .. j[1] .. '",\n' + KeyStr = KeyStr..' Documentation = "' .. j[2] .. '",\n' + KeyStr = KeyStr..' Name = "' .. j[3] .. '",\n' + KeyStr = KeyStr..' GuiPath = "' .. j[4] .. '",\n' + KeyStr = KeyStr..' Local = ' .. j[5] .. ',\n' + KeyStr = KeyStr..' Command = ' .. j[6] .. '\n' + KeyStr = KeyStr..' },\n' + end + KeyStr = KeyStr.."}\n" + end + + --Time section + for i,j in pairs(T['Time']) do + if not (j[1] == 'absolute') and not (j[1] == 'relative') then + printError('Time arg 1/1 must be either "absolute" or "relative"') + os.exit() + elseif (j[1] == 'absolute') then + TimeStr = TimeStr .. ' openspace.time.setTime("' .. j[2] .. '")\n' + elseif (j[1] == 'relative') then + TimeStr = TimeStr .. ' local now = openspace.time.currentWallTime();' + TimeStr = TimeStr .. ' openspace.time.setTime(' + TimeStr = TimeStr .. 'openspace.time.advancedTime(now, "' .. j[2] .. '"))\n' + end + end + + --MarkNodes section + mkNodLen = tableSize(T['MarkNodes']) + if not (mkNodLen == 0) then + MarkNodesStr = MarkNodesStr .. ' openspace.markInterestingNodes({' + for i, j in pairs(T['MarkNodes']) do + MarkNodesStr = MarkNodesStr .. '"' .. j .. '"' + if (i < mkNodLen) then + MarkNodesStr = MarkNodesStr .. ', ' + end + end + MarkNodesStr = MarkNodesStr .. '})\n' + end + + --Property section + for i, j in pairs(T['Property']) do + if not (j[1] == 'setPropertyValue') and not (j[1] == 'setPropertyValueSingle') then + printError('Property arg 1/1 must be "setPropertyValue[Single]"') + os.exit() + else + PropertyStr = PropertyStr .. ' openspace.' .. j[1] .. '("' .. j[2] .. '", ' .. j[3] .. ')\n' + end + end + + --Camera section + for i,j in pairs(T['Camera']) do + if (j[1] == 'setNavigationState') then + CameraStr = CameraStr .. ' openspace.navigation.setNavigationState({' + CameraStr = CameraStr .. 'Anchor = ' .. j[2] .. ', ' + if not isBlank(j[3]) then + CameraStr = CameraStr .. 'Aim = ' .. j[3] .. ', ' + end + if not isBlank(j[4]) then + CameraStr = CameraStr .. 'ReferenceFrame = ' .. j[4] .. ', ' + end + CameraStr = CameraStr .. 'Position = {' .. j[5] .. '}, ' + if not isBlank(j[6]) then + CameraStr = CameraStr .. 'Up = {' .. j[6] .. '}, ' + end + if not isBlank(j[7]) then + CameraStr = CameraStr .. 'Yaw = ' .. j[7] .. ', ' + end + if not isBlank(j[8]) then + CameraStr = CameraStr .. 'Pitch = ' .. j[8] + end + CameraStr = CameraStr .. '})\n' + elseif (j[1] == 'goToGeo') then + CameraStr = CameraStr .. ' openspace.globebrowsing.goToGeo(' + if not isBlank(j[2]) then + CameraStr = CameraStr .. j[2] .. ', ' + end + CameraStr = CameraStr .. j[3] .. ', ' .. j[4] + if not isBlank(j[5]) then + CameraStr = CameraStr .. ', ' .. j[5] + end + CameraStr = CameraStr .. ')\n' + else + printError('Camera arg 1/1 must be "setNavigationState" or "goToGeo"') + os.exit() + end + end + + --Write the file + io.write(ModuleStr .. '\n') + io.write(AssetStr .. '\n') + io.write(KeyStr .. '\n') + io.write('asset.onInitialize(function ()\n') + io.write(TimeStr .. '\n') + if not (tableSize(T['Keybinding']) == 0) then + io.write(' sceneHelper.bindKeys(Keybindings)\n') + end + io.write(MarkNodesStr .. '\n') + io.write(PropertyStr .. '\n') + io.write(CameraStr .. '\n') + io.write('end)\n') + + io.close(file) +end + +--[[ +########################################################################################## + M a i n +########################################################################################## +]]-- + +ModuleStr = '' +AssetStr = '' +KeyStr = '' +TimeStr = '' +MarkNodesStr = '' +PropertyStr = '' +CameraStr = '' + +parsingSections = { + { section = 'Version', func = parseVersion }, + { section = 'Module', func = parseModule }, + { section = 'Asset', func = parseAsset }, + { section = 'Property', func = parseProperty }, + { section = 'Keybinding', func = parseKeybinding }, + { section = 'Time', func = parseTime }, + { section = 'Camera', func = parseCamera }, + { section = 'MarkNodes', func = parseMarkNodes } +} + +profilePathIn = openspace.profile.getProfileInputPath() +scenePathOut = openspace.profile.getSceneOutputPath() + +profileIn = profilePathIn .. '.profile' +assetOut = scenePathOut .. '.scene' + +local resultTable = parseProfile(profileIn) +generateAsset(resultTable, assetOut) diff --git a/src/engine/configuration.cpp b/src/engine/configuration.cpp index 8912f488a8..0bb27b3a89 100644 --- a/src/engine/configuration.cpp +++ b/src/engine/configuration.cpp @@ -41,6 +41,7 @@ namespace { // These are also used in the _doc include file constexpr const char* KeySGCTConfig = "SGCTConfig"; constexpr const char* KeyAsset = "Asset"; + constexpr const char* KeyProfile = "Profile"; constexpr const char* KeyGlobalCustomizationScripts = "GlobalCustomizationScripts"; constexpr const char* KeyPaths = "Paths"; constexpr const char* KeyFonts = "Fonts"; @@ -277,6 +278,7 @@ void parseLuaState(Configuration& configuration) { getValue(s, KeySGCTConfig, c.windowConfiguration); getValue(s, KeyAsset, c.asset); + getValue(s, KeyProfile, c.profile); getValue(s, KeyGlobalCustomizationScripts, c.globalCustomizationScripts); getValue(s, KeyPaths, c.pathTokens); getValue(s, KeyFonts, c.fonts); diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index f907f0087f..9716e99a3c 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -99,6 +99,9 @@ namespace { constexpr const char* _loggerCat = "OpenSpaceEngine"; constexpr const int CacheVersion = 1; + constexpr const char* ProfileToSceneConverter + = "${BASE}/scripts/convert_profile_to_scene.lua"; + } // namespace namespace openspace { @@ -293,6 +296,48 @@ void OpenSpaceEngine::initialize() { LDEBUG("Registering Lua libraries"); registerCoreClasses(global::scriptEngine); + // Convert profile to scene file (if was provided in configuration file) + if (!global::configuration.profile.empty()) { + LINFO( + fmt::format("Run Lua script to convert {}.profile to scene", + global::configuration.profile) + ); + ghoul::lua::LuaState lState; + + // We can't use the absPath function here because we pass the path into the Lua + // function, which requires additional escaping + std::string inputProfilePath = generateFilePath("${ASSETS}"); + std::string outputScenePath = generateFilePath("${TEMPORARY}"); + + std::string setProfileFilenameInLuaState = fmt::format(R"( + openspace = {{}} + openspace.profile = {{}} + function openspace.profile.getFilename() + return "{}.profile" + end + function openspace.profile.getProfileInputPath() + return "{}" + end + function openspace.profile.getSceneOutputPath() + return "{}" + end + )", + global::configuration.profile, + inputProfilePath, + outputScenePath + ); + + ghoul::lua::runScript(lState, setProfileFilenameInLuaState); + ghoul::lua::runScriptFile(lState, absPath(ProfileToSceneConverter)); + + + // Set asset name to that of the profile because a new scene file will be + // created with that name, and also because the profile name will override + // an asset name if both are provided. + global::configuration.asset = + absPath("${TEMPORARY}/") + global::configuration.profile; + } + // Set up asset loader std::unique_ptr w = std::make_unique(); @@ -341,6 +386,26 @@ void OpenSpaceEngine::initialize() { LTRACE("OpenSpaceEngine::initialize(end)"); } +std::string OpenSpaceEngine::generateFilePath(std::string openspaceRelativePath) { + std::string path = absPath(openspaceRelativePath); + // Needs to handle either windows (which seems to require double back-slashes) + // or unix path slashes. + const std::string search = "\\"; + const std::string replace = "\\\\"; + if (path.find(search) != std::string::npos) { + size_t start_pos = 0; + while ((start_pos = path.find(search, start_pos)) != std::string::npos) { + path.replace(start_pos, search.length(), replace); + start_pos += replace.length(); + } + path.append(replace); + } + else { + path.append("/"); + } + return path.append(global::configuration.profile); +} + void OpenSpaceEngine::initializeGL() { LTRACE("OpenSpaceEngine::initializeGL(begin)");