Add enabled property to Exoplanets and Skybrowser module (#1945)

* Add enabled property to exoplanets and sky browser module

* Create assets for default settings and restructure assets into a components folder

* Update exoplanets data

* Set sky browser enabled to true per default and include hover circle asset

* Add name and description of hover circle, and used synced version of ring image
This commit is contained in:
Emma Broman
2022-04-25 15:10:08 +02:00
committed by GitHub
parent 2b70aafafd
commit 92eefa8189
15 changed files with 131 additions and 48 deletions
+4 -4
View File
@@ -4,6 +4,10 @@
asset.require("./base_blank")
-- Modules and component settings
asset.require("modules/exoplanets/exoplanets")
asset.require("modules/skybrowser/skybrowser")
-- Specifying which other assets should be loaded in this scene
asset.require("scene/solarsystem/sun/sun")
asset.require("scene/solarsystem/sun/glare")
@@ -20,10 +24,6 @@ asset.require("scene/milkyway/constellations/constellation_keybinds")
asset.require("scene/milkyway/objects/orionnebula/orionnebula")
asset.require("util/launcher_images")
-- For exoplanet system visualizations
asset.require("scene/milkyway/exoplanets/exoplanets_data")
asset.require("scene/milkyway/exoplanets/exoplanets_textures")
asset.require("scene/digitaluniverse/2dF")
asset.require("scene/digitaluniverse/2mass")
asset.require("scene/digitaluniverse/6dF")
Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

-29
View File
@@ -1,29 +0,0 @@
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_SPOUT enabled
local transforms = asset.require("scene/solarsystem/sun/transforms")
local circle = {
Identifier = "hoverCircle",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderablePlaneImageLocal",
Size = 3.0E15,
Origin = "Center",
Billboard = true,
Texture = "${ASSETS}/circle.png"
},
GUI = {
Path = "/SkyBrowser"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(circle)
openspace.skybrowser.setHoverCircle('hoverCircle')
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(circle)
end)
asset.export(circle)
@@ -0,0 +1,16 @@
asset.onInitialize(function ()
openspace.setPropertyValueSingle("Modules.Exoplanets.Enabled", true)
openspace.setPropertyValueSingle("Modules.Exoplanets.ShowComparisonCircle", false)
openspace.setPropertyValueSingle("Modules.Exoplanets.ShowHabitableZone", true)
openspace.setPropertyValueSingle("Modules.Exoplanets.UseOptimisticZone", true)
openspace.setPropertyValueSingle("Modules.Exoplanets.HabitableZoneOpacity", 0.1)
end)
asset.meta = {
Name = "Exoplanet Default Settings",
Version = "1.0",
Description = [[ Some default settings related to the exoplanet module ]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}
@@ -0,0 +1,3 @@
asset.require("./default_settings")
asset.require("./exoplanets_data")
asset.require("./exoplanets_textures")
@@ -2,7 +2,7 @@ local DataPath = asset.syncedResource({
Name = "Exoplanet Data Files",
Type = "HttpSynchronization",
Identifier = "exoplanets_data",
Version = 2
Version = 3
})
local colormaps = asset.syncedResource({
@@ -13,6 +13,8 @@ local colormaps = asset.syncedResource({
})
asset.onInitialize(function ()
-- Set the default data files used for the exoplanet system creation
-- (Check if already set, to not override value set in another file)
local p = "Modules.Exoplanets.DataFolder";
if (openspace.getPropertyValue(p) == "") then
openspace.setPropertyValueSingle(p, DataPath)
@@ -28,7 +30,7 @@ asset.export("DataPath", DataPath)
asset.meta = {
Name = "Exoplanet Data",
Version = "2.0",
Version = "3.0",
Description = [[ The data that is used for the exoplanet systems. The data has been
derived from the 'Planetary Systems Composite Data' dataset from the NASA Exoplanet
Archive]],
@@ -1,5 +1,6 @@
local habitableZoneTextures =
asset.require("../habitable_zones/habitable_zone_textures").TexturesPath
local habitableZoneTextures = asset.require(
"scene/milkyway/habitable_zones/habitable_zone_textures"
).TexturesPath
local sunTextures = asset.syncedResource({
Type = "HttpSynchronization",
@@ -25,7 +26,7 @@ asset.onInitialize(function ()
local hzTexture = habitableZoneTextures .. "hot_to_cold_faded.png"
-- Set the default textures used for the exoplanet system creation
-- (Check if already set, to not override value in config file)
-- (Check if already set, to not override value set in another file)
local p = "Modules.Exoplanets.StarTexture";
if (openspace.getPropertyValue(p) == "") then
openspace.setPropertyValueSingle(p, starTexture)
@@ -0,0 +1,13 @@
asset.onInitialize(function ()
openspace.setPropertyValueSingle("Modules.SkyBrowser.Enabled", true)
-- More settings are available, but for now using the default values
end)
asset.meta = {
Name = "SkyBrowser Module Default Settings",
Version = "1.0",
Description = [[ Some default settings related to the SkyBrowser module ]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}
@@ -0,0 +1,50 @@
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_SPOUT enabled
local transforms = asset.require("scene/solarsystem/sun/transforms")
local ringImage = asset.syncedResource({
Name = "Hover Circle Image",
Type = "HttpSynchronization",
Identifier = "misc_ring_image",
Version = 1
})
local circle = {
Identifier = "hoverCircle",
Parent = transforms.SolarSystemBarycenter.Identifier,
Renderable = {
Type = "RenderablePlaneImageLocal",
Size = 3.0E15,
Origin = "Center",
Billboard = true,
Texture = ringImage
},
GUI = {
Name = "Hover Circle",
Description = [[A circular marker that shows the position on the night sky
of the object hovered in the sky browser UI. The circle will hide/show up
dynamically, depending on the interaction with the items in the UI. ]],
Path = "/SkyBrowser"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(circle)
openspace.skybrowser.setHoverCircle('hoverCircle')
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(circle)
end)
asset.export(circle)
asset.meta = {
Name = "SkyBrowser Hover Circle",
Version = "1.0",
Description = [[Includes a circular marker that shows the position on the night sky
of the object hovered in the sky browser UI. ]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}
@@ -0,0 +1,2 @@
asset.require("./default_settings")
asset.require("./hoverCircle")