Export tool updated. Minor distribution fixes

This commit is contained in:
Daniel 2019-02-26 20:56:10 +01:00
parent bc9a713791
commit fe4fcb68ba
4 changed files with 43 additions and 44 deletions

View File

@ -1,6 +1,5 @@
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#if WITH_EDITOR
#include "MapProcessCommandlet.h"
#include "GameFramework/WorldSettings.h"
@ -13,6 +12,7 @@ UMapProcessCommandlet::UMapProcessCommandlet()
IsEditor = false;
IsServer = false;
LogToConsole = true;
#if WITH_EDITORONLY_DATA
static ConstructorHelpers::FObjectFinder<UMaterial> MarkingNode(TEXT(
"Material'/Game/Carla/Static/GenericMaterials/LaneMarking/M_MarkingLane_W.M_MarkingLane_W'"));
static ConstructorHelpers::FObjectFinder<UMaterial> RoadNode(TEXT(
@ -25,7 +25,9 @@ UMapProcessCommandlet::UMapProcessCommandlet()
MarkingNodeMaterial = (UMaterial *) MarkingNode.Object;
RoadNodeMaterial = (UMaterial *) RoadNode.Object;
MarkingNodeMaterialAux = (UMaterial *) RoadNodeAux.Object;
#endif
}
#if WITH_EDITOR
bool UMapProcessCommandlet::ParseParams(const FString& InParams)
{

View File

@ -1,5 +1,4 @@
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#if WITH_EDITOR
#pragma once
#include "Commandlets/Commandlet.h"
@ -7,13 +6,14 @@
#include <UObject/Package.h>
#include <Misc/PackageName.h>
#include "CoreMinimal.h"
#include <AssetRegistry/Public/AssetRegistryModule.h>
#include <Runtime/Engine/Classes/Engine/ObjectLibrary.h>
#include <OpenDriveActor.h>
#if WITH_EDITOR
#include <Developer/AssetTools/Public/IAssetTools.h>
#include <Developer/AssetTools/Public/AssetToolsModule.h>
#include <AssetRegistry/Public/AssetRegistryModule.h>
#endif //WITH_EDITOR
#include <Runtime/Engine/Classes/Engine/StaticMeshActor.h>
#include "MapProcessCommandlet.generated.h"
UCLASS()
@ -23,9 +23,9 @@ class UMapProcessCommandlet
GENERATED_BODY()
public:
/** Default constructor. */
UMapProcessCommandlet();
#if WITH_EDITOR
/**
* Parses the command line parameters
@ -73,9 +73,10 @@ public:
*/
virtual int32 Main(const FString &Params) override;
#endif
private:
/** Materials for the workaround */
/**
* Workaround material for MarkingNodes mesh
@ -132,5 +133,3 @@ private:
UPROPERTY()
TArray<FAssetData> MapContents;
};
#endif

View File

@ -37,7 +37,7 @@ AOpenDriveActor::AOpenDriveActor(const FObjectInitializer &ObjectInitializer)
: Super(ObjectInitializer)
{
PrimaryActorTick.bCanEverTick = false;
#if WITH_EDITORONLY_DATA
static ConstructorHelpers::FObjectFinder<UBlueprint> TrafficLightBP(TEXT(
"Blueprint'/Game/Carla/Static/TrafficSigns/Streetlights_01/BP_TrafficLightPole.BP_TrafficLightPole'"));
TrafficLightBlueprintClass = (UClass *) TrafficLightBP.Object->GeneratedClass;
@ -65,6 +65,7 @@ AOpenDriveActor::AOpenDriveActor(const FObjectInitializer &ObjectInitializer)
static ConstructorHelpers::FObjectFinder<UBlueprint> TrafficSign100BP(TEXT(
"Blueprint'/Game/Carla/Static/TrafficSigns/PostSigns/Round/SpeedLimiters/BP_SpeedLimit100.BP_SpeedLimit100'"));
TrafficSign100BlueprintClass = (UClass *) TrafficSign100BP.Object->GeneratedClass;
#endif // WITH_EDITORONLY_DATA
// Structure to hold one-time initialization
static struct FConstructorStatics

View File

@ -22,8 +22,9 @@ USAGE_STRING="Usage: $0 [-h|--help] [-d|--dir] <outdir> [-f|--file] <filename>"
OUTPUT_DIRECTORY=""
FILE_NAME=""
MAP_PATH=""
OPTS=`getopt -o h,d::,f --long help,dir::,file:: -n 'parse-options' -- "$@"`
OPTS=`getopt -o h --long help,dir:,file:,map: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "$USAGE_STRING" ; exit 2; fi
@ -33,10 +34,13 @@ while true; do
case "$1" in
--dir )
OUTPUT_DIRECTORY="$2"
shift ;;
shift 2;;
--file )
FILE_NAME="$2"
shift ;;
shift 2;;
--map )
MAP_PATH="$2"
shift 2;;
-h | --help )
echo "$DOC_STRING"
echo "$USAGE_STRING"
@ -54,6 +58,8 @@ if [ -z "${FILE_NAME}" ]; then
FILE_NAME="CookedExportedMaps"
fi
# ==============================================================================
# -- Package project -----------------------------------------------------------
# ==============================================================================
@ -64,7 +70,7 @@ BUILD_FOLDER=${OUTPUT_DIRECTORY}
log "Packaging user content from version '$REPOSITORY_TAG'."
rm -Rf ${BUILD_FOLDER}
#rm -Rf ${BUILD_FOLDER}
mkdir -p ${BUILD_FOLDER}
pushd "${CARLAUE4_ROOT_FOLDER}" > /dev/null
@ -72,54 +78,45 @@ pushd "${CARLAUE4_ROOT_FOLDER}" > /dev/null
log "Current project directory: '${PWD}'"
MAP_LIST=""
for filepath in `find ${PWD}/Content/ -type f -name "*.umap"`; do
if [[ $filepath == *"/ExportedMaps/"* ]]; then
filepath="/Game/"${filepath#"${PWD}/Content/"}
if [ -z "${MAP_LIST}" ]; then
MAP_LIST=$filepath
else
MAP_LIST=$MAP_LIST+$filepath
if [ -z "${MAP_PATH}" ]; then
for filepath in `find ${PWD}/Content/ -type f -name "*.umap"`; do
if [[ $filepath == *"/ExportedMaps/"* ]]; then
filepath="/Game/"${filepath#"${PWD}/Content/"}
if [ -z "${MAP_LIST}" ]; then
MAP_LIST=$filepath
else
MAP_LIST=$MAP_LIST+$filepath
fi
fi
fi
done
done
else
MAP_LIST=${MAP_PATH}
fi
${UE4_ROOT}/Engine/Binaries/Linux/UE4Editor "${PWD}/CarlaUE4.uproject" -run=cook -map=${MAP_LIST} -cooksinglepackage -targetplatform="LinuxNoEditor" -OutputDir="${BUILD_FOLDER}/Cooked"
echo $MAP_LIST
${UE4_ROOT}/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun \
-project="${PWD}/CarlaUE4.uproject" -map=$MAP_LIST \
-nocompileeditor -nop4 -cook \
-archive -package -stage -nodebuginfo -build \
-clientconfig=Development -ue4exe=UE4Editor \
-targetplatform=Linux -CrashReporter -utf8output \
-SkipCookingEditorContent -archivedirectory="${BUILD_FOLDER}"
popd >/dev/null
if [[ ! -d ${BUILD_FOLDER}/LinuxNoEditor ]] ; then
fatal_error "Failed to package the project!"
fi
#if [[ ! -d ${BUILD_FOLDER}/LinuxNoEditor ]] ; then
# fatal_error "Failed to package the project!"
#fi
# ==============================================================================
# -- Zip the project -----------------------------------------------------------
# ==============================================================================
DESTINATION=${BUILD_FOLDER}/${FILE_NAME}.tar.gz
SOURCE=${BUILD_FOLDER}
SOURCE=${BUILD_FOLDER}/Cooked
pushd "${SOURCE}/LinuxNoEditor" >/dev/null
pushd "${SOURCE}" >/dev/null
log "Packaging build."
rm -Rf ./CarlaUE4/Saved
rm -Rf ./Engine
rm ./CarlaUE4.sh
rm ./Manifest_NonUFSFiles_Linux.txt
rm ./Manifest_UFSFiles_Linux.txt
rm -Rf ./CarlaUE4/Binaries
rm -Rf ./CarlaUE4/Config
rm -Rf ./CarlaUE4/Metadata
rm -Rf ./CarlaUE4/Plugins
rm ./CarlaUE4/AssetRegistry.bin
rm ./CarlaUE4/CarlaUE4.uproject
tar -czvf ${DESTINATION} *
@ -132,7 +129,7 @@ popd > /dev/null
log "Removing intermediate build."
rm -Rf ${BUILD_FOLDER}/LinuxNoEditor
rm -Rf ${BUILD_FOLDER}/Cooked
# ==============================================================================
# -- ...and we are done --------------------------------------------------------