Merge branch 'master' into satellite_asset

This commit is contained in:
Alexander Bock
2018-03-14 13:30:09 -04:00
257 changed files with 4113 additions and 3119 deletions
@@ -17,7 +17,7 @@ local vrt_folders = {
-- tl;dr: Specify CTX folders first, then HiRISE
-- example: 'C:/OpenSpace/GlobeBrowsingData/Mars/CTX'
'',
''
'',
},
Moon = {
-- Add folders here whose contents will be automatically added to the Moon globe
@@ -25,7 +25,6 @@ local vrt_folders = {
-- if areas overlap, images from the lower results will overwrite the images from former
-- results
-- example: 'C:/OpenSpace/GlobeBrowsingData/Moon'
'',
''
}
}
+18 -18
View File
@@ -1,5 +1,6 @@
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
@@ -19,37 +20,37 @@ asset.request('customization/globebrowsing')
local Keybindings = {
{
Key = "s",
Command = sceneHelper.property.invert('Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
sceneHelper.property.invert('Earth.RenderableGlobe.PerformShading') ..
sceneHelper.property.invert('Earth.RenderableGlobe.Atmosphere') ..
sceneHelper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled'),
Command = propertyHelper.invert('Scene.Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.PerformShading') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.Atmosphere') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled'),
Documentation = "Toggle night texture, shading, atmosphere, and water for Earth.",
Local = false
},
{
Key = "b",
Command = sceneHelper.property.invert('MilkyWay.renderable.Enabled') ..
sceneHelper.property.invert('Stars.renderable.Enabled'),
Command = propertyHelper.invert('Scene.MilkyWay.renderable.Enabled') ..
propertyHelper.invert('Scene.Stars.renderable.Enabled'),
Documentation = "Toggle background (Stars and Milkyway).",
Local = false
},
{
Key = "g",
Command = sceneHelper.property.invert('MilkyWay.renderable.Enabled') ..
sceneHelper.property.invert('Stars.renderable.Enabled') ..
sceneHelper.property.invert('Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
sceneHelper.property.invert('Earth.RenderableGlobe.PerformShading') ..
sceneHelper.property.invert('Mars.RenderableGlobe.PerformShading') ..
sceneHelper.property.invert('Earth.RenderableGlobe.Atmosphere') ..
sceneHelper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled') ..
sceneHelper.property.invert('Moon.RenderableGlobe.Enabled') ..
sceneHelper.property.invert('Sun.renderable.Enabled'),
Command = propertyHelper.invert('Scene.MilkyWay.renderable.Enabled') ..
propertyHelper.invert('Scene.Stars.renderable.Enabled') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.PerformShading') ..
propertyHelper.invert('Scene.Mars.RenderableGlobe.PerformShading') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.Atmosphere') ..
propertyHelper.invert('Scene.Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled') ..
propertyHelper.invert('Scene.Moon.RenderableGlobe.Enabled') ..
propertyHelper.invert('Scene.Sun.renderable.Enabled'),
Documentation = "Toogles background and shading mode on the Earth and Mars alongside visibility of the Moon and the Sun",
Local = false
},
{
Key = "h",
Command = "openspace.setPropertyValue('*Trail.renderable.Enabled', false)",
Command = "openspace.setPropertyValue('Scene.*Trail.renderable.Enabled', false)",
Documentation = "Disables visibility of the trails",
Local = false
},
@@ -72,11 +73,10 @@ asset.onInitialize(function ()
"Earth", "Mars", "Moon"
})
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.renderable.Enabled",
"Scene.*Trail.renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
+13 -4
View File
@@ -3,15 +3,15 @@
local assetHelper = asset.require("util/asset_helper")
asset.syncedResource({
Type = "UrlSynchronization",
Name = "Example Single",
Type = "UrlSynchronization",
Identifier = "example_single",
Url = "http://celestrak.com/NORAD/elements/geo.txt"
})
asset.syncedResource({
Type = "UrlSynchronization",
Name = "Example Multiple",
Type = "UrlSynchronization",
Identifier = "example_multiple",
Url = {
"http://celestrak.com/NORAD/elements/stations.txt",
@@ -20,14 +20,23 @@ asset.syncedResource({
})
asset.syncedResource({
Type = "UrlSynchronization",
Name = "Example Large",
Type = "UrlSynchronization",
Identifier = "example_large",
Url = "http://ipv4.download.thinkbroadband.com/100MB.zip"
Url = "http://ipv4.download.thinkbroadband.com/100MB.zip",
Override = true
})
asset.syncedResource({
Name = "Example Medium",
Type = "UrlSynchronization",
Identifier = "example_medium",
Url = "http://ipv4.download.thinkbroadband.com/5MB.zip",
Override = true
})
asset.syncedResource({
Name = "Example No ident",
Type = "UrlSynchronization",
Url = "http://ipv4.download.thinkbroadband.com/5MB.zip"
})
+29 -27
View File
@@ -1,5 +1,7 @@
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
local renderableHelper = asset.require('util/renderable_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
@@ -34,94 +36,94 @@ local Keybindings = {
},
{
Key = "F8",
Command = "openspace.setPropertyValue('Pluto.renderable.ProjectionComponent.ClearAllProjections', true);" ..
"openspace.setPropertyValue('Charon.renderable.ProjectionComponent.ClearAllProjections', true);",
Command = "openspace.setPropertyValue('Scene.Pluto.renderable.ProjectionComponent.ClearAllProjections', true);" ..
"openspace.setPropertyValue('Scene.Charon.renderable.ProjectionComponent.ClearAllProjections', true);",
Documentation = "Removes all image projections from Pluto and Charon.",
Local = false
},
{
Key = "F9",
Command = "openspace.time.setTime('2015-07-14T09:00:00.00');" ..
"openspace.setPropertyValue('Pluto.renderable.ClearAllProjections', true);" ..
"openspace.setPropertyValue('Charon.renderable.ClearAllProjections', true);",
"openspace.setPropertyValue('Scene.Pluto.renderable.ClearAllProjections', true);" ..
"openspace.setPropertyValue('Scene.Charon.renderable.ClearAllProjections', true);",
Documentation = "Jumps to the 14th of July 2015 at 0900 UTC and clears all projections.",
Local = false
},
{
Key = "KP_8",
Command = sceneHelper.property.increment('Pluto.renderable.HeightExaggeration', 5000000),
Command = propertyHelper.increment('Scene.Pluto.renderable.HeightExaggeration', 5000000),
Documentation = "Increases the height map exaggeration on Pluto.",
Local = false
},
{
Key = "KP_2",
Command = sceneHelper.property.decrement('Pluto.renderable.HeightExaggeration', 5000000),
Command = propertyHelper.decrement('Scene.Pluto.renderable.HeightExaggeration', 5000000),
Documentation = "Decreases the height map exaggeration on Pluto.",
Local = false
},
{
Key = "KP_9",
Command = sceneHelper.property.increment('Charon.renderable.HeightExaggeration', 5000000),
Command = propertyHelper.increment('Scene.Charon.renderable.HeightExaggeration', 5000000),
Documentation = "Increases the height map exaggeration on Charon.",
Local = false
},
{
Key = "KP_3",
Command = sceneHelper.property.decrement('Charon.renderable.HeightExaggeration', 5000000),
Command = propertyHelper.decrement('Scene.Charon.renderable.HeightExaggeration', 5000000),
Documentation = "Decreases the height map exaggeration on Charon.",
Local = false
},
{
Key = "q",
Command = sceneHelper.property.invert('SunMarker.renderable.Enabled'),
Command = propertyHelper.invert('Scene.SunMarker.renderable.Enabled'),
Documentation = "Toggles the visibility of the text marking the location of the Sun.",
Local = false
},
{
Key = "e",
Command = sceneHelper.property.invert('EarthMarker.renderable.Enabled'),
Command = propertyHelper.invert('Scene.EarthMarker.renderable.Enabled'),
Documentation = "Toggles the visibility of the text marking the location of the Earth.",
Local = false
},
{
Key = "o",
Command = sceneHelper.property.invert('PlutoTrail.renderable.Enabled'),
Command = propertyHelper.invert('Scene.PlutoTrail.renderable.Enabled'),
Documentation = "Toggles the visibility of the trail behind Pluto.",
Local = false
},
{
Key = "j",
Command = sceneHelper.renderable.toggle('PlutoText') .. sceneHelper.renderable.toggle('CharonText') ..
sceneHelper.renderable.toggle('HydraText') .. sceneHelper.renderable.toggle('NixText') ..
sceneHelper.renderable.toggle('KerberosText') .. sceneHelper.renderable.toggle('StyxText'),
Command = renderableHelper.toggle('Scene.PlutoText') .. renderableHelper.toggle('Scene.CharonText') ..
renderableHelper.toggle('Scene.HydraText') .. renderableHelper.toggle('Scene.NixText') ..
renderableHelper.toggle('Scene.KerberosText') .. renderableHelper.toggle('Scene.StyxText'),
Documentation = "Toggles the visibility of the text labels of Pluto, Charon, Hydra, Nix, Kerberos, and Styx.",
Local = false
},
{
Key = "l",
Command = sceneHelper.property.invert('Labels.renderable.Enabled'),
Command = propertyHelper.invert('Scene.Labels.renderable.Enabled'),
Documentation = "Toggles the visibility of the labels for the New Horizons instruments.",
Local = false
},
{
Key = "m",
Command = sceneHelper.property.invert('NH_LORRI.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_LEISA.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_PAN1.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_PAN2.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_RED.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_BLUE.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_FT.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_METHANE.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_RALPH_MVIC_NIR.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_ALICE_AIRGLOW.renderable.SolidDraw') ..
sceneHelper.property.invert('NH_ALICE_SOC.renderable.SolidDraw'),
Command = 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'),
Documentation = "Draws the instrument field of views in a solid color or as lines.",
Local = false
},
{
Key = "t",
Command = sceneHelper.renderable.toggle('PlutoShadow') .. sceneHelper.renderable.toggle('CharonShadow'),
Command = renderableHelper.toggle('Scene.PlutoShadow') .. renderableHelper.toggle('Scene.CharonShadow'),
Documentation = "Toggles the visibility of the shadow visualization of Pluto and Charon.",
Local = false
}
+3 -2
View File
@@ -1,5 +1,6 @@
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
@@ -64,13 +65,13 @@ local Keybindings = {
},
{
Key = "q",
Command = sceneHelper.property.invert('SunMarker.renderable.Enabled'),
Command = propertyHelper.invert('Scene.SunMarker.renderable.Enabled'),
Documentation = "Toggles the visibility of the text marking the location of the Sun.",
Local = false
},
{
Key = "e",
Command = sceneHelper.property.invert('EarthMarker.renderable.Enabled'),
Command = propertyHelper.invert('Scene.EarthMarker.renderable.Enabled'),
Documentation = "Toggles the visibility of the text marking the location of the Earth.",
Local = false
}
+10 -8
View File
@@ -1,5 +1,7 @@
local assetHelper = asset.require('util/asset_helper')
local sceneHelper = asset.require('util/scene_helper')
local propertyHelper = asset.require('util/property_helper')
local renderableHelper = asset.require('util/renderable_helper')
-- Specifying which other assets should be loaded in this scene
asset.require('spice/base')
@@ -41,38 +43,38 @@ local Keybindings = {
},
{
Key = "F8",
Command = "openspace.setPropertyValue('67P.renderable.ProjectionComponent.clearAllProjections', true)",
Command = "openspace.setPropertyValue('Scene.67P.renderable.ProjectionComponent.clearAllProjections', true)",
Documentation = "Removes all image projections from 67P.",
Local = false
},
{
Key = "q",
Command = sceneHelper.property.invert('SunMarker.renderable.Enabled'),
Command = propertyHelper.invert('Scene.SunMarker.renderable.Enabled'),
Documentation = "Toggles the visibility of the text marking the location of the Sun.",
Local = false
},
{
Key = "e",
Command = helper.renderable.toggle('JupiterTrail') .. helper.renderable.toggle('SaturnTrail') ..
helper.renderable.toggle('UranusTrail') .. helper.renderable.toggle('NeptuneTrail'),
Command = renderableHelper.toggle('Scene.JupiterTrail') .. renderableHelper.toggle('Scene.SaturnTrail') ..
renderableHelper.toggle('Scene.UranusTrail') .. renderableHelper.toggle('Scene.NeptuneTrail'),
Documentation = "Toggles the visibility of all trails further from the Sun than 67P.",
Local = false
},
{
Key = "i",
Command = sceneHelper.renderable.toggle('ImagePlaneRosetta'),
Command = renderableHelper.toggle('Scene.ImagePlaneRosetta'),
Documentation = "Toggles the visibility of the free floating image plane.",
Local = false
},
{
Key = "f",
Command = sceneHelper.renderable.toggle('PhilaeTrail'),
Command = renderableHelper.toggle('Scene.PhilaeTrail'),
Documentation = "Toggles the visibility of Philae's trail.",
Local = false
},
{
Key = "p",
Command = sceneHelper.property.invert('67P.renderable.ProjectionComponent.performProjection'),
Command = propertyHelper.invert('Scene.67P.renderable.ProjectionComponent.performProjection'),
Documentation = "Enables or disables the image projection on 67P.",
Local = false
}
@@ -129,7 +131,7 @@ asset.onInitialize(function ()
Rotation = { -0.106166, 0.981574, -0.084545, 0.134513 },
})
openspace.setPropertyValue('67P.renderable.PerformShading', false);
openspace.setPropertyValue('Scene.67P.renderable.PerformShading', false);
end)
asset.onDeinitialize(function ()
@@ -23,7 +23,7 @@ local wmap = {
Enabled = false,
Size = 3975.41417036064E23,
Segments = 80,
Alpha = 0.5,
Opacity = 0.5,
Texture = textures .. "/wmap_ilc_7yr_v4_200uK_RGB_sos.png",
Orientation = "Inside/Outside",
FadeInThreshould = 8E26
@@ -39,7 +39,7 @@ local cbe = {
Enabled = false,
Size = 3975.41417036064E23,
Segments = 80,
Alpha = 0.5,
Opacity = 0.5,
Texture = textures .. "/COBErect.png",
Orientation = "Inside/Outside",
FadeInThreshould = 8E26
@@ -54,7 +54,7 @@ local planck = {
Enabled = false,
Size = 3975.41417036064E23,
Segments = 80,
Alpha = 0.3,
Opacity = 0.3,
Texture = textures .. "/cmb4k.jpg",
Orientation = "Inside/Outside",
FadeInThreshould = 8E26
@@ -29,7 +29,7 @@ local sphere = {
Type = "RenderableSphere",
Size = 9.2E20,
Segments = 40,
Alpha = 0.4,
Opacity = 0.4,
Texture = sphereTextures .. "/DarkUniverse_mellinger_4k.jpg",
Orientation = "Inside/Outside",
FadeOutThreshould = 0.25
@@ -15,7 +15,7 @@ local object = {
Type = "RenderableSphere",
Size = 9.2E20,
Segments = 40,
Alpha = 0.4,
Opacity = 0.4,
Texture = textures .. "/eso0932a_blend.png",
Orientation = "Inside/Outside",
FadeOutThreshould = 0.01
@@ -2,19 +2,15 @@ asset.request('./bennu')
asset.request('./model')
asset.request('./trail')
asset.require('./script_schedule')
local mission = asset.localResource('osirisrex.mission')
local missionName
local scriptSchedule = asset.localResource("scheduled_scripts.lua")
asset.onInitialize(function()
missionName = openspace.loadMission(mission)
openspace.scriptScheduler.loadFile(scriptSchedule)
end)
asset.onDeinitialize(function()
openspace.unloadMission(missionName)
-- openspace.scriptScheduler.unloadFile
end)
@@ -1,14 +0,0 @@
dofile(openspace.absPath("${SCRIPTS}/common.lua"))
return {
helper.scheduledScript.setEnabled("2016 SEP 08 23:05:00", "OsirisRexTrailSolarSystem", false),
helper.scheduledScript.setEnabled("2016 SEP 08 23:05:00", "OsirisRexTrailBennu", false),
helper.scheduledScript.reversible.setEnabled("2016 SEP 08 23:05:01", "OsirisRexTrailEarth", true),
helper.scheduledScript.reversible.setEnabled("2016 SEP 09 00:00:00", "OsirisRexTrailSolarSystem", true),
helper.scheduledScript.reversible.setEnabled("2016 SEP 09 02:00:00", "OsirisRexTrailEarth", false),
helper.scheduledScript.reversible.setEnabled("2018 OCT 11 00:00:00", "OsirisRexTrailBennu", true),
helper.scheduledScript.reversible.setEnabled("2018 OCT 15 00:00:00", "OsirisRexTrailSolarSystem", false),
helper.scheduledScript.reversible.setEnabled("2019 AUG 01 00:00:00", "OsirisRexTrailSolarSystem", true),
helper.scheduledScript.reversible.setEnabled("2019 AUG 01 00:00:00", "OsirisRexTrailBennu", false),
}
@@ -0,0 +1,18 @@
local scriptSchedulerHelper = asset.require('util/script_scheduler_helper')
asset.onInitialize(function ()
scriptSchedulerHelper.scheduleRenderableEnabled("2016 SEP 08 23:05:00", "OsirisRexTrailSolarSystem", false)
scriptSchedulerHelper.scheduleRenderableEnabled("2016 SEP 08 23:05:00", "OsirisRexTrailBennu", false)
scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 08 23:05:01", "OsirisRexTrailEarth", true)
scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 09 00:00:00", "OsirisRexTrailSolarSystem", true)
scriptSchedulerHelper.scheduleRenderableEnabledReversable("2016 SEP 09 02:00:00", "OsirisRexTrailEarth", false)
scriptSchedulerHelper.scheduleRenderableEnabledReversable("2018 OCT 11 00:00:00", "OsirisRexTrailBennu", true)
scriptSchedulerHelper.scheduleRenderableEnabledReversable("2018 OCT 15 00:00:00", "OsirisRexTrailSolarSystem", false)
scriptSchedulerHelper.scheduleRenderableEnabledReversable("2019 AUG 01 00:00:00", "OsirisRexTrailSolarSystem", true)
scriptSchedulerHelper.scheduleRenderableEnabledReversable("2019 AUG 01 00:00:00", "OsirisRexTrailBennu", false)
end)
asset.onDeinitialize(function ()
openspace.scriptScheduler.clear()
end)
@@ -16,6 +16,7 @@ local Earth = {
Type = "RenderableGlobe",
Radii = earthEllipsoid,
SegmentsPerPatch = 64,
PerformShading = false,
Layers = {
ColorLayers = {
{
@@ -145,20 +146,10 @@ local Earth = {
Name = "Earth at Night 2012",
FilePath = mapServiceConfigsPath .. "/GIBS/night/VIIRS_CityLights_2012.wms",
Enabled = true,
Settings = {
Opacity = 1.0,
Gamma = 1.5,
Multiplier = 15.0
},
Fallback = {
Name = "Earth Night",
FilePath = texturesPath .. "/earth_night.jpg",
Enabled = true,
Settings = {
Opacity = 1.0,
Gamma = 1.5,
Multiplier = 15.0
},
Enabled = true,
}
},
{
-1
View File
@@ -93,7 +93,6 @@ local requestAll = function (asset, directory)
return End=='' or string.sub(String,-string.len(End))==End
end
-- directory = asset.localResource('') .. directory
local files = openspace.walkDirectoryFiles(asset.localResource('') .. directory, true)
for _, file in pairs(files) do
if file:ends('.asset') then
+22 -21
View File
@@ -1,23 +1,24 @@
local helper = asset.require('./scene_helper')
local sceneHelper = asset.require('./scene_helper')
local propertyHelper = asset.require('./property_helper')
local Keybindings = {
{
Key = "F2",
Command =
[[local b = openspace.getPropertyValue('Global Properties.ImGUI.Main.Properties.Enabled');
local c = openspace.getPropertyValue('Global Properties.ImGUI.Main.IsHidden');
openspace.setPropertyValue('Global Properties.ImGUI.*.Enabled', false);
[[local b = openspace.getPropertyValue('Modules.ImGUI.Main.Scene Properties.Enabled');
local c = openspace.getPropertyValue('Modules.ImGUI.Main.IsHidden');
openspace.setPropertyValue('Modules.ImGUI.*.Enabled', false);
if b and c then
-- This can happen if the main properties window is enabled, the main gui is enabled
-- and then closed again. So the main properties window is enabled, but also all
-- windows are hidden
openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.IsHidden', false);
openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.Properties.Enabled', true);
openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.Space/Time.Enabled', true);
openspace.setPropertyValueSingle('Modules.ImGUI.Main.IsHidden', false);
openspace.setPropertyValueSingle('Modules.ImGUI.Main.Scene Properties.Enabled', true);
openspace.setPropertyValueSingle('Modules.ImGUI.Main.Space/Time.Enabled', true);
else
openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.Properties.Enabled', not b);
openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.Space/Time.Enabled', not b);
openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.IsHidden', b);
openspace.setPropertyValueSingle('Modules.ImGUI.Main.Scene Properties.Enabled', not b);
openspace.setPropertyValueSingle('Modules.ImGUI.Main.Space/Time.Enabled', not b);
openspace.setPropertyValueSingle('Modules.ImGUI.Main.IsHidden', b);
end]],
Documentation = "Shows or hides the properties window",
Local = true
@@ -25,15 +26,15 @@ end]],
{
Key = "F3",
Command =
[[local b = openspace.getPropertyValue('Global Properties.ImGUI.Main.Enabled');
openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.Enabled', not b);
openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.IsHidden', b);]],
[[local b = openspace.getPropertyValue('Modules.ImGUI.Main.Enabled');
openspace.setPropertyValueSingle('Modules.ImGUI.Main.Enabled', not b);
openspace.setPropertyValueSingle('Modules.ImGUI.Main.IsHidden', b);]],
Documentation = "Shows or hides the entire user interface",
Local = true
},
{
Key = "F4",
Command = helper.property.invert("RenderEngine.PerformanceMeasurements"),
Command = propertyHelper.invert("RenderEngine.PerformanceMeasurements"),
Documentation = "Toogles performance measurements that shows rendering time informations.",
Local = true
},
@@ -57,19 +58,19 @@ openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.IsHidden', b);]],
},
{
Key = "f",
Command = helper.property.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'),
Command = propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'),
Documentation = "Toggles the rotational friction of the camera. If it is disabled, the camera rotates around the focus object indefinitely.",
Local = false
},
{
Key = "Shift+f",
Command = helper.property.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'),
Command = propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'),
Documentation = "Toggles the zoom friction of the camera. If it is disabled, the camera rises up from or closes in towards the focus object indefinitely.",
Local = false
},
{
Key = "Ctrl+f",
Command = helper.property.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'),
Command = propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'),
Documentation = "Toggles the roll friction of the camera. If it is disabled, the camera rolls around its own axis indefinitely.",
Local = false
},
@@ -84,9 +85,9 @@ openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.IsHidden', b);]],
local DeltaTimeKeys
asset.onInitialize(function()
Keys = helper.bindKeys(Keybindings)
Keys = sceneHelper.bindKeys(Keybindings)
DeltaTimeKeys = helper.setDeltaTimeKeys({
DeltaTimeKeys = sceneHelper.setDeltaTimeKeys({
-- 1 2 3 4 5 6 7 8 9 0
--------------------------------------------------------------------------------------------------------------------------
-- 1s 2s 5s 10s 30s 1m 2m 5m 10m 30m
@@ -102,8 +103,8 @@ asset.onInitialize(function()
end)
asset.onDeinitialize(function ()
helper.unbindKeys(Keybindings)
helper.unbindKeys(DeltaTimeKeys)
sceneHelper.unbindKeys(Keybindings)
sceneHelper.unbindKeys(DeltaTimeKeys)
end)
asset.export("DefaultKeybindings", Keybindings)
+21
View File
@@ -0,0 +1,21 @@
-- Function that returns the string that inverts the fully qualified boolean property 'property'
local invert = function(prop)
local escaped_property = "'" .. prop .. "'"
return "openspace.setPropertyValue(" .. escaped_property .. ", not openspace.getPropertyValue(" .. escaped_property .. "));"
end
-- Function that returns the string that increments the 'property' by the 'value'
local increment = function(prop, value)
local v = value or 1
local escaped_property = "'" .. prop .. "'"
return "openspace.setPropertyValue(" .. escaped_property .. ", openspace.getPropertyValue(" .. escaped_property .. ") + " .. v .. ");"
end
-- Function that returns the string that decrements the 'property' by the 'value'
local decrement = function(prop, value)
return increment(prop, -value)
end
asset.export('invert', invert)
asset.export('increment', increment)
asset.export('decrement', decrement)
+15
View File
@@ -0,0 +1,15 @@
local propertyHelper = asset.require('./property_helper')
-- Function that returns the string that enables/disables the renderable 'renderable'
local toggle = function(renderable)
return propertyHelper.invert(renderable .. ".renderable.Enabled")
end
-- Function that returns the string that sets the enabled property of <renderable> to <enabled>
local setEnabled = function(renderable, enabled)
return "openspace.setPropertyValue('" .. renderable .. ".renderable.Enabled', " .. (enabled and "true" or "false") .. ");";
end
asset.export('toggle', toggle)
asset.export('setEnabled', setEnabled)
-8
View File
@@ -52,11 +52,3 @@ local setDeltaTimeKeys = function(t)
return result
end
asset.export("setDeltaTimeKeys", setDeltaTimeKeys)
-----------------------------------------------------------------
dofile(openspace.absPath("${SCRIPTS}/common.lua"))
asset.export("property", helper.property)
asset.export("renderable", helper.renderable)
asset.export("scheduledScript", helper.scheduledScript)
@@ -0,0 +1,24 @@
local renderableHelper = asset.require('./renderable_helper')
-- Function that schedules scripts setting the enabled property
-- of <renderable> to <enabled> at time <time>.
local scheduleRenderableEnabled = function(time, renderable, enabled)
openspace.scriptScheduler.loadScheduledScript(
time,
renderableHelper.setEnabled(renderable, enabled)
)
end
-- Function that schedules scripts setting the enabled property
-- of <renderable> to <enabled> when time <time> is passed
-- and inverts it if time is passed in reversed order.
local scheduleRenderableEnabledReversable = function(time, renderable, enabled)
openspace.scriptScheduler.loadScheduledScript(
time,
renderableHelper.setEnabled(renderable, enabled),
renderableHelper.setEnabled(renderable, not enabled)
)
end
asset.export('scheduleRenderableEnabledReversable', scheduleRenderableEnabledReversable)
asset.export('scheduleRenderableEnabled', scheduleRenderableEnabled)