summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2019-09-03 11:22:36 +0300
committerMahmoud Badri <mahmoud.badri@qt.io>2019-09-04 10:52:27 +0300
commit616d5b27a994d94bbd665540c7ee4d94c2084777 (patch)
tree9076cbc658ebee851123b388274fbad7d9d39eec
parent0c43f1b286d33d9d3c84e0f00ada30a6e18fd3b2 (diff)
Show the alpha channel curve only for custom materials
The property graph displays the alpha channel curve only for custom material color properties as it is not in use for other material types. Task-number: QT3DS-3919 Change-Id: If4974bfb00ee51547004b1e10c1311362a7dc6be Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io>
-rw-r--r--src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTree.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTree.cpp b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTree.cpp
index 63862c5a..4a8723e7 100644
--- a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTree.cpp
+++ b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/ui/RowTree.cpp
@@ -615,10 +615,24 @@ void RowTree::setPropBinding(ITimelineItemProperty *binding)
{
m_PropBinding = binding;
+ // update timeline isColorProperty
+ qt3dsdm::TDataTypePair propType = m_PropBinding->GetType();
+ if (propType.first == qt3dsdm::DataModelDataType::Float4
+ && propType.second == qt3dsdm::AdditionalMetaDataType::Color) {
+ m_rowTimeline->m_isColorProperty = true;
+ }
+
int chCount = int(m_PropBinding->GetChannelCount());
+
+ // for color properties only show alpha channel for custom materials
+ if (m_rowTimeline->m_isColorProperty && m_parentRow->m_objectType != OBJTYPE_CUSTOMMATERIAL)
+ chCount = 3;
+
m_activeChannels.resize(chCount);
+
if (chCount == 1) // if property has only 1 channel (ex: alpha), don't show channel buttons
chCount = 0;
+
m_rectChannels.resize(chCount);
// For bezier animation select first channel (ie x) only by default, else select all channels
@@ -650,13 +664,6 @@ void RowTree::setPropBinding(ITimelineItemProperty *binding)
// Update label color
m_labelItem.setMaster(m_PropBinding->IsMaster());
-
- // update timeline isColorProperty
- qt3dsdm::TDataTypePair propType = m_PropBinding->GetType();
- if (m_isProperty && propType.first == qt3dsdm::DataModelDataType::Float4
- && propType.second == qt3dsdm::AdditionalMetaDataType::Color) {
- m_rowTimeline->m_isColorProperty = true;
- }
}
void RowTree::setState(State state)