mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-28 14:59:31 -05:00
0fc9265837
# To run the script Make sure to install the latest Python API version `openspace-api 0.1.2` The script is located in `OpenSpace/support/assetvalidation`, the main script takes a few command line arguments `--dir` - specify the OpenSpace directory `--filter` - optionally supply a regex string to filter which assets to validate `--verbose` - flag to print debug info to log and also console (default off), if off only warnings and errors are logged `--start` - flag to start OpenSpace as a subprocess (default on) if this is off it assumes OpenSpace is already running, useful if you want to run OpenSpace via Visual Studio for example. `--at` - specify an index to start at a specific asset run eg: `python main.py --dir="C:/User/Desktop/OpenSpace" --filter="examples" --verbose=True --start=False --at=35`
202 lines
6.3 KiB
Lua
202 lines
6.3 KiB
Lua
asset.require("scene/solarsystem/planets/earth/earth")
|
|
asset.require("scene/solarsystem/planets/earth/moon/moon")
|
|
|
|
local Angle = {
|
|
Type = "DashboardItemAngle",
|
|
Identifier = "Angle",
|
|
ReferenceType = "Node",
|
|
ReferenceNodeName = "Earth",
|
|
DestinationType = "Node",
|
|
DestinationNodeName = "Moon"
|
|
}
|
|
|
|
local Date = {
|
|
Type = "DashboardItemDate",
|
|
Identifier = "Date"
|
|
}
|
|
|
|
local SimulationIncrement = {
|
|
Type = "DashboardItemSimulationIncrement",
|
|
Identifier = "SimulationIncrement",
|
|
GuiName = "Simulation Increment"
|
|
}
|
|
|
|
local Distance = {
|
|
Type = "DashboardItemDistance",
|
|
Identifier = "Distance"
|
|
}
|
|
|
|
local Framerate = {
|
|
Type = "DashboardItemFramerate",
|
|
Identifier = "Framerate"
|
|
}
|
|
|
|
local ParallelConnection = {
|
|
Type = "DashboardItemParallelConnection",
|
|
Identifier = "ParallelConnection",
|
|
GuiName = "Parallel Connection"
|
|
}
|
|
|
|
local Mission = {
|
|
Type = "DashboardItemMission",
|
|
Identifier = "Mission"
|
|
}
|
|
|
|
local PropertyValue = {
|
|
Type = "DashboardItemPropertyValue",
|
|
Identifier = "DashbaordItemPropertyValue",
|
|
URI = "Scene.Earth.Renderable.Enabled",
|
|
DisplayString = "Earth is enabled: {}"
|
|
}
|
|
|
|
local PropertyValueFloat = {
|
|
Type = "DashboardItemPropertyValue",
|
|
Identifier = "DashbaordItemPropertyValue_Float",
|
|
URI = "Scene.Earth.Renderable.TargetLodScaleFactor",
|
|
DisplayString = "Earth LOD is {:.5f}"
|
|
}
|
|
|
|
local PropertyValueDouble = {
|
|
Type = "DashboardItemPropertyValue",
|
|
Identifier = "DashbaordItemPropertyValue_Double",
|
|
URI = "NavigationHandler.PathNavigator.ArrivalDistanceFactor",
|
|
DisplayString = "Arrival Distance Factor is {:.8f}"
|
|
}
|
|
|
|
local PropertyValueInt = {
|
|
Type = "DashboardItemPropertyValue",
|
|
Identifier = "DashbaordItemPropertyValue_Int",
|
|
URI = "LuaConsole.HistoryLength",
|
|
DisplayString = "History length is {}"
|
|
}
|
|
|
|
local PropertyValueUInt = {
|
|
Type = "DashboardItemPropertyValue",
|
|
Identifier = "DashboardItemPropertyValue_UInt",
|
|
URI = "Modules.Globebrowsing.TileCacheSize",
|
|
DisplayString = "Tile Cache Size is {}"
|
|
}
|
|
|
|
local PropertyValueDVec3 = {
|
|
Type = "DashboardItemPropertyValue",
|
|
Identifier = "DashboardItemPropertyValue_DVec3",
|
|
URI = "Scene.SolarSystemBarycenter.Transform.Transform",
|
|
DisplayString = "SSB Transform is: ({}, {}, {})"
|
|
}
|
|
|
|
local PropertyValueIVec2 = {
|
|
Type = "DashboardItemPropertyValue",
|
|
Identifier = "DashboardItemPropertyValue_IVec2",
|
|
URI = "Scene.SolarSystemBarycenter.Renderable.ScreenSpacePosition",
|
|
DisplayString = "Random ScreenSpace Position: ({}, {})"
|
|
}
|
|
|
|
local PropertyValueVec2 = {
|
|
Type = "DashboardItemPropertyValue",
|
|
Identifier = "DashboardItemPropertyValue_Vec2",
|
|
URI = "Scene.EarthAtmosphere.Renderable.AtmosphereDimmingSunsetAngle",
|
|
DisplayString = "Sunset Angle is ({}, {})"
|
|
}
|
|
|
|
local PropertyValueVec3 = {
|
|
Type = "DashboardItemPropertyValue",
|
|
Identifier = "DashboardItemPropertyValue_Vec3",
|
|
URI = "RenderEngine.GlobalRotation",
|
|
DisplayString = "Global Rotation is ({}, {}, {})"
|
|
}
|
|
|
|
local PropertyValueVec4 = {
|
|
Type = "DashboardItemPropertyValue",
|
|
Identifier = "DashboardItemPropertyValue_Vec4",
|
|
URI = "LuaConsole.BackgroundColor",
|
|
DisplayString = "Background Coolor is ({}, {}, {}, {})"
|
|
}
|
|
|
|
local ElapsedTime = {
|
|
Type = "DashboardItemElapsedTime",
|
|
Identifier = "ElapsedTime",
|
|
ReferenceTime = "2022-10-12 12:00:00"
|
|
}
|
|
|
|
local InputState = {
|
|
Type = "DashboardItemInputState",
|
|
Identifier = "InputState"
|
|
}
|
|
|
|
|
|
asset.onInitialize(function()
|
|
openspace.dashboard.addDashboardItem(Angle)
|
|
openspace.dashboard.addDashboardItem(Date)
|
|
openspace.dashboard.addDashboardItem(SimulationIncrement)
|
|
openspace.dashboard.addDashboardItem(Distance)
|
|
openspace.dashboard.addDashboardItem(Framerate)
|
|
openspace.dashboard.addDashboardItem(ParallelConnection)
|
|
openspace.dashboard.addDashboardItem(Mission)
|
|
openspace.dashboard.addDashboardItem(PropertyValue)
|
|
openspace.dashboard.addDashboardItem(PropertyValueFloat)
|
|
openspace.dashboard.addDashboardItem(PropertyValueDouble)
|
|
openspace.dashboard.addDashboardItem(PropertyValueInt)
|
|
openspace.dashboard.addDashboardItem(PropertyValueUInt)
|
|
openspace.dashboard.addDashboardItem(PropertyValueDVec3)
|
|
openspace.dashboard.addDashboardItem(PropertyValueIVec2)
|
|
openspace.dashboard.addDashboardItem(PropertyValueVec2)
|
|
openspace.dashboard.addDashboardItem(PropertyValueVec3)
|
|
openspace.dashboard.addDashboardItem(PropertyValueVec4)
|
|
openspace.dashboard.addDashboardItem(ElapsedTime)
|
|
openspace.dashboard.addDashboardItem(InputState)
|
|
end)
|
|
|
|
asset.onDeinitialize(function()
|
|
openspace.dashboard.removeDashboardItem(InputState)
|
|
openspace.dashboard.removeDashboardItem(ElapsedTime)
|
|
openspace.dashboard.removeDashboardItem(PropertyValueVec4)
|
|
openspace.dashboard.removeDashboardItem(PropertyValueVec3)
|
|
openspace.dashboard.removeDashboardItem(PropertyValueVec2)
|
|
openspace.dashboard.removeDashboardItem(PropertyValueIVec2)
|
|
openspace.dashboard.removeDashboardItem(PropertyValueDVec3)
|
|
openspace.dashboard.removeDashboardItem(PropertyValueUInt)
|
|
openspace.dashboard.removeDashboardItem(PropertyValueInt)
|
|
openspace.dashboard.removeDashboardItem(PropertyValueDouble)
|
|
openspace.dashboard.removeDashboardItem(PropertyValueFloat)
|
|
openspace.dashboard.removeDashboardItem(PropertyValue)
|
|
openspace.dashboard.removeDashboardItem(Mission)
|
|
openspace.dashboard.removeDashboardItem(ParallelConnection)
|
|
openspace.dashboard.removeDashboardItem(Framerate)
|
|
openspace.dashboard.removeDashboardItem(Distance)
|
|
openspace.dashboard.removeDashboardItem(SimulationIncrement)
|
|
openspace.dashboard.removeDashboardItem(Date)
|
|
openspace.dashboard.removeDashboardItem(Angle)
|
|
end)
|
|
|
|
asset.export(Angle)
|
|
asset.export(Date)
|
|
asset.export(SimulationIncrement)
|
|
asset.export(Distance)
|
|
asset.export(Framerate)
|
|
asset.export(ParallelConnection)
|
|
asset.export(Mission)
|
|
asset.export(PropertyValue)
|
|
asset.export(PropertyValueFloat)
|
|
asset.export(PropertyValueDouble)
|
|
asset.export(PropertyValueInt)
|
|
asset.export(PropertyValueUInt)
|
|
asset.export(PropertyValueDVec3)
|
|
asset.export(PropertyValueIVec2)
|
|
asset.export(PropertyValueVec2)
|
|
asset.export(PropertyValueVec3)
|
|
asset.export(PropertyValueVec4)
|
|
asset.export(ElapsedTime)
|
|
asset.export(InputState)
|
|
|
|
|
|
|
|
asset.meta = {
|
|
Name = "Dashboard Items Example",
|
|
Description = [[Examples of different types of dashboard items. These are dynamic
|
|
information texts that will be shown over the rendering (per default in the top
|
|
left corner, on flat screens).]],
|
|
Author = "OpenSpace Team",
|
|
URL = "http://openspaceproject.com",
|
|
License = "MIT license"
|
|
}
|