diff options
author | Janne Kangas <janne.kangas@qt.io> | 2019-01-07 12:00:21 +0200 |
---|---|---|
committer | Janne Kangas <janne.kangas@qt.io> | 2019-01-10 05:53:15 +0000 |
commit | 755c1185b5cb577feb4220ebfee2f4fc06e99927 (patch) | |
tree | e651311c207ec9ddc017c948582600a9bfb4b621 /src/Authoring/QT3DSDM/Systems/StudioPropertySystem.cpp | |
parent | 16d80de67db387382e23d2545c7d3f3774a11c8a (diff) |
Enable setting datainput controller from timeline context menu
Add context menu option to set datainput controller for a property of
currently selected timeline object.
Change-Id: I569a5ea501e307228e9c50b654ad9f19a14a7d88
Task-id: QT3DS-2435
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/QT3DSDM/Systems/StudioPropertySystem.cpp')
-rw-r--r-- | src/Authoring/QT3DSDM/Systems/StudioPropertySystem.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Authoring/QT3DSDM/Systems/StudioPropertySystem.cpp b/src/Authoring/QT3DSDM/Systems/StudioPropertySystem.cpp index 09f0159a..78fabc6b 100644 --- a/src/Authoring/QT3DSDM/Systems/StudioPropertySystem.cpp +++ b/src/Authoring/QT3DSDM/Systems/StudioPropertySystem.cpp @@ -187,6 +187,26 @@ bool CStudioPropertySystem::IsInstanceOrDerivedFrom(Qt3DSDMInstanceHandle inInst return m_DataCore->IsInstanceOrDerivedFrom(inInstance, inParent); } +QVector<Qt3DSDMPropertyHandle> +CStudioPropertySystem::GetControllableProperties(Qt3DSDMInstanceHandle inInst) const +{ + vector<Qt3DSDMMetaDataPropertyHandle> propList; + QVector<Qt3DSDMPropertyHandle> outList; + m_MetaData->GetMetaDataProperties(inInst, propList); + + for (const auto it : qAsConst(propList)) { + auto metadata = m_MetaData->GetMetaDataPropertyInfo(it).getValue(); + + if ((metadata.m_Controllable + || (metadata.m_Animatable + && m_StudioAnimationSystem->IsPropertyAnimatable(inInst, metadata.m_Property))) + && !metadata.m_IsHidden) { + outList.append(metadata.m_Property); + } + } + return outList; +} + Qt3DSDMPropertyHandle CStudioPropertySystem::AddProperty(Qt3DSDMInstanceHandle inInstance, TCharPtr inName, DataModelDataType::Value inPropType) |