7#include "GenericPlatform/GenericPlatform.h"
8#include "Kismet/BlueprintFunctionLibrary.h"
10THIRD_PARTY_INCLUDES_START
11#include <CesiumGltf/PropertyTexturePropertyView.h>
12THIRD_PARTY_INCLUDES_END
16#include "CesiumPropertyTextureProperty.generated.h"
54 GENERATED_USTRUCT_BODY()
63 template <
typename T,
bool Normalized>
66 const TSharedPtr<FCesiumMetadataEnum>& pEnumDefinition =
nullptr)
70 _normalized(Normalized),
71 _pEnumDefinition(pEnumDefinition) {
72 switch (property.status()) {
73 case CesiumGltf::PropertyTexturePropertyViewStatus::Valid:
74 _status = ECesiumPropertyTexturePropertyStatus::Valid;
76 case CesiumGltf::PropertyTexturePropertyViewStatus::
77 EmptyPropertyWithDefault:
78 _status = ECesiumPropertyTexturePropertyStatus::EmptyPropertyWithDefault;
80 case CesiumGltf::PropertyTexturePropertyViewStatus::
81 ErrorUnsupportedProperty:
82 _status = ECesiumPropertyTexturePropertyStatus::ErrorUnsupportedProperty;
84 case CesiumGltf::PropertyTexturePropertyViewStatus::
85 ErrorInvalidPropertyTexture:
86 case CesiumGltf::PropertyTexturePropertyViewStatus::
87 ErrorNonexistentProperty:
88 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorTypeMismatch:
89 case CesiumGltf::PropertyTexturePropertyViewStatus::
90 ErrorComponentTypeMismatch:
91 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorArrayTypeMismatch:
92 case CesiumGltf::PropertyTexturePropertyViewStatus::
93 ErrorInvalidNormalization:
94 case CesiumGltf::PropertyTexturePropertyViewStatus::
95 ErrorNormalizationMismatch:
96 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorInvalidOffset:
97 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorInvalidScale:
98 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorInvalidMax:
99 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorInvalidMin:
100 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorInvalidNoDataValue:
101 case CesiumGltf::PropertyTexturePropertyViewStatus::
102 ErrorInvalidDefaultValue:
106 _status = ECesiumPropertyTexturePropertyStatus::ErrorInvalidPropertyData;
110 _valueType = TypeToMetadataValueType<T>(pEnumDefinition);
111 _normalized = Normalized;
117 const std::optional<CesiumGltf::KhrTextureTransform>
127 TSharedPtr<FCesiumMetadataEnum> _pEnumDefinition;
134 : public UBlueprintFunctionLibrary {
147 Category =
"Cesium|Metadata|PropertyTextureProperty")
161 Category =
"Cesium|Metadata|PropertyTextureProperty")
175 Category =
"Cesium|Metadata|PropertyTextureProperty")
189 Category =
"Cesium|Metadata|PropertyTextureProperty")
202 Category =
"Cesium|Metadata|PropertyTextureProperty")
218 Category =
"Cesium|Metadata|PropertyTextureProperty")
245 Category =
"Cesium|Metadata|PropertyTextureProperty")
247 const UPrimitiveComponent* Component,
260 Category =
"Cesium|Metadata|PropertyTextureProperty")
293 Category =
"Cesium|Metadata|PropertyTextureProperty")
297 uint8 DefaultValue = 0);
329 Category =
"Cesium|Metadata|PropertyTextureProperty")
333 int32 DefaultValue = 0);
367 Category =
"Cesium|Metadata|PropertyTextureProperty")
371 int64 DefaultValue = 0);
405 Category =
"Cesium|Metadata|PropertyTextureProperty")
409 float DefaultValue = 0.0f);
442 Category =
"Cesium|Metadata|PropertyTextureProperty")
446 double DefaultValue = 0.0);
486 Category =
"Cesium|Metadata|PropertyTextureProperty")
490 const FIntPoint& DefaultValue);
527 Category =
"Cesium|Metadata|PropertyTextureProperty")
531 const FVector2D& DefaultValue);
574 Category =
"Cesium|Metadata|PropertyTextureProperty")
578 const FIntVector& DefaultValue);
620 Category =
"Cesium|Metadata|PropertyTextureProperty")
624 const FVector& DefaultValue);
663 Category =
"Cesium|Metadata|PropertyTextureProperty")
667 const FVector4& DefaultValue);
688 Category =
"Cesium|Metadata|PropertyTextureProperty")
691 const FVector2D& UV);
711 Category =
"Cesium|Metadata|PropertyTextureProperty")
714 const FVector2D& UV);
730 Category =
"Cesium|Metadata|PropertyTextureProperty")
733 const FVector2D& UV);
745 Category =
"Cesium|Metadata|PropertyTextureProperty")
763 Category =
"Cesium|Metadata|PropertyTextureProperty")
781 Category =
"Cesium|Metadata|PropertyTextureProperty")
801 Category =
"Cesium|Metadata|PropertyTextureProperty")
821 Category =
"Cesium|Metadata|PropertyTextureProperty")
840 Category =
"Cesium|Metadata|PropertyTextureProperty")
857 Category =
"Cesium|Metadata|PropertyTextureProperty")
861 PRAGMA_DISABLE_DEPRECATION_WARNINGS
875 "Swizzles are no longer hardcoded in Unreal materials. To see what channels the property uses, use GetChannels instead."))
892 "Use GetChannels to get the channels array of a property texture property instead."))
895 PRAGMA_ENABLE_DEPRECATION_WARNINGS
@ EmptyPropertyWithDefault
@ ErrorInvalidPropertyData
ECesiumPropertyTexturePropertyStatus
Reports the status of a FCesiumPropertyTextureProperty.
@ ErrorUnsupportedProperty
static int64 GetGltfTextureCoordinateSetIndex(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the glTF texture coordinate set index used by the property texture property.
static FVector2D GetVector2D(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV, const FVector2D &DefaultValue)
Attempts to retrieve the value at the given texture coordinates as a FVector2D.
static ECesiumPropertyTexturePropertyStatus GetPropertyTexturePropertyStatus(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the status of the property texture property.
static uint8 GetByte(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV, uint8 DefaultValue=0)
Attempts to retrieve the value at the given texture coordinates as an unsigned 8-bit integer.
static ECesiumMetadataBlueprintType GetBlueprintType(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the best-fitting type for the property that is accessible from Blueprints.
static float GetFloat(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV, float DefaultValue=0.0f)
Attempts to retrieve the value at the given texture coordinates as a single-precision floating-point ...
static FCesiumMetadataValue GetMaximumValue(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the maximum value of this property.
static int64 GetComponentCount(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Get the component count of this property.
static int64 GetArraySize(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the number of elements in an array of this property.
static FVector4 GetVector4(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV, const FVector4 &DefaultValue)
Attempts to retrieve the value at the given texture coordinates as a FVector4.
static FCesiumMetadataValue GetScale(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the scale of this property.
static FCesiumMetadataValue GetRawValue(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV)
Retrieves the raw value of the property for the given feature.
static FCesiumMetadataValue GetOffset(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the offset of this property.
static FCesiumPropertyArray GetArray(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV)
Attempts to retrieve the value for the given texture coordinates as a FCesiumPropertyArray.
static FCesiumMetadataValue GetMinimumValue(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the minimum value of this property.
static FIntVector GetIntVector(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV, const FIntVector &DefaultValue)
Attempts to retrieve the value at the given texture coordinates as a FIntVector.
static int64 GetUnrealUVChannel(const UPrimitiveComponent *Component, UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the UV channel containing the texture coordinate set that is used by the property texture proper...
static int32 GetInteger(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV, int32 DefaultValue=0)
Attempts to retrieve the value at the given texture coordinates as a signed 32-bit integer.
static FCesiumMetadataValue GetNoDataValue(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the "no data" value of this property, as defined by its class property.
static FCesiumMetadataValueType GetValueType(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the type of the metadata value as defined in the EXT_structural_metadata extension.
static FIntPoint GetIntPoint(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV, const FIntPoint &DefaultValue)
Attempts to retrieve the value at the given texture coordinates as a FIntPoint.
static TArray< int64 > GetChannels(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Get the channels array of this property.
static FCesiumMetadataValue GetValue(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV)
Retrieves the value of the property for the given texture coordinates.
static PRAGMA_DISABLE_DEPRECATION_WARNINGS FString GetSwizzle(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Get the string representing how the metadata is encoded into a pixel color.
static bool IsNormalized(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Whether this property is normalized.
static ECesiumMetadataBlueprintType GetArrayElementBlueprintType(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the best-fitting Blueprints type for the elements in this property's array values.
static double GetFloat64(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV, double DefaultValue=0.0)
Attempts to retrieve the value at the given texture coordinates as a double-precision floating-point ...
static FVector GetVector(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV, const FVector &DefaultValue)
Attempts to retrieve the value at the given texture coordinates as a FVector.
static int64 GetInteger64(UPARAM(ref) const FCesiumPropertyTextureProperty &Property, const FVector2D &UV, int64 DefaultValue=0)
Attempts to retrieve the value for the given feature as a signed 64-bit integer.
static FCesiumMetadataValue GetDefaultValue(UPARAM(ref) const FCesiumPropertyTextureProperty &Property)
Gets the default value of this property, as defined by its class property.
A Blueprint-accessible wrapper for an array value from 3D Tiles or glTF metadata.
A blueprint-accessible wrapper for a property texture property from a glTF.
const int64 getTexCoordSetIndex() const
const CesiumGltf::Sampler * getSampler() const
FCesiumPropertyTextureProperty()
const std::optional< CesiumGltf::KhrTextureTransform > getTextureTransform() const
friend class UCesiumPropertyTexturePropertyBlueprintLibrary
const CesiumImage::ImageAsset * getImage() const
FCesiumPropertyTextureProperty(const CesiumGltf::PropertyTexturePropertyView< T, Normalized > &property, const TSharedPtr< FCesiumMetadataEnum > &pEnumDefinition=nullptr)