Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
timoore committed Aug 26, 2024
1 parent 5dc202e commit 53a5394
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Source/CesiumRuntime/Private/CesiumFeaturesMetadataComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,15 @@ void AutoFillPropertyTextureDescriptions(
void AutoFillFeatureIdSetDescriptions(
TArray<FCesiumFeatureIdSetDescription>& Descriptions,
const FCesiumPrimitiveFeatures& Features,
const FCesiumInstanceFeatures* InstanceFeatures,
const TArray<FCesiumPropertyTable>& PropertyTables) {
const TArray<FCesiumFeatureIdSet> featureIDSets =
TArray<FCesiumFeatureIdSet> featureIDSets =
UCesiumPrimitiveFeaturesBlueprintLibrary::GetFeatureIDSets(Features);
if (InstanceFeatures) {
featureIDSets.Append(
UCesiumInstanceFeaturesBlueprintLibrary::GetFeatureIDSets(
*InstanceFeatures));
}
int32 featureIDTextureCounter = 0;

for (const FCesiumFeatureIdSet& featureIDSet : featureIDSets) {
Expand Down Expand Up @@ -391,9 +397,16 @@ void UCesiumFeaturesMetadataComponent::AutoFill() {
const TArray<FCesiumPropertyTable>& propertyTables =
UCesiumModelMetadataBlueprintLibrary::GetPropertyTables(
modelMetadata);
const FCesiumInstanceFeatures* pInstanceFeatures = nullptr;
const auto* pInstancedComponent =
Cast<UCesiumGltfInstancedComponent>(pChildComponent);
if (pInstancedComponent) {
pInstanceFeatures = pInstancedComponent->pInstanceFeatures.Get();
}
AutoFillFeatureIdSetDescriptions(
this->FeatureIdSets,
primitiveFeatures,
pInstanceFeatures,
propertyTables);

const FCesiumPrimitiveMetadata& primitiveMetadata = primData.Metadata;
Expand Down
17 changes: 17 additions & 0 deletions Source/CesiumRuntime/Private/CesiumGltfComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3170,6 +3170,23 @@ static void SetMetadataParameterValues_DEPRECATED(
PRAGMA_ENABLE_DEPRECATION_WARNINGS
#pragma endregion

namespace {
void addInstanceFeatureIds(UCesiumGltfInstancedComponent* pInstancedComponent) {
const FCesiumInstanceFeatures& instanceFeatures =
UCesiumInstanceFeaturesBlueprintLibrary::GetInstanceFeatures(
pInstancedComponent);
const TArray<FCesiumFeatureIdSet>& featureIdSets =
UCesiumInstanceFeaturesBlueprintLibrary::GetFeatureIDSets(instanceFeatures);
int32 featureSetCount = featureIdSets.Num();
if (featureSetCount == 0) {
return;
}
for (const auto& idSet : featureIdSets) {
}

}
} // namespace

static void loadPrimitiveGameThreadPart(
CesiumGltf::Model& model,
UCesiumGltfComponent* pGltf,
Expand Down

0 comments on commit 53a5394

Please sign in to comment.