diff --git a/data/assets/newhorizons.scene b/data/assets/newhorizons.scene index bea7669db1..71f77d618a 100644 --- a/data/assets/newhorizons.scene +++ b/data/assets/newhorizons.scene @@ -11,6 +11,16 @@ local renderableHelper = asset.require('util/renderable_helper') local Keybindings = { { Key = "a", + Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'NewHorizons');" .. + "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');" .. + "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)", + Documentation = "Sets the focus of the camera on 'NewHorizons'.", + Name = "Focus on New Horizons", + GuiPath = "/New Horizons", + Local = false + }, + { + Key = "SHIFT+a", Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'NewHorizons');" .. "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', 'Pluto');" .. "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)", @@ -42,9 +52,9 @@ local Keybindings = { { Key = "F7", Command = -[[local enabled = openspace.getPropertyValue('Scene.Pluto.Renderable.ProjectionComponent.PerformProjection') -openspace.setPropertyValue('Scene.Pluto.Renderable.ProjectionComponent.PerformProjection', not enabled) -openspace.setPropertyValue('Scene.Charon.Renderable.ProjectionComponent.PerformProjection', not enabled) +[[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) openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not enabled)]], Documentation = "Toggles New Horizons image projection.", Name = "Toggle NH Image Projection", @@ -63,8 +73,8 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not { Key = "F9", Command = "openspace.time.setTime('2015-07-14T09:00:00.00');" .. - "openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ClearAllProjections', true);" .. - "openspace.setPropertyValue('Scene.CharonProjection.Renderable.ClearAllProjections', true);", + "openspace.setPropertyValue('Scene.PlutoProjection.Renderable.ProjectionComponent.ClearAllProjections', true);" .. + "openspace.setPropertyValue('Scene.CharonProjection.Renderable.ProjectionComponent.ClearAllProjections', true);", Documentation = "Jumps to the 14th of July 2015 at 0900 UTC and clears all projections.", Name = "Reset time and projections", GuiPath = "/New Horizons", @@ -78,6 +88,14 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not GuiPath = "/New Horizons", Local = false }, + { + Key = "CTRL+I", + Command = propertyHelper.increment('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000), + Documentation = "Increases the height map exaggeration on Pluto.", + Name = "Pluto HeightExaggeration +", + GuiPath = "/New Horizons", + Local = false + }, { Key = "KP_2", Command = propertyHelper.decrement('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000), @@ -86,6 +104,14 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not GuiPath = "/New Horizons", Local = false }, + { + Key = "CTRL+K", + Command = propertyHelper.decrement('Scene.PlutoProjection.Renderable.HeightExaggeration', 5000), + Documentation = "Decreases the height map exaggeration on Pluto.", + Name = "Pluto HeightExaggeration -", + GuiPath = "/New Horizons", + Local = false + }, { Key = "KP_9", Command = propertyHelper.increment('Scene.CharonProjection.Renderable.HeightExaggeration', 5000), @@ -94,6 +120,14 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not GuiPath = "/New Horizons", Local = false }, + { + Key = "CTRL+O", + Command = propertyHelper.increment('Scene.CharonProjection.Renderable.HeightExaggeration', 5000), + Documentation = "Increases the height map exaggeration on Charon.", + Name = "Charon HeightExaggeration +", + GuiPath = "/New Horizons", + Local = false + }, { Key = "KP_3", Command = propertyHelper.decrement('Scene.CharonProjection.Renderable.HeightExaggeration', 5000), @@ -102,6 +136,14 @@ openspace.setPropertyValueSingle("Dashboard.NewHorizonsInstruments.Enabled", not GuiPath = "/New Horizons", Local = false }, + { + Key = "CTRL+L", + Command = propertyHelper.decrement('Scene.CharonProjection.Renderable.HeightExaggeration', 5000), + Documentation = "Decreases the height map exaggeration on Charon.", + Name = "Charon HeightExaggeration -", + GuiPath = "/New Horizons", + Local = false + }, { Key = "o", Command = propertyHelper.invert('Scene.PlutoBarycentricTrail.Renderable.Enabled'), diff --git a/data/assets/rosetta.scene b/data/assets/rosetta.scene index d8d854a471..85f3e07444 100644 --- a/data/assets/rosetta.scene +++ b/data/assets/rosetta.scene @@ -13,13 +13,17 @@ asset.require('scene/solarsystem/missions/rosetta/rosetta') local Keybindings = { { Key = "a", - Command = "openspace.setPropertyValue('NavigationHandler.Origin', '67P')", + Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', '67P');" .. + "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');" .. + "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)", Documentation = "Sets the focus of the camera on '67P'.", Local = false }, { Key = "s", - Command = "openspace.setPropertyValue('NavigationHandler.Origin', 'Rosetta')", + Command = "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Anchor', 'Rosetta');" .. + "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.Aim', '');" .. + "openspace.setPropertyValue('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil)", Documentation = "Sets the focus of the camera on 'Rosetta'", Local = false }, @@ -37,7 +41,7 @@ local Keybindings = { }, { Key = "F8", - Command = "openspace.setPropertyValue('Scene.67P.Renderable.ProjectionComponent.clearAllProjections', true)", + Command = "openspace.setPropertyValue('Scene.67P.Renderable.ProjectionComponent.ClearAllProjections', true)", Documentation = "Removes all image projections from 67P.", Local = false }, @@ -61,14 +65,14 @@ local Keybindings = { Local = false }, { - Key = "f", + Key = "g", Command = renderableHelper.toggle('Scene.PhilaeTrail'), Documentation = "Toggles the visibility of Philae's trail.", Local = false }, { Key = "p", - Command = propertyHelper.invert('Scene.67P.Renderable.ProjectionComponent.performProjection'), + Command = propertyHelper.invert('Scene.67P.Renderable.ProjectionComponent.PerformProjection'), Documentation = "Enables or disables the image projection on 67P.", Local = false } @@ -117,6 +121,8 @@ asset.onInitialize(function () }) openspace.setPropertyValue('Scene.67P.Renderable.PerformShading', false); + openspace.setPropertyValue('Scene.ImagePlaneRosetta.Renderable.Enabled', false); + end) asset.onDeinitialize(function () diff --git a/data/assets/scene/solarsystem/missions/rosetta/67p.asset b/data/assets/scene/solarsystem/missions/rosetta/67p.asset index 475f33ed04..c5882719df 100644 --- a/data/assets/scene/solarsystem/missions/rosetta/67p.asset +++ b/data/assets/scene/solarsystem/missions/rosetta/67p.asset @@ -21,9 +21,11 @@ local images = asset.syncedResource({ Name = "Rosetta Images", Type = "HttpSynchronization", Identifier = "rosettaimages", - Version = 1 + Version = 2 }) +local imagesDestination = images .. "/images" + local Barycenter = { Identifier = "67PBarycenter", Parent = transforms.SolarSystemBarycenter.Identifier, @@ -58,7 +60,7 @@ local Comet67P = { }, ColorTexture = textures .. "/gray.jpg", Projection = { - Sequence = { images }, + Sequence = { imagesDestination }, SequenceType = "image-sequence", Observer = "ROSETTA", Target = "CHURYUMOV-GERASIMENKO", @@ -133,6 +135,13 @@ local Trail67P = { } } +asset.onInitialize(function() + if not openspace.directoryExists(imagesDestination) then + openspace.printInfo("Extracting Rosetta images") + openspace.unzipFile(images .. "/images_v1_v2.zip", imagesDestination, true) + end +end) + assetHelper.registerSceneGraphNodesAndExport(asset, { diff --git a/data/assets/util/default_keybindings.asset b/data/assets/util/default_keybindings.asset index ea03bfa37a..1d883814c7 100644 --- a/data/assets/util/default_keybindings.asset +++ b/data/assets/util/default_keybindings.asset @@ -33,6 +33,14 @@ local Keybindings = { GuiPath = "/Rendering", Local = true }, + { + Key = "F12", + Name = "Take Screenshot", + Command = "openspace.setPropertyValueSingle('RenderEngine.TakeScreenshot', nil)", + Documentation = "Saves the contents of the screen to a file in the working directory.", + GuiPath = "/Rendering", + Local = true + }, { Key = "SPACE", Name = "Toggle Pause (Interpolated)", @@ -115,7 +123,7 @@ openspace.setPropertyValueSingle("RenderEngine.ShowCamera", not isEnabled)]], local DeltaTimeKeys asset.onInitialize(function() - Keys = sceneHelper.bindKeys(Keybindings) + sceneHelper.bindKeys(Keybindings) DeltaTimeKeys = sceneHelper.setDeltaTimeKeys({ -- 1 2 3 4 5 6 7 8 9 0 diff --git a/data/assets/util/scene_helper.asset b/data/assets/util/scene_helper.asset index c752797403..4144ec2b8e 100644 --- a/data/assets/util/scene_helper.asset +++ b/data/assets/util/scene_helper.asset @@ -31,6 +31,8 @@ local unbindKeys = function(keys) end asset.export("unbindKeys", unbindKeys) +local deltaTimeKeys = {} + local setDeltaTimeKeys = function(t) local Keys = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', @@ -44,6 +46,8 @@ local setDeltaTimeKeys = function(t) return end + unbindKeys(deltaTimeKeys) + result = {} for i, v in ipairs(t) do openspace.bindKeyLocal( @@ -56,6 +60,8 @@ local setDeltaTimeKeys = function(t) table.insert(result, Keys[i]) end + deltaTimeKeys = result + return result end asset.export("setDeltaTimeKeys", setDeltaTimeKeys)