Cesium for Unreal 2.15.0
Loading...
Searching...
No Matches
CesiumFeaturesMetadataComponent.h
Go to the documentation of this file.
1// Copyright 2020-2024 CesiumGS, Inc. and Contributors
2
3#pragma once
4
6#include "Components/ActorComponent.h"
7
8#if WITH_EDITOR
9#include "Materials/MaterialFunctionMaterialLayer.h"
10#endif
11
12#include "CesiumFeaturesMetadataComponent.generated.h"
13
14/**
15 * @brief A component that can be added to Cesium3DTileset actors to
16 * dictate what metadata to encode for access on the GPU. The selection can be
17 * automatically populated based on available metadata by clicking the
18 * "Auto Fill" button. Once a selection of desired metadata is made, the
19 * boiler-plate material code to access the selected properties can be
20 * auto-generated using the "Generate Material" button.
21 */
22UCLASS(ClassGroup = Cesium, Meta = (BlueprintSpawnableComponent))
23class CESIUMRUNTIME_API UCesiumFeaturesMetadataComponent
24 : public UActorComponent {
25 GENERATED_BODY()
26
27public:
28#if WITH_EDITOR
29 /**
30 * Populate the description of metadata and feature IDs using the current view
31 * of the tileset. This determines what to encode to the GPU based on the
32 * existing metadata.
33 *
34 * Warning: Using Auto Fill may populate the description with a large amount
35 * of metadata. Make sure to delete the properties that aren't relevant.
36 */
37 UFUNCTION(CallInEditor, Category = "Cesium")
38 void AutoFill();
39
40 /**
41 * This button can be used to create a boiler-plate material layer that
42 * exposes the requested metadata properties in the current description. The
43 * nodes to access the metadata will be added to TargetMaterialLayer if it
44 * exists. Otherwise a new material layer will be created in the /Content/
45 * folder and TargetMaterialLayer will be set to the new material layer.
46 */
47 UFUNCTION(CallInEditor, Category = "Cesium")
48 void GenerateMaterial();
49#endif
50
51#if WITH_EDITORONLY_DATA
52 /**
53 * This is the target UMaterialFunctionMaterialLayer that the
54 * boiler-plate material generation will use. When pressing
55 * "Generate Material", nodes will be added to this material to enable access
56 * to the requested metadata. If this is left blank, a new material layer
57 * will be created in the /Game/ folder.
58 */
59 UPROPERTY(EditAnywhere, Category = "Cesium")
60 UMaterialFunctionMaterialLayer* TargetMaterialLayer = nullptr;
61#endif
62
63 /**
64 * @brief Description of both feature IDs and metadata from a glTF via the
65 * EXT_mesh_features, EXT_instance_features, and EXT_structural_metadata
66 * extensions. Indicates what parts of the extension should be uploaded to the
67 * GPU for access in Unreal materials.
68 */
69
70 UPROPERTY(
71 EditAnywhere,
72 Category = "Cesium",
73 Meta =
74 (TitleProperty = "Name",
75 DisplayAfter = "TargetMaterialLayer",
76 ShowOnlyInnerProperties))
78
79 // Previously the properties of FCesiumFeaturesMetadataDescription were
80 // deconstructed here in order to flatten the Details panel UI. However, the
81 // ShowOnlyInnerProperties attribute accomplishes the same thing. These
82 // properties are deprecated but migrated over in PostLoad().
83
84 /**
85 * Description of the feature ID sets in the visible glTF primitives across
86 * the tileset.
87 */
88 UPROPERTY(
89 Meta =
90 (DeprecatedProperty,
91 DeprecationMessage =
92 "Use FeatureIdSets on the CesiumFeaturesMetadataDescription's Features instead."))
94
95 /**
96 * Names of the property textures used by the glTF primitives across the
97 * tileset.
98 *
99 * This should be a subset of the property textures listed in the model
100 * metadata. Property textures can be passed to the material even if they are
101 * not explicitly used by a glTF primitive, but the primitive may lack the
102 * corresponding sets of texture coordinates intended to sample them.
103 */
104 UPROPERTY(
105 Meta =
106 (DeprecatedProperty,
107 DeprecationMessage =
108 "Use PropertyTextureNames on the CesiumFeaturesMetadataDescription's PrimitiveMetadata instead."))
109 TSet<FString> PropertyTextureNames;
110
111 /**
112 * Descriptions of the property tables in the visible glTF
113 * models across the tileset.
114 */
115 UPROPERTY(
116 Meta =
117 (DeprecatedProperty,
118 DeprecationMessage =
119 "Use PropertyTables on the CesiumFeaturesMetadataDescription's ModelMetadata instead."))
121
122 /**
123 * Descriptions of property textures in the visible glTF models across
124 * the tileset.
125 */
126 UPROPERTY(
127 Meta =
128 (DeprecatedProperty,
129 DeprecationMessage =
130 "Use PropertyTextures on the CesiumFeaturesMetadataDescription's ModelMetadata instead."))
132
133protected:
134 /** PostLoad override. */
135 virtual void PostLoad() override;
136};
A component that can be added to Cesium3DTileset actors to dictate what metadata to encode for access...
TArray< FCesiumFeatureIdSetDescription > FeatureIdSets
Description of the feature ID sets in the visible glTF primitives across the tileset.
TArray< FCesiumPropertyTextureDescription > PropertyTextures
Descriptions of property textures in the visible glTF models across the tileset.
virtual void PostLoad() override
PostLoad override.
FCesiumFeaturesMetadataDescription Description
Description of both feature IDs and metadata from a glTF via the EXT_mesh_features,...
TArray< FCesiumPropertyTableDescription > PropertyTables
Descriptions of the property tables in the visible glTF models across the tileset.
TSet< FString > PropertyTextureNames
Names of the property textures used by the glTF primitives across the tileset.
Description of a feature ID set from either EXT_mesh_features or EXT_instance_features.
Description of both feature IDs and metadata from a glTF via the EXT_mesh_Features and EXT_structural...
Description of a property table containing properties to be encoded for access in Unreal materials.
Description of a property texture with properties that should be made accessible to Unreal materials.