mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-08 20:39:47 -05:00
Fix a bug in TemplateProperty preventing new bool values to be set
Add "isEnabled" flag BoolProperty to all renderables
This commit is contained in:
@@ -59,9 +59,8 @@ Renderable* Renderable::createFromDictionary(const ghoul::Dictionary& dictionary
|
||||
}
|
||||
|
||||
Renderable::Renderable(const ghoul::Dictionary& dictionary)
|
||||
: _enabled("enabled", "Is Enabled", true)
|
||||
{
|
||||
// std::string name;
|
||||
// dictionary.getValue(constants::scenegraphnode::keyName, name);
|
||||
setName("renderable");
|
||||
|
||||
// get path if available
|
||||
@@ -70,6 +69,8 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary)
|
||||
dictionary.getValue(constants::scenegraph::keyPathModule, _relativePath);
|
||||
_relativePath += "/";
|
||||
}
|
||||
|
||||
addProperty(_enabled);
|
||||
}
|
||||
|
||||
Renderable::~Renderable()
|
||||
@@ -104,4 +105,8 @@ std::string Renderable::findPath(const std::string& path) {
|
||||
return "";
|
||||
}
|
||||
|
||||
bool Renderable::isVisible() const {
|
||||
return _enabled;
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -110,7 +110,6 @@ int property_setValue(lua_State* L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//if (propertyValue.type() != prop->type()) {
|
||||
if (type != prop->typeLua())
|
||||
LERROR("Property '" << uri << "' does not accept input of type '"
|
||||
<< luaTypeToString(type) << "'. Requested type: '"
|
||||
|
||||
@@ -269,7 +269,8 @@ void SceneGraphNode::render(const Camera* camera, const psc& parentPosition)
|
||||
if (!_boundingSphereVisible) {
|
||||
return;
|
||||
}
|
||||
if (_renderableVisible && _renderableToggle) {
|
||||
|
||||
if (_renderableVisible && _renderableToggle && _renderable->isVisible()) {
|
||||
// LDEBUG("Render");
|
||||
_renderable->render(camera, thisPosition);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user