Skip to content

Commit 330a81d

Browse files
committed
Add editor utility
1 parent 69f3dbf commit 330a81d

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

Content/GenerateFoliageUtility.uasset

118 KB
Binary file not shown.

Source/CesiumRuntime/Private/CesiumGltfComponent.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -2799,6 +2799,7 @@ void UCesiumGltfComponent::AttachRasterTile(
27992799
const glm::dvec2& translation,
28002800
const glm::dvec2& scale,
28012801
int32 textureCoordinateID) {
2802+
this->RasterTexture = pTexture;
28022803

28032804
#if CESIUM_UNREAL_ENGINE_DOUBLE
28042805
FVector4 translationAndScale(translation.x, translation.y, scale.x, scale.y);
@@ -2872,6 +2873,7 @@ void UCesiumGltfComponent::DetachRasterTile(
28722873
const Cesium3DTilesSelection::Tile& tile,
28732874
const Cesium3DTilesSelection::RasterOverlayTile& rasterTile,
28742875
UTexture2D* pTexture) {
2876+
this->RasterTexture = nullptr;
28752877

28762878
forEachPrimitiveComponent(
28772879
this,

Source/CesiumRuntime/Private/CesiumGltfComponent.h

+3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ class UCesiumGltfComponent : public USceneComponent {
122122

123123
void UpdateFade(float fadePercentage, bool fadingIn);
124124

125+
UPROPERTY(EditAnywhere, Category = "Rendering", BlueprintReadWrite)
126+
UTexture2D* RasterTexture;
127+
125128
private:
126129
UPROPERTY()
127130
UTexture2D* Transparent1x1 = nullptr;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from samgeo import tms_to_geotiff
2+
from samgeo.text_sam import LangSAM
3+
import argparse
4+
5+
sam = LangSAM()
6+
text_prompt = "tree"
7+
8+
parser = argparse.ArgumentParser(description='Parse filename')
9+
parser.add_argument("--input")
10+
parser.add_argument("--output")
11+
args = parser.parse_args()
12+
13+
input_value = args.input
14+
output_value = args.output
15+
16+
sam.predict(input_value, text_prompt, box_threshold=0.27, text_threshold=0.75)
17+
sam.show_anns(
18+
cmap='Greys_r',
19+
add_boxes=False,
20+
alpha=1,
21+
title='Forest Segmentation',
22+
blend=False,
23+
output=output_value,
24+
)

0 commit comments

Comments
 (0)