Files
OpenSpace/data/assets/util/renderable_helper.asset
T
Alexander Bock 705c898ccd Asset File cleanup (#2713)
* Updating all assets to new coding style
* Cleaning up asset files
* Moving default_actions and default_keybindings files
* Changing procedural globes to explicitly specified globes
* Move Spice loading explicitly to the initialize part and also deinitialize
* Removing unused asset files
  * Removing asset_helper
  * Removing scale_model_helper asset
  * Removing script_scheduler_helper
  * Removing testing_keybindings
  * Remove procedural_globe
2023-05-28 17:23:20 +02:00

17 lines
588 B
Lua

local propertyHelper = asset.require("./property_helper")
-- Function that returns the string that enables/disables the renderable 'renderable'
function toggle(renderable)
return propertyHelper.invert(renderable .. ".Renderable.Enabled")
end
-- Function that returns the string that sets the enabled property of <renderable> to <enabled>
function setEnabled(renderable, enabled)
return [[openspace.setPropertyValue("]] .. renderable .. [[.Renderable.Enabled", ]] .. (enabled and "true" or "false") .. ")"
end
asset.export("toggle", toggle)
asset.export("setEnabled", setEnabled)