diff options
Diffstat (limited to 'src/Authoring/Studio/Palettes/Timeline')
-rw-r--r-- | src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemProperty.cpp | 25 | ||||
-rw-r--r-- | src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineTimebar.cpp | 4 |
2 files changed, 16 insertions, 13 deletions
diff --git a/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemProperty.cpp b/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemProperty.cpp index 73a7bb7d..d89fcc98 100644 --- a/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemProperty.cpp +++ b/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineItemProperty.cpp @@ -195,7 +195,7 @@ float Qt3DSDMTimelineItemProperty::GetMaximumValue() const { float theRetVal = FLT_MIN; do_all(m_Keyframes, std::bind(CompareAndSet, std::placeholders::_1, std::ref(theRetVal), true)); - if (m_Type.first == DataModelDataType::Float3 && m_Type.second == AdditionalMetaDataType::Color) + if (m_Type.first == DataModelDataType::Float4 && m_Type.second == AdditionalMetaDataType::Color) theRetVal = DataModelToColor(theRetVal); return theRetVal; } @@ -205,7 +205,7 @@ float Qt3DSDMTimelineItemProperty::GetMinimumValue() const { float theRetVal = FLT_MAX; do_all(m_Keyframes, std::bind(CompareAndSet, std::placeholders::_1, std::ref(theRetVal), false)); - if (m_Type.first == DataModelDataType::Float3 && m_Type.second == AdditionalMetaDataType::Color) + if (m_Type.first == DataModelDataType::Float4 && m_Type.second == AdditionalMetaDataType::Color) theRetVal = DataModelToColor(theRetVal); return theRetVal; } @@ -286,18 +286,21 @@ float Qt3DSDMTimelineItemProperty::GetChannelValueAtTime(long inChannelIndex, lo thePropertySystem->GetInstancePropertyValue(theParentBinding->GetInstanceHandle(), m_PropertyHandle, theValue); switch (m_Type.first) { - case DataModelDataType::Float3: { + case DataModelDataType::Float4: { if (m_Type.second == AdditionalMetaDataType::Color) { - SFloat3 theFloat3 = qt3dsdm::get<SFloat3>(theValue); - if (inChannelIndex >= 0 && inChannelIndex < 3) - return DataModelToColor(theFloat3[inChannelIndex]); - } else { - SFloat3 theFloat3 = qt3dsdm::get<SFloat3>(theValue); - if (inChannelIndex >= 0 && inChannelIndex < 3) - return theFloat3[inChannelIndex]; + SFloat4 theFloat4 = qt3dsdm::get<SFloat4>(theValue); + if (inChannelIndex >= 0 && inChannelIndex < 4) + return DataModelToColor(theFloat4[inChannelIndex]); } break; } + case DataModelDataType::Float3: { + + SFloat3 theFloat3 = qt3dsdm::get<SFloat3>(theValue); + if (inChannelIndex >= 0 && inChannelIndex < 3) + return theFloat3[inChannelIndex]; + break; + } case DataModelDataType::Float2: { SFloat2 theFloat2 = qt3dsdm::get<SFloat2>(theValue); if (inChannelIndex >= 0 && inChannelIndex < 2) @@ -317,7 +320,7 @@ float Qt3DSDMTimelineItemProperty::GetChannelValueAtTime(long inChannelIndex, lo && inChannelIndex < (long)m_AnimationHandles.size()) { float theValue = theAnimationCore->EvaluateAnimation( m_AnimationHandles[inChannelIndex], Qt3DSDMTimelineKeyframe::GetTimeInSecs(inTime)); - if (m_Type.first == DataModelDataType::Float3 + if (m_Type.first == DataModelDataType::Float4 && m_Type.second == AdditionalMetaDataType::Color) theValue = DataModelToColor(theValue); diff --git a/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineTimebar.cpp b/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineTimebar.cpp index 0cf78a30..0ecefefd 100644 --- a/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineTimebar.cpp +++ b/src/Authoring/Studio/Palettes/Timeline/Bindings/Qt3DSDMTimelineTimebar.cpp @@ -61,7 +61,7 @@ Qt3DSDMTimelineTimebar::Qt3DSDMTimelineTimebar( qt3dsdm::SValue theValue; if (m_PropertySystem->GetInstancePropertyValue( m_DataHandle, theClientDataModelBridge->GetSceneAsset().m_TimebarColor, theValue)) { - qt3dsdm::SFloat3 theTimebarColor = qt3dsdm::get<qt3dsdm::SFloat3>(theValue); + qt3dsdm::SFloat4 theTimebarColor = qt3dsdm::get<qt3dsdm::SFloat4>(theValue); m_Color.SetRGB(static_cast<int>(theTimebarColor.m_Floats[0] * 255.0f), static_cast<int>(theTimebarColor.m_Floats[1] * 255.0f), @@ -90,7 +90,7 @@ void Qt3DSDMTimelineTimebar::OnPropertyChanged(qt3dsdm::Qt3DSDMInstanceHandle in if (m_PropertySystem->GetInstancePropertyValue( m_DataHandle, theClientDataModelBridge->GetSceneAsset().m_TimebarColor, theValue)) { - qt3dsdm::SFloat3 theTimebarColor = qt3dsdm::get<qt3dsdm::SFloat3>(theValue); + qt3dsdm::SFloat4 theTimebarColor = qt3dsdm::get<qt3dsdm::SFloat4>(theValue); m_Color.SetRGB(static_cast<int>(theTimebarColor.m_Floats[0] * 255.0f), static_cast<int>(theTimebarColor.m_Floats[1] * 255.0f), |