Skip to content

Commit 8b39313

Browse files
committed
fix terrain magic bug
1 parent 811a8af commit 8b39313

2 files changed

Lines changed: 19 additions & 15 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:6fc8a760f1e19225baceb1d614cc65ecf9219a50e85f2b532a585099f32293d8
3-
size 584909
2+
oid sha256:85908d2835e782b8cbbab5845d884457bee0ec5614e023e1987d17efaf3eb649
3+
size 730981

Resources/main.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
alpha_brush_path = sys.argv[1]
55
alpha_brush_name = sys.argv[2]
66
heightmap_directory = sys.argv[3]
7-
alpha_textures_path = alpha_brush_path + "Textures/"
8-
9-
# Duplicate stamp brush
10-
brush_template = "/Game/Brushes/PEAKS/Peak_10_brush"
11-
unreal.EditorAssetLibrary.duplicate_asset(brush_template, alpha_brush_path + alpha_brush_name)
7+
alpha_brush_template_path = sys.argv[4]
8+
alpha_textures = sys.argv[5]
9+
heightmap_property = sys.argv[6]
10+
stamp_tool = sys.argv[7]
11+
alpha_textures_path = alpha_brush_path + alpha_textures
1212

1313
# Import known images as a list of Texture2D objects
1414
alpha_texture_png = heightmap_directory + "\\" + alpha_brush_name + ".png"
@@ -18,13 +18,17 @@
1818
data.set_editor_property('filenames', [alpha_texture_png])
1919
lst_texture2D = unreal.AssetToolsHelpers.get_asset_tools().import_assets_automated(data)
2020

21-
# Load texture
22-
blueprint_generated = unreal.EditorAssetLibrary.load_blueprint_class(alpha_brush_path + alpha_brush_name)
23-
texture = unreal.EditorAssetLibrary.load_asset(alpha_textures_path + alpha_brush_name)
21+
if stamp_tool == 'Unreal Stamp Brush Plugin':
22+
# Duplicate stamp brush
23+
unreal.EditorAssetLibrary.duplicate_asset(alpha_brush_template_path, alpha_brush_path + alpha_brush_name)
24+
25+
# Load texture
26+
blueprint_generated = unreal.EditorAssetLibrary.load_blueprint_class(alpha_brush_path + alpha_brush_name)
27+
texture = unreal.EditorAssetLibrary.load_asset(alpha_textures_path + alpha_brush_name)
2428

25-
# from that, get the class default object ( the actual template for the blueprint )
26-
blueprint_class_default = unreal.get_default_object(blueprint_generated)
29+
# from that, get the class default object ( the actual template for the blueprint )
30+
blueprint_class_default = unreal.get_default_object(blueprint_generated)
2731

28-
# set or get properties
29-
blueprint_class_default.set_editor_property("HeightMap", texture)
30-
unreal.EditorAssetLibrary.save_asset(alpha_brush_path + alpha_brush_name)
32+
# set or get properties
33+
blueprint_class_default.set_editor_property(heightmap_property, texture)
34+
unreal.EditorAssetLibrary.save_asset(alpha_brush_path + alpha_brush_name)

0 commit comments

Comments
 (0)