6#include "GenericPlatform/GenericPlatform.h"
7#include "Kismet/BlueprintFunctionLibrary.h"
8#include <CesiumGltf/KhrTextureTransform.h>
9#include <CesiumGltf/PropertyTexturePropertyView.h>
12#include "CesiumPropertyTextureProperty.generated.h"
41 GENERATED_USTRUCT_BODY()
50 template <
typename T,
bool Normalized>
56 _normalized(Normalized) {
57 switch (Property.status()) {
58 case CesiumGltf::PropertyTexturePropertyViewStatus::Valid:
59 _status = ECesiumPropertyTexturePropertyStatus::Valid;
61 case CesiumGltf::PropertyTexturePropertyViewStatus::
62 EmptyPropertyWithDefault:
63 _status = ECesiumPropertyTexturePropertyStatus::EmptyPropertyWithDefault;
65 case CesiumGltf::PropertyTexturePropertyViewStatus::
66 ErrorUnsupportedProperty:
67 _status = ECesiumPropertyTexturePropertyStatus::ErrorUnsupportedProperty;
69 case CesiumGltf::PropertyTexturePropertyViewStatus::
70 ErrorInvalidPropertyTexture:
71 case CesiumGltf::PropertyTexturePropertyViewStatus::
72 ErrorNonexistentProperty:
73 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorTypeMismatch:
74 case CesiumGltf::PropertyTexturePropertyViewStatus::
75 ErrorComponentTypeMismatch:
76 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorArrayTypeMismatch:
77 case CesiumGltf::PropertyTexturePropertyViewStatus::
78 ErrorInvalidNormalization:
79 case CesiumGltf::PropertyTexturePropertyViewStatus::
80 ErrorNormalizationMismatch:
81 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorInvalidOffset:
82 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorInvalidScale:
83 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorInvalidMax:
84 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorInvalidMin:
85 case CesiumGltf::PropertyTexturePropertyViewStatus::ErrorInvalidNoDataValue:
86 case CesiumGltf::PropertyTexturePropertyViewStatus::
87 ErrorInvalidDefaultValue:
91 _status = ECesiumPropertyTexturePropertyStatus::ErrorInvalidPropertyData;
95 _valueType = TypeToMetadataValueType<T>();
96 _normalized = Normalized;
102 const std::optional<CesiumGltf::KhrTextureTransform>
118 : public UBlueprintFunctionLibrary {
131 Category =
"Cesium|Metadata|PropertyTextureProperty")
145 Category = "Cesium|Metadata|PropertyTextureProperty")
159 Category = "Cesium|Metadata|PropertyTextureProperty")
173 Category = "Cesium|Metadata|PropertyTextureProperty")
186 Category = "Cesium|Metadata|PropertyTextureProperty")
202 Category = "Cesium|Metadata|PropertyTextureProperty")
229 Category = "Cesium|Metadata|PropertyTextureProperty")
231 const UPrimitiveComponent* Component,
244 Category = "Cesium|Metadata|PropertyTextureProperty")
277 Category = "Cesium|Metadata|PropertyTextureProperty")
281 uint8 DefaultValue = 0);
313 Category = "Cesium|Metadata|PropertyTextureProperty")
317 int32 DefaultValue = 0);
351 Category = "Cesium|Metadata|PropertyTextureProperty")
355 float DefaultValue = 0.0f);
388 Category = "Cesium|Metadata|PropertyTextureProperty")
392 double DefaultValue = 0.0);
432 Category = "Cesium|Metadata|PropertyTextureProperty")
436 const FIntPoint& DefaultValue);
473 Category = "Cesium|Metadata|PropertyTextureProperty")
477 const FVector2D& DefaultValue);
520 Category = "Cesium|Metadata|PropertyTextureProperty")
524 const FIntVector& DefaultValue);
566 Category = "Cesium|Metadata|PropertyTextureProperty")
570 const FVector& DefaultValue);
609 Category = "Cesium|Metadata|PropertyTextureProperty")
613 const FVector4& DefaultValue);
634 Category = "Cesium|Metadata|PropertyTextureProperty")
637 const FVector2D& UV);
657 Category = "Cesium|Metadata|PropertyTextureProperty")
660 const FVector2D& UV);
676 Category = "Cesium|Metadata|PropertyTextureProperty")
679 const FVector2D& UV);
691 Category = "Cesium|Metadata|PropertyTextureProperty")
709 Category = "Cesium|Metadata|PropertyTextureProperty")
727 Category = "Cesium|Metadata|PropertyTextureProperty")
747 Category = "Cesium|Metadata|PropertyTextureProperty")
767 Category = "Cesium|Metadata|PropertyTextureProperty")
786 Category = "Cesium|Metadata|PropertyTextureProperty")
803 Category = "Cesium|Metadata|PropertyTextureProperty")
807 PRAGMA_DISABLE_DEPRECATION_WARNINGS
821 "Swizzles are no longer hardcoded in Unreal materials. To see what channels the property uses, use
GetChannels instead."))
838 "Use
GetChannels to get the channels array of a property texture property instead."))
841 PRAGMA_ENABLE_DEPRECATION_WARNINGS
ECesiumPropertyTexturePropertyStatus
Reports the status of a FCesiumPropertyTextureProperty.
@ EmptyPropertyWithDefault
@ ErrorUnsupportedProperty
@ ErrorInvalidPropertyData
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 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 property in glTF metadata.
A blueprint-accessible wrapper for a property texture property from a glTF.
const CesiumGltf::ImageAsset * getImage() const
const int64 getTexCoordSetIndex() const
const CesiumGltf::Sampler * getSampler() const
FCesiumPropertyTextureProperty()
const std::optional< CesiumGltf::KhrTextureTransform > getTextureTransform() const
FCesiumPropertyTextureProperty(const CesiumGltf::PropertyTexturePropertyView< T, Normalized > &Property)