diff --git a/Jenkinsfile b/Jenkinsfile index 70a9e84b13..9150da5bef 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,7 +45,7 @@ stage('Build') { node('windows') { timeout(time: 90, unit: 'MINUTES') { // We specify the workspace directory manually to reduce the path length and thus try to avoid MSB3491 on Visual Studio - ws("C:/J/O/${env.BRANCH_NAME}") { + ws("C:/J/O/${env.BRANCH_NAME}/${env.BUILD_ID}") { deleteDir() checkout scm bat ''' @@ -54,7 +54,7 @@ stage('Build') { cd build cmake -G "Visual Studio 15 2017 Win64" .. ''' + flags + ''' .. - msbuild.exe OpenSpace.sln /nologo /verbosity:minimal /m:4 /p:Configuration=Debug + msbuild.exe OpenSpace.sln /nologo /verbosity:minimal /p:Configuration=Debug /target:OpenSpace ''' } } diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 42100b12a4..6d61c9663d 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include @@ -104,7 +104,7 @@ LONG WINAPI generateMiniDump(EXCEPTION_POINTERS* exceptionPointers) { GetCurrentThreadId() ); - LINFO("Creating dump file: " << dumpFile); + LINFO(fmt::format("Creating dump file: {}", dumpFile)); HANDLE hDumpFile = CreateFile( dumpFile.c_str(), @@ -310,7 +310,7 @@ void mainInitFunc() { #endif // OPENSPACE_HAS_SPOUT } - + std::string k = openspace::ConfigurationManager::KeyScreenshotUseDate; std::string screenshotPath = "${SCREENSHOTS}"; std::string screenshotNames = "OpenSpace"; @@ -320,19 +320,16 @@ void mainInitFunc() { char mbstr[100]; strftime(mbstr, sizeof(mbstr), "%Y-%m-%d-%H-%M", nowTime); screenshotPath += "/" + std::string(mbstr); - - std::string p = absPath(screenshotPath); - if (!FileSys.directoryExists(p)) { - FileSys.createDirectory(p); - } } + FileSys.registerPathToken("${THIS_SCREENSHOT_PATH}", screenshotPath); + for (size_t i = 0; i < nWindows; ++i) { sgct_core::ScreenCapture* cpt0 = SgctEngine->getWindowPtr(i)->getScreenCapturePointer(0); sgct_core::ScreenCapture* cpt1 = SgctEngine->getWindowPtr(i)->getScreenCapturePointer(1); - + if (cpt0) { cpt0->setPathAndFileName( absPath(screenshotPath), @@ -559,7 +556,9 @@ int main_main(int argc, char** argv) { catch (const ghoul::RuntimeError& e) { // Write out all of the information about the exception and flush the logs LFATALC(e.component, e.message); - LogMgr.flushLogs(); + if (ghoul::logging::LogManager::isInitialized()) { + LogMgr.flushLogs(); + } return EXIT_FAILURE; } catch (const ghoul::AssertionException& e) { @@ -570,12 +569,16 @@ int main_main(int argc, char** argv) { } catch (const std::exception& e) { LFATALC("Exception", e.what()); - LogMgr.flushLogs(); + if (ghoul::logging::LogManager::isInitialized()) { + LogMgr.flushLogs(); + } return EXIT_FAILURE; } catch (...) { LFATALC("Exception", "Unknown exception"); - LogMgr.flushLogs(); + if (ghoul::logging::LogManager::isInitialized()) { + LogMgr.flushLogs(); + } return EXIT_FAILURE; } @@ -583,7 +586,9 @@ int main_main(int argc, char** argv) { return EXIT_SUCCESS; } - LINFO("Detected OpenGL version: " << glVersion.first << "." << glVersion.second); + LINFO(fmt::format( + "Detected OpenGL version: {}.{}", glVersion.first, glVersion.second + )); // Create sgct engine c arguments int newArgc = static_cast(sgctArguments.size()); diff --git a/apps/Sync/main.cpp b/apps/Sync/main.cpp index 86bee06c87..22ecaa259f 100644 --- a/apps/Sync/main.cpp +++ b/apps/Sync/main.cpp @@ -52,8 +52,11 @@ int main(int argc, char** argv) { Task& task = *tasks[i].get(); LINFOC( "Sync", - "Synchronizing scene " << (i + 1) << " out of " << - tasks.size() << ": " << task.description() + fmt::format( + "Synchronizing scene {} out of {}: {}", + i + 1, tasks.size(), + task.description() + ) ); ProgressBar progressBar(100); task.perform([&progressBar](float progress) { diff --git a/apps/TaskRunner/main.cpp b/apps/TaskRunner/main.cpp index 7f6ffe0157..85a206d436 100644 --- a/apps/TaskRunner/main.cpp +++ b/apps/TaskRunner/main.cpp @@ -83,15 +83,14 @@ void performTasks(const std::string& path) { LINFO("Task queue has 1 item"); } else { - LINFO("Task queue has " << tasks.size() << " items"); + LINFO(fmt::format("Task queue has {} items", tasks.size())); } for (size_t i = 0; i < tasks.size(); i++) { Task& task = *tasks[i].get(); - LINFO( - "Performing task " << (i + 1) << " out of " << - tasks.size() << ": " << task.description() - ); + LINFO(fmt::format( + "Performing task {} out of {}: {}", i + 1, tasks.size(), task.description() + )); ProgressBar progressBar(100); auto onProgress = [&progressBar](float progress) { progressBar.print(static_cast(progress * 100.f)); @@ -135,7 +134,7 @@ int main(int argc, char** argv) { // If no task file was specified in as argument, run in CLI mode. - LINFO("Task root: " << absPath("${TASKS}")); + LINFO(fmt::format("Task root: {}", absPath("${TASKS}"))); FileSys.setCurrentDirectory(ghoul::filesystem::Directory(absPath("${TASKS}"))); std::cout << "TASK > "; diff --git a/data/assets/customization/globebrowsing.asset b/data/assets/customization/globebrowsing.asset index 105a2b18b0..ccdaec8893 100644 --- a/data/assets/customization/globebrowsing.asset +++ b/data/assets/customization/globebrowsing.asset @@ -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' - '', '' } } diff --git a/data/assets/default.scene b/data/assets/default.scene index 56383f8b05..db418c766a 100644 --- a/data/assets/default.scene +++ b/data/assets/default.scene @@ -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, diff --git a/data/assets/examples/urlsynchronization.asset b/data/assets/examples/urlsynchronization.asset index cc7e4b1a7c..630eb4762b 100644 --- a/data/assets/examples/urlsynchronization.asset +++ b/data/assets/examples/urlsynchronization.asset @@ -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" }) diff --git a/data/assets/newhorizons.scene b/data/assets/newhorizons.scene index fb2e606c93..3b109a3a34 100644 --- a/data/assets/newhorizons.scene +++ b/data/assets/newhorizons.scene @@ -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 } diff --git a/data/assets/osirisrex.scene b/data/assets/osirisrex.scene index 556981a006..98a30d82b0 100644 --- a/data/assets/osirisrex.scene +++ b/data/assets/osirisrex.scene @@ -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 } diff --git a/data/assets/rosetta.scene b/data/assets/rosetta.scene index 93f37fa291..b4fe3750e1 100644 --- a/data/assets/rosetta.scene +++ b/data/assets/rosetta.scene @@ -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 () diff --git a/data/assets/scene/digitaluniverse/backgroundradiation.asset b/data/assets/scene/digitaluniverse/backgroundradiation.asset index 85f10e6393..2652323ae6 100644 --- a/data/assets/scene/digitaluniverse/backgroundradiation.asset +++ b/data/assets/scene/digitaluniverse/backgroundradiation.asset @@ -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 diff --git a/data/assets/scene/digitaluniverse/milkyway.asset b/data/assets/scene/digitaluniverse/milkyway.asset index a55dca6ede..cf462f66b0 100644 --- a/data/assets/scene/digitaluniverse/milkyway.asset +++ b/data/assets/scene/digitaluniverse/milkyway.asset @@ -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 diff --git a/data/assets/scene/milkyway/milkyway/eso.asset b/data/assets/scene/milkyway/milkyway/eso.asset index cb77f1f655..12bab40860 100644 --- a/data/assets/scene/milkyway/milkyway/eso.asset +++ b/data/assets/scene/milkyway/milkyway/eso.asset @@ -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 diff --git a/data/assets/scene/solarsystem/missions/osirisrex/osirisrex.asset b/data/assets/scene/solarsystem/missions/osirisrex/osirisrex.asset index 6d5bff9427..1444106adc 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/osirisrex.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/osirisrex.asset @@ -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) diff --git a/data/assets/scene/solarsystem/missions/osirisrex/scheduled_scripts.lua b/data/assets/scene/solarsystem/missions/osirisrex/scheduled_scripts.lua deleted file mode 100644 index 39698b5532..0000000000 --- a/data/assets/scene/solarsystem/missions/osirisrex/scheduled_scripts.lua +++ /dev/null @@ -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), -} diff --git a/data/assets/scene/solarsystem/missions/osirisrex/script_schedule.asset b/data/assets/scene/solarsystem/missions/osirisrex/script_schedule.asset new file mode 100644 index 0000000000..147d918cfe --- /dev/null +++ b/data/assets/scene/solarsystem/missions/osirisrex/script_schedule.asset @@ -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) \ No newline at end of file diff --git a/data/assets/scene/solarsystem/planets/earth/earth.asset b/data/assets/scene/solarsystem/planets/earth/earth.asset index d7e8c4f6e3..f6623a2061 100644 --- a/data/assets/scene/solarsystem/planets/earth/earth.asset +++ b/data/assets/scene/solarsystem/planets/earth/earth.asset @@ -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, } }, { diff --git a/data/assets/util/asset_helper.asset b/data/assets/util/asset_helper.asset index cb70c7b739..bc738cf2e9 100644 --- a/data/assets/util/asset_helper.asset +++ b/data/assets/util/asset_helper.asset @@ -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 diff --git a/data/assets/util/default_keybindings.asset b/data/assets/util/default_keybindings.asset index 01fcea5ee6..5a8e0b800b 100644 --- a/data/assets/util/default_keybindings.asset +++ b/data/assets/util/default_keybindings.asset @@ -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) diff --git a/data/assets/util/property_helper.asset b/data/assets/util/property_helper.asset new file mode 100644 index 0000000000..8d3576d130 --- /dev/null +++ b/data/assets/util/property_helper.asset @@ -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) diff --git a/data/assets/util/renderable_helper.asset b/data/assets/util/renderable_helper.asset new file mode 100644 index 0000000000..300e66a574 --- /dev/null +++ b/data/assets/util/renderable_helper.asset @@ -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 to +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) \ No newline at end of file diff --git a/data/assets/util/scene_helper.asset b/data/assets/util/scene_helper.asset index fa84befc03..45139ec6c6 100644 --- a/data/assets/util/scene_helper.asset +++ b/data/assets/util/scene_helper.asset @@ -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) diff --git a/data/assets/util/script_scheduler_helper.asset b/data/assets/util/script_scheduler_helper.asset new file mode 100644 index 0000000000..4a3727b9b3 --- /dev/null +++ b/data/assets/util/script_scheduler_helper.asset @@ -0,0 +1,24 @@ +local renderableHelper = asset.require('./renderable_helper') + +-- Function that schedules scripts setting the enabled property +-- of to at time