Added a Fix materials button in Payday2MapBuilder so it PAYDAY 3 Loads the map

This commit is contained in:
boo3 2024-01-17 21:11:54 +01:00
parent aeb67fdfea
commit 85e8368259
4 changed files with 3 additions and 2 deletions

View File

@ -20,12 +20,13 @@ for root, dirs, files in os.walk(model_directory):
relative_path = os.path.relpath(file_path, model_directory) relative_path = os.path.relpath(file_path, model_directory)
# Construct the destination path in the Content Browser # Construct the destination path in the Content Browser
destination_path = "/Game/units/" + os.path.splitext(relative_path.replace("\\", "/"))[0] destination_path = "/Game/Mods/YourModName/Units/" + os.path.splitext(relative_path.replace("\\", "/"))[0]
# Create an import task # Create an import task
import_task = unreal.AssetImportTask() import_task = unreal.AssetImportTask()
import_task.filename = file_path import_task.filename = file_path
import_task.destination_path = destination_path import_task.destination_path = destination_path
import_task.automated = True
# Import the .fbx file # Import the .fbx file
asset_tools.import_asset_tasks([import_task]) asset_tools.import_asset_tasks([import_task])

View File

@ -59,7 +59,7 @@ def parse_xml_to_json(xml_file_path, json_file_path, include_unit_id=False):
} }
# Generate Unreal object reference # Generate Unreal object reference
object_reference = f"/Script/Engine.StaticMesh'/Game/{path}/{unit_description}.{unit_description}'" object_reference = f"/Script/Engine.StaticMesh'/Game/Mods/YourModName/Units/{path}/{unit_description}.{unit_description}'"
# Use 'name' instead of 'unit_id' # Use 'name' instead of 'unit_id'
unit_data = { unit_data = {