|
4 | 4 | alpha_brush_path = sys.argv[1] |
5 | 5 | alpha_brush_name = sys.argv[2] |
6 | 6 | 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 |
12 | 12 |
|
13 | 13 | # Import known images as a list of Texture2D objects |
14 | 14 | alpha_texture_png = heightmap_directory + "\\" + alpha_brush_name + ".png" |
|
18 | 18 | data.set_editor_property('filenames', [alpha_texture_png]) |
19 | 19 | lst_texture2D = unreal.AssetToolsHelpers.get_asset_tools().import_assets_automated(data) |
20 | 20 |
|
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) |
24 | 28 |
|
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) |
27 | 31 |
|
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