Fix toggleFade for multiple property owners, and add openspace.propertyOwner API function (#3721)

* Add a function for getting all propertyowners matching a certain regex
* Fix broken toggleFade - now works with multiple nodes
* Utilize updated toggle fade function in existing toggle actions
* Make `openspace.propertyOwner` work when only tag is included
* And make toggleFade work in a situation where tag matches both a screenspace renderable and scene graph node
* Remove mistakenly added scene graph node (it is really a screenspace renderable)
* Cleanup property check code to reuse check in both property and propertyowner function
This commit is contained in:
Emma Broman
2025-06-18 18:32:17 +02:00
committed by GitHub
parent b6d3704439
commit b51a3322e2
20 changed files with 334 additions and 296 deletions
+14
View File
@@ -1753,6 +1753,10 @@ void OpenSpaceEngine::invalidatePropertyCache() {
_isAllPropertiesCacheDirty = true;
}
void OpenSpaceEngine::invalidatePropertyOwnerCache() {
_isAllPropertyOwnersCacheDirty = true;
}
const std::vector<properties::Property*>& OpenSpaceEngine::allProperties() const {
if (_isAllPropertiesCacheDirty) {
_allPropertiesCache = global::rootPropertyOwner->propertiesRecursive();
@@ -1762,6 +1766,16 @@ const std::vector<properties::Property*>& OpenSpaceEngine::allProperties() const
return _allPropertiesCache;
}
const std::vector<properties::PropertyOwner*>& OpenSpaceEngine::allPropertyOwners() const
{
if (_isAllPropertyOwnersCacheDirty) {
_allPropertyOwnersCache = global::rootPropertyOwner->subownersRecursive();
_isAllPropertyOwnersCacheDirty = false;
}
return _allPropertyOwnersCache;
}
AssetManager& OpenSpaceEngine::assetManager() {
ghoul_assert(_assetManager, "Asset Manager must not be nullptr");
return *_assetManager;