mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 12:10:52 -06:00
Make the local bookmarks print their error message if they fail; also replace whitespaces with underscores for identifiers
This commit is contained in:
@@ -5,7 +5,10 @@ local nodes = bookmarkHelper.getBookmarks("Local Bookmarks", "${ASSETS}/customiz
|
||||
|
||||
asset.onInitialize(function()
|
||||
for _, n in ipairs(nodes) do
|
||||
pcall(openspace.addSceneGraphNode, n)
|
||||
local success, error = pcall(openspace.addSceneGraphNode, n)
|
||||
if not success then
|
||||
openspace.printError(error)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ local getBookmarks = function (guiPath, bookmarkfile)
|
||||
local matchstring = "(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)$"
|
||||
local group, name, globe, lat, lon, altitude, x, y, z, scale, linewidth = line:match(matchstring)
|
||||
|
||||
local identifier = string.gsub(guiPath .. "-" .. name, " ", "_")
|
||||
|
||||
scale = (scale == "" and 75000 or scale)
|
||||
linewidth = (linewidth == "" and 2.0 or tonumber(linewidth))
|
||||
group = (group == "" and globe or group)
|
||||
@@ -14,7 +16,7 @@ local getBookmarks = function (guiPath, bookmarkfile)
|
||||
local parent = (globe == "" and "Root" or globe)
|
||||
|
||||
local sgn = {
|
||||
Identifier = guiPath .. "-" .. name,
|
||||
Identifier = identifier,
|
||||
Parent = parent,
|
||||
Transform = {
|
||||
Scale = {
|
||||
|
||||
Reference in New Issue
Block a user