Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Amrsatrio/BlenderUmap
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.3
Choose a base ref
...
head repository: Amrsatrio/BlenderUmap
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 15 commits
  • 15 files changed
  • 1 contributor

Commits on Oct 14, 2020

  1. Logging

    Amrsatrio committed Oct 14, 2020
    Copy the full SHA
    ec8bb3e View commit details

Commits on Dec 22, 2020

  1. Copy the full SHA
    60363b3 View commit details

Commits on Jan 12, 2021

  1. FetchFortniteAesKey now fetches mappings for latest

    Using object classes does look good, but it breaks compatibility for games other than Fortnite
    Amrsatrio committed Jan 12, 2021
    Copy the full SHA
    b8a126a View commit details

Commits on Jan 13, 2021

  1. Copy the full SHA
    a9b9a1f View commit details
  2. Update README.md

    Amrsatrio committed Jan 13, 2021
    Copy the full SHA
    0f23285 View commit details

Commits on Jul 6, 2021

  1. Fix BenBot domain

    Amrsatrio committed Jul 6, 2021
    Copy the full SHA
    5659ba7 View commit details
  2. Update deps

    Amrsatrio committed Jul 6, 2021
    Copy the full SHA
    8b77c22 View commit details
  3. Copy the full SHA
    08cf05b View commit details
  4. Add disclaimer into readme

    Amrsatrio committed Jul 6, 2021
    Copy the full SHA
    7f4d78d View commit details

Commits on Aug 19, 2021

  1. Copy the full SHA
    a803fdb View commit details
  2. Bump version

    Amrsatrio committed Aug 19, 2021
    Copy the full SHA
    fc6d9ac View commit details

Commits on Aug 22, 2021

  1. Update build.gradle

    Amrsatrio committed Aug 22, 2021
    Copy the full SHA
    1af62d1 View commit details

Commits on Aug 24, 2021

  1. Rename .java to .kt

    Amrsatrio committed Aug 24, 2021
    Copy the full SHA
    fd0b593 View commit details
  2. Main now in Kotlin

    Amrsatrio committed Aug 24, 2021
    Copy the full SHA
    af99221 View commit details
  3. Some fixes

    Amrsatrio committed Aug 24, 2021
    Copy the full SHA
    b1d5c76 View commit details
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# BlenderUmap
A Java tool to export Fortnite .umaps and a Python script to import it. More games will be supported as time goes on.
A Java tool to export Fortnite .umaps and a Python script to import it.

## Disclaimer
This tool was made to fulfill my curiosity about exporting a Fortnite building into Blender back in May 2020, and I did not plan to support this for long term. Although I rarely release some updates to fix some breaking stuff with Fortnite (and/or incorporating enhancements on the underlying parser), **no support will be given when it's about small issues, failing to use the tool properly, or adding support for more games.** Take your time to read the stuff below, and thank you for your understanding.

## 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)\
@@ -15,16 +18,26 @@ A Java tool to export Fortnite .umaps and a Python script to import it. More gam
* Profit!

## config.json
* **`PaksDirectory`: Path to the Paks folder.**
* `UEVersion`: Unreal Engine version. Supports up to UE4.25.
* **`PaksDirectory`: Path to the Paks folder.** Backslashes must be doubled like this: `\\`.
* `UEVersion`: Unreal Engine version. Supports up to UE4.26.
* **`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.

Example for main paks:
```json
{
"Guid": "00000000000000000000000000000000",
"Key": "0x36983D73A17CAF253F9D1A322A79D6DC53D8E81B661B7564343F41D4835275D5"
}
```
* `bDumpAssets`: Save assets as JSON format, useful for debugging.
* `ObjectCacheSize`: Configure the object loader cache size to tune the performance, or set to 0 to disable. Defaults to 100.
* `bReadMaterials`: Export materials. Materials are experimental! Not all imported materials will be perfect. **Min. 16GB of RAM recommended!**
* `bExportToDDSWhenPossible`: Prefer PNG to DDS? Set this to `false` and textures will always be exported as PNG. **Warning: Export times will significantly increase when this is set to `false`!** Defaults to enabled.
* `bExportBuildingFoundations`: You can turn off exporting sub-buildings in large POIs if you want to quickly port the base POI structures, by setting this to `false`. Defaults to enabled.
* **`ExportPackage`: The .umap you want to export.** Accepts these path formats:
* /Game/Maps/MapName.umap
* GameName/Content/Maps/MapName.umap
* `/Game/Maps/MapName` (package path)
* `/Game/Maps/MapName.MapName` (object path)
* `GameName/Content/Maps/MapName.umap` (file path)
50 changes: 31 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
plugins {
id 'application'
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.4.0'
id 'org.jetbrains.kotlin.jvm' version '1.5.20'
id 'com.github.johnrengelman.shadow' version '7.0.0'
}

group 'com.tb24'
version '0.3.3'
version '0.4.3'

sourceCompatibility = 1.8
targetCompatibility = 1.8
@@ -20,36 +21,26 @@ application {

jar {
manifest {
attributes(
'Main-Class': javaMainClass
)
}

from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
attributes 'Main-Class': javaMainClass
}
}

repositories {
google()
mavenCentral()
maven { url 'https://dl.bintray.com/fungamesleaks/mavenRepo' }
maven { url 'https://jitpack.io' }
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.collection:collection-ktx:1.1.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
implementation 'com.google.code.gson:gson:2.8.7'
implementation 'com.squareup.okhttp3:okhttp:3.14.9'
implementation 'me.fungames:JFortniteParse:+' // :3.0.2'
implementation 'org.slf4j:slf4j-api:1.7.30'
testImplementation 'junit:junit:4.12'
implementation 'me.fungames:JFortniteParse:+'
implementation 'org.slf4j:slf4j-api:1.7.32'
testImplementation 'junit:junit:4.13.2'
}

compileKotlin {
@@ -59,3 +50,24 @@ compileKotlin {
compileTestKotlin {
kotlinOptions.jvmTarget = '1.8'
}

shadowJar {
baseName = project.name
classifier = ''
archiveVersion = ''
exclude "**/*.kotlin_builtins"
exclude "**/*.kotlin_metadata"
exclude "**/*.kotlin_module"
exclude 'META-INF/maven/**'
exclude '**/DEPENDENCIES'
exclude '**/LGPL2.1'
exclude '**/LICENSE'
exclude '**/LICENSE.txt'
exclude '**/NOTICE'
exclude '**/NOTICE.txt'
}

tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 1 addition & 5 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
includeBuild('../JFortniteParse') {
dependencySubstitution {
substitute module('me.fungames:JFortniteParse') with project(':')
}
}
includeBuild('../JFortniteParse')
35 changes: 24 additions & 11 deletions src/main/java/com/tb24/blenderumap/AssetUtils.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
package com.tb24.blenderumap

import me.fungames.jfortniteparse.ue4.assets.exports.UExport
import me.fungames.jfortniteparse.ue4.assets.exports.UObject
import me.fungames.jfortniteparse.ue4.assets.objects.FPropertyTag
import me.fungames.jfortniteparse.ue4.objects.core.misc.FGuid
import me.fungames.jfortniteparse.ue4.assets.objects.IPropertyHolder
import java.lang.reflect.ParameterizedType
import java.lang.reflect.Type
import kotlin.math.max

fun <T> getProp(properties: List<FPropertyTag>, name: String, clazz: Class<T>): T? {
fun <T> IPropertyHolder.getProp(name: String, type: Type): T? {
for (prop in properties) {
if (name == prop.name.text) {
return prop.getTagTypeValue(clazz)
val clazz = (if (type is ParameterizedType) type.rawType else type) as Class<T>
return prop.getTagTypeValue(clazz, type)
}
}
return null
}

fun <T> getProps(properties: List<FPropertyTag>, name: String, clazz: Class<T>): Array<T?> {
val collected: MutableList<FPropertyTag> = ArrayList()
inline fun <T> IPropertyHolder.getProp(name: String, clazz: Class<T>): T? = getProp(name, clazz as Type)
inline fun <reified T> IPropertyHolder.getProp(name: String): T? = getProp(name, T::class.java as Type)

fun <T> IPropertyHolder.getProps(name: String, clazz: Class<T>): Array<T?> {
val collected = mutableListOf<FPropertyTag>()
var maxIndex = -1
for (prop in properties) {
if (prop.name.text == name) {
@@ -31,9 +36,17 @@ fun <T> getProps(properties: List<FPropertyTag>, name: String, clazz: Class<T>):
return out
}

fun <T> UExport.getProp(name: String, clazz: Class<T>) = (this as UObject).getProp(name, clazz)
fun <T> UObject.getProp(name: String, clazz: Class<T>) = getProp(properties, name, clazz)
inline fun <reified T> UExport.get(name: String): T? = getProp(name, T::class.java)
inline fun <reified T> UObject.get(name: String): T? = getProp(name, T::class.java)
inline fun <reified T> IPropertyHolder.getProps(name: String) = getProps(name, T::class.java)

fun FGuid?.asString() = if (this == null) null else "%08x%08x%08x%08x".format(part1.toInt(), part2.toInt(), part3.toInt(), part4.toInt())
inline fun <reified T> UObject.getOrNullTraversing(name: String): T? {
var current = this
while (true) {
val value = current.getOrNull<T>(name)
if (value != null) {
//if (current != this) LOGGER.debug("{}.getOrNullTraversing(\"{}\") found value in {}", this.name, name, current.getPathName())
return value
}
current = current.template?.value ?: break
}
return null
}
36 changes: 0 additions & 36 deletions src/main/java/com/tb24/blenderumap/ByteArrayUtils.java

This file was deleted.

18 changes: 18 additions & 0 deletions src/main/java/com/tb24/blenderumap/Config.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.tb24.blenderumap;

import me.fungames.jfortniteparse.ue4.versions.Ue4Version;

import java.util.Collections;
import java.util.List;

public class Config {
public String PaksDirectory = "C:\\Program Files\\Epic Games\\Fortnite\\FortniteGame\\Content\\Paks";
public Ue4Version UEVersion = Ue4Version.GAME_UE4_LATEST;
public List<MyFileProvider.EncryptionKey> EncryptionKeys = Collections.emptyList();
public boolean bDumpAssets = false;
public int ObjectCacheSize = 100;
public boolean bReadMaterials = true;
public boolean bExportToDDSWhenPossible = true;
public boolean bExportBuildingFoundations = true;
public String ExportPackage;
}
Loading