Download unreal/create-map.py from Snapkitty/repoverse: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/Snapkitty/repoverse/resolve/main/unreal/create-map.py
- Command line
-
hf download hf://Snapkitty/repoverse/unreal/create-map.py
-
curl -L -o create-map.py https://huggingface.co/Snapkitty/repoverse/resolve/main/unreal/create-map.py
1.04 kB
| import unreal | |
| # Preserve existing maps and the 2D default. The launcher selects the 3D GameMode. | |
| if not unreal.EditorAssetLibrary.does_asset_exist("/Game/Maps/Repoverse"): | |
| subsystem = unreal.get_editor_subsystem(unreal.LevelEditorSubsystem) | |
| subsystem.new_level("/Game/Maps/Repoverse") | |
| subsystem.save_current_level() | |
| if not unreal.EditorAssetLibrary.does_asset_exist("/Game/Materials/M_Repoverse"): | |
| material = unreal.AssetToolsHelpers.get_asset_tools().create_asset( | |
| "M_Repoverse", "/Game/Materials", unreal.Material, unreal.MaterialFactoryNew()) | |
| vertex = unreal.MaterialEditingLibrary.create_material_expression(material, unreal.MaterialExpressionVertexColor) | |
| unreal.MaterialEditingLibrary.connect_material_property(vertex, "RGB", unreal.MaterialProperty.MP_BASE_COLOR) | |
| unreal.MaterialEditingLibrary.connect_material_property(vertex, "RGB", unreal.MaterialProperty.MP_EMISSIVE_COLOR) | |
| unreal.MaterialEditingLibrary.recompile_material(material) | |
| unreal.EditorAssetLibrary.save_loaded_asset(material) | |