mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-09 04:59:56 -06:00
16 lines
605 B
Lua
16 lines
605 B
Lua
local propertyHelper = asset.require("./property_helper")
|
|
|
|
-- Function that returns the string that enables/disables the renderable 'renderable'
|
|
local toggle = function(renderable)
|
|
return propertyHelper.invert(renderable .. ".Renderable.Enabled")
|
|
end
|
|
|
|
-- Function that returns the string that sets the enabled property of <renderable> to <enabled>
|
|
local setEnabled = function(renderable, enabled)
|
|
return [[openspace.setPropertyValue("]] .. renderable .. [[.Renderable.Enabled", ]] .. (enabled and "true" or "false") .. ");";
|
|
end
|
|
|
|
|
|
asset.export("toggle", toggle)
|
|
asset.export("setEnabled", setEnabled)
|