mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-26 06:49:09 -06:00
Make the addSceneGraphNode call in the local bookmarks file protected (closes #1483)
This commit is contained in:
@@ -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,,,,,,
|
||||
|
||||
|
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user