Issue/2174 - Show items with no GUI tag in asset in the GUI (#3133)

* Always add GUI properties, even if tag is not in the asset

To make objects wihtout GUI tag be included in the UI

* Hide the hover circle, to clean up scene menu list a little

* set root node gui hidden property to true

* Properly add the gui properties for all scene graph nodes (even root)

* Update GUI hash
This commit is contained in:
Emma Broman
2024-04-03 09:23:49 +02:00
committed by GitHub
parent d48f77fd9e
commit 19f0f707dc
5 changed files with 14 additions and 6 deletions

View File

@@ -116,6 +116,7 @@ Scene::Scene(std::unique_ptr<SceneInitializer> initializer)
{
_rootNode.setIdentifier(RootNodeIdentifier);
_rootNode.setScene(this);
_rootNode.setGuiHintHidden(true);
_camera->setParent(&_rootNode);
}

View File

@@ -350,18 +350,15 @@ ghoul::mm_unique_ptr<SceneGraphNode> SceneGraphNode::createFromDictionary(
result->setGuiName(*p.gui->name);
result->_guiDisplayName = result->guiName();
}
result->addProperty(result->_guiDisplayName);
if (p.gui->description.has_value()) {
result->setDescription(*p.gui->description);
result->_guiDescription = result->description();
}
result->addProperty(result->_guiDescription);
if (p.gui->hidden.has_value()) {
result->_guiHidden = *p.gui->hidden;
}
result->addProperty(result->_guiHidden);
if (p.gui->path.has_value()) {
if (!p.gui->path->starts_with('/')) {
@@ -369,7 +366,6 @@ ghoul::mm_unique_ptr<SceneGraphNode> SceneGraphNode::createFromDictionary(
}
result->_guiPath = *p.gui->path;
}
result->addProperty(result->_guiPath);
}
result->_boundingSphere = p.boundingSphere.value_or(result->_boundingSphere);
@@ -596,6 +592,11 @@ SceneGraphNode::SceneGraphNode()
addProperty(_showDebugSphere);
addProperty(_supportsDirectInteraction);
addProperty(_guiDisplayName);
addProperty(_guiDescription);
addProperty(_guiHidden);
addProperty(_guiPath);
}
SceneGraphNode::~SceneGraphNode() {}
@@ -1123,6 +1124,10 @@ bool SceneGraphNode::hasGuiHintHidden() const {
return _guiHidden;
}
void SceneGraphNode::setGuiHintHidden(bool value) {
_guiHidden = value;
}
glm::dvec3 SceneGraphNode::calculateWorldPosition() const {
// recursive up the hierarchy if there are parents available
if (_parent) {