-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No more guessing algorithms
- Loading branch information
Showing
10 changed files
with
917 additions
and
618 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# BlenderUmap | ||
A Java tool to export Fortnite .umaps and a Python script to import it. More games will be supported as time goes on. | ||
|
||
## Usage | ||
* Before running the tool you need to have 64-bit Java installed. [Get it here. (choose 64-bit Offline)](https://www.java.com/en/download/manual.jsp)\ | ||
**32-bit Java won't work with this tool!** | ||
* Extract the zip file | ||
* Edit config.json to suit your needs | ||
* Execute the bat | ||
* Make sure you have the [Blender PSK import/export plugin](https://github.com/Befzz/blender3d_import_psk_psa) **at least version 2.7.13** installed. If you use prior versions of the plugin the scaling of the props will appear broken. | ||
* In Blender, import the python file as a script (via scripting tab) | ||
* (Optional) If you want to see the output of the script, show the system console (Window > Toggle System Console) | ||
* Click Run Script (Alt+P), Blender will freeze if all goes well | ||
* Profit! | ||
|
||
## config.json | ||
* **`PaksDirectory`: Path to the Paks folder.** | ||
* `UEVersion`: Unreal Engine version. Supports up to UE4.25. | ||
* **`EncryptionKeys`: List of AES keys to use for loading the paks** | ||
* `Guid`: Identify a pak by its encryption key GUID. Use `00000000000000000000000000000000` (32 0's) to refer to the main paks. | ||
* `FileName`: Alternatively, you can use this to identify a pak by its file name. | ||
* `Key`: The pak's encryption key, in either hex (starting with "0x") or base64. | ||
* `bReadMaterials`: Export materials. Materials are experimental! Not all imported materials will be perfect. **Min. 24GB of RAM recommended!** | ||
* `bRunUModel`: Run UModel within the exporting process to export meshes, materials, and textures. | ||
* `UModelAdditionalArgs`: Additional command line args when starting UModel. | ||
* `bDumpAssets`: Save assets as JSON format, useful for debugging. | ||
* **`ExportPackage`: The .umap you want to export.** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* (C) 2020 amrsatrio. All rights reserved. | ||
*/ | ||
package com.tb24.blenderumap; | ||
|
||
import java.nio.ByteOrder; | ||
|
||
public class ByteArrayUtils { | ||
private static final char[] LOOKUP_TABLE_LOWER = new char[]{0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66}; | ||
private static final char[] LOOKUP_TABLE_UPPER = new char[]{0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46}; | ||
|
||
// https://stackoverflow.com/a/58118078 | ||
public static String encode(byte[] byteArray, boolean upperCase, ByteOrder byteOrder) { | ||
// our output size will be exactly 2x byte-array length | ||
final char[] buffer = new char[byteArray.length * 2]; | ||
|
||
// choose lower or uppercase lookup table | ||
final char[] lookup = upperCase ? LOOKUP_TABLE_UPPER : LOOKUP_TABLE_LOWER; | ||
|
||
int index; | ||
for (int i = 0; i < byteArray.length; i++) { | ||
// for little endian we count from last to first | ||
index = (byteOrder == ByteOrder.BIG_ENDIAN) ? i : byteArray.length - i - 1; | ||
|
||
// extract the upper 4 bit and look up char (0-A) | ||
buffer[i << 1] = lookup[(byteArray[index] >> 4) & 0xF]; | ||
// extract the lower 4 bit and look up char (0-A) | ||
buffer[(i << 1) + 1] = lookup[(byteArray[index] & 0xF)]; | ||
} | ||
return new String(buffer); | ||
} | ||
|
||
public static String encode(byte[] byteArray) { | ||
return encode(byteArray, false, ByteOrder.BIG_ENDIAN); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.