diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-04-16 13:42:13 +0300 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-05-02 10:19:23 +0000 |
commit | 3dc7636713c98ce2748d367f8525fcab85a6c425 (patch) | |
tree | 12411317058e10feae817e25c33f0e5e24577298 /src/Runtime/Source/datamodel | |
parent | 437593e677cd1ed85ef846a3488dc3212fdde54a (diff) |
Support alpha channel initial work
In this initial work, all (almost) color properties are converted into a new type (float4) to
support an alpha channel. Alpha channel option is shown in the color dialog for Layer and Scene
background properties only. The following is remaining:
- Scene background alpha doesn't work in the editor (works in the viewer RT1)
Task-number: QT3DS-3128
Change-Id: Ib5540ebc8e2ff68709473451e4a92bf66ddb8ad2
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Runtime/Source/datamodel')
-rw-r--r-- | src/Runtime/Source/datamodel/Qt3DSMetadata.cpp | 11 | ||||
-rw-r--r-- | src/Runtime/Source/datamodel/Qt3DSMetadata.h | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/Runtime/Source/datamodel/Qt3DSMetadata.cpp b/src/Runtime/Source/datamodel/Qt3DSMetadata.cpp index 99d7cb8e..03c515e0 100644 --- a/src/Runtime/Source/datamodel/Qt3DSMetadata.cpp +++ b/src/Runtime/Source/datamodel/Qt3DSMetadata.cpp @@ -474,6 +474,17 @@ public: return Empty(); } + Option<qt3ds::QT3DSVec4> GetPropertyValueVector4(TStrTableStr inType, TStrTableStr inProperty, + TStrTableStr inId) override + { + SRuntimeMetaDataPropertyInfo &theInfo(FindProperty(inType, inProperty, inId)); + if (theInfo.m_Value.hasValue()) { + SFloat4 theFloat4 = qt3dsdm::get<SFloat4>(*theInfo.m_Value); + return qt3ds::QT3DSVec4(theFloat4[0], theFloat4[1], theFloat4[2], theFloat4[3]); + } + return Empty(); + } + virtual Option<qt3ds::QT3DSI32> GetPropertyValueLong(TStrTableStr inType, TStrTableStr inProperty, TStrTableStr inId) override { diff --git a/src/Runtime/Source/datamodel/Qt3DSMetadata.h b/src/Runtime/Source/datamodel/Qt3DSMetadata.h index a90d4fd6..ea2d4452 100644 --- a/src/Runtime/Source/datamodel/Qt3DSMetadata.h +++ b/src/Runtime/Source/datamodel/Qt3DSMetadata.h @@ -33,6 +33,7 @@ #include "foundation/Qt3DSRefCounted.h" #include "foundation/Qt3DSOption.h" #include "foundation/Qt3DSVec3.h" +#include "foundation/Qt3DSVec4.h" #include <EASTL/string.h> #include <EASTL/vector.h> #include "foundation/StringTable.h" @@ -226,6 +227,9 @@ public: virtual Option<qt3ds::QT3DSVec3> GetPropertyValueVector3(TStrTableStr inType, TStrTableStr inProperty, TStrTableStr inId = TStrTableStr()) = 0; + virtual Option<qt3ds::QT3DSVec4> GetPropertyValueVector4(TStrTableStr inType, + TStrTableStr inProperty, TStrTableStr inId = TStrTableStr()) = 0; + //============================================================================== /** * Get property value as long |