mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 13:08:49 -05:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user