Skip to content

Commit

Permalink
Merge pull request #1591 from CesiumGS/water-mask-checkbox
Browse files Browse the repository at this point in the history
Remove decoy checkbox on "Enable Water Mask"
  • Loading branch information
kring authored Feb 1, 2025
2 parents 43a0def + 9d569f1 commit 1044f5c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Fixed a crash in `UCesiumIonServer` when running in a packaged build where tilesets are only created at runtime.
- Worked around a limitation in Unreal's `FMatrix` -> `FTransform` conversion that prevented models with a small scale factor (e.g., where vertex positions are expressed in millimeters) from rendering because their scale was treated as 0.0.
- Fixed a crash when calling `SampleHeightMostDetailed` blueprint function without a valid tileset.
- Removed duplicate "Enable Water Mask" checkbox on `Cesium3DTileset` resulting from EditCondition flag.

### v2.12.0 - 2025-01-02

Expand Down
13 changes: 9 additions & 4 deletions Source/CesiumRuntime/Private/Cesium3DTileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ ACesium3DTileset::ACesium3DTileset()
this->Root = this->RootComponent;

PlatformName = UGameplayStatics::GetPlatformName();

#if WITH_EDITOR
bIsMac = PlatformName == TEXT("Mac");
#endif
}

ACesium3DTileset::~ACesium3DTileset() { this->DestroyTileset(); }
Expand Down Expand Up @@ -2472,6 +2468,15 @@ void ACesium3DTileset::PostEditImport() {
// Recreate the tileset on Paste.
this->DestroyTileset();
}

bool ACesium3DTileset::CanEditChange(const FProperty* InProperty) const {
if (InProperty->GetFName() ==
GET_MEMBER_NAME_CHECKED(ACesium3DTileset, EnableWaterMask)) {
// Disable this option on Mac
return PlatformName != TEXT("Mac");
}
return true;
}
#endif

void ACesium3DTileset::BeginDestroy() {
Expand Down
9 changes: 2 additions & 7 deletions Source/CesiumRuntime/Public/Cesium3DTileset.h
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,7 @@ class CESIUMRUNTIME_API ACesium3DTileset : public AActor {
EditAnywhere,
BlueprintGetter = GetEnableWaterMask,
BlueprintSetter = SetEnableWaterMask,
Category = "Cesium|Rendering",
meta = (EditCondition = "!bIsMac"))
Category = "Cesium|Rendering")
bool EnableWaterMask = false;

/**
Expand Down Expand Up @@ -955,11 +954,6 @@ class CESIUMRUNTIME_API ACesium3DTileset : public AActor {
UPROPERTY()
FString PlatformName;

#if WITH_EDITORONLY_DATA
UPROPERTY()
bool bIsMac;
#endif

public:
UFUNCTION(BlueprintGetter, Category = "Cesium")
float GetLoadProgress() const { return LoadProgress; }
Expand Down Expand Up @@ -1155,6 +1149,7 @@ class CESIUMRUNTIME_API ACesium3DTileset : public AActor {
FPropertyChangedChainEvent& PropertyChangedChainEvent) override;
virtual void PostEditUndo() override;
virtual void PostEditImport() override;
virtual bool CanEditChange(const FProperty* InProperty) const override;
#endif

protected:
Expand Down

0 comments on commit 1044f5c

Please sign in to comment.