Make the addSceneGraphNode call in the local bookmarks file protected (closes #1483)

This commit is contained in:
Alexander Bock
2023-01-21 21:34:03 +01:00
parent 2926250be9
commit f3df853ff5
2 changed files with 5 additions and 3 deletions

View File

@@ -1,2 +1,2 @@
Group (optional),Name (required),Globe (optional),Lat (required if globe),Lon (required if globe),Altitude (optional if globe),x (required if not globe),y (required if not globe),z (required if not globe),Scale (optional),LineWidth (optional)
NASA,Kenedy Space Center,Earth,28.6658276,-80.70282839,,,,,,
NASA,Kennedy Space Center,Earth,28.6658276,-80.70282839,,,,,,
1 Group (optional) Name (required) Globe (optional) Lat (required if globe) Lon (required if globe) Altitude (optional if globe) x (required if not globe) y (required if not globe) z (required if not globe) Scale (optional) LineWidth (optional)
2 NASA Kenedy Space Center Kennedy Space Center Earth 28.6658276 -80.70282839

View File

@@ -5,13 +5,15 @@ local nodes = bookmarkHelper.getBookmarks("Local Bookmarks", "${ASSETS}/customiz
asset.onInitialize(function()
for _, n in ipairs(nodes) do
openspace.addSceneGraphNode(n)
pcall(openspace.addSceneGraphNode, n)
end
end)
asset.onDeinitialize(function()
for _, n in ipairs(nodes) do
openspace.removeSceneGraphNode(n)
if openspace.hasSceneGraphNode(n.Identifier) then
openspace.removeSceneGraphNode(n)
end
end
end)