Better build script

This commit is contained in:
bernat 2020-04-21 14:39:39 +02:00
parent 2eb2a0c047
commit 07ff7f3ad1
2 changed files with 47 additions and 20 deletions

29
Util/DockerUtils/dist/build.bat vendored Normal file
View File

@ -0,0 +1,29 @@
@echo off
if exist "crosswalks.obj" del crosswalks.obj
if exist "FBX2OBJ.exe" (
if exist "%1.fbx" (
rem convert FBX to OBJ
FBX2OBJ.exe %1.fbx %1.obj
)
)
if exist "%1.xodr" (
rem parse openDRIVE crosswalks (generate crosswalks.obj)
python get_xodr_crosswalks.py -f %1.xodr
) else (
echo "XODR file doesn't exist, ignoring crosswalks from openDRIVE"
)
if exist "crosswalks.obj" (
rem join both OBJ
python addOBJ.py %1.obj crosswalks.obj
)
if exist "%1.obj" (
if exist "RecastBuilder.exe" (
rem calculate the BIN file (result is same name .BIN)
RecastBuilder.exe %1.obj
)
)

View File

@ -1,21 +1,18 @@
#! /bin/bash
# check if the FBX file exist
if [ ! -f "$1.fbx" ]; then
echo Nothing to do: there is no FBX file
exit
if [ -f "crosswalks.obj" ]; then
rm crosswalks.obj
fi
# prepare to load .SO from current folder
export LD_LIBRARY_PATH="./"
# convert FBX to OBJ
chmod +x FBX2OBJ
./FBX2OBJ "$1.fbx" "$1.obj"
# check if the OBJ file exist
if [ ! -f "$1.obj" ]; then
echo Nothing to do: conversion from FBX to OBJ failed
exit
# check if the FBX file exist
if [ -f "FBX2OBJ" ]; then
if [ -f "$1.fbx" ]; then
# prepare to load .SO from current folder
export LD_LIBRARY_PATH="./"
# convert FBX to OBJ
chmod +x FBX2OBJ
./FBX2OBJ "$1.fbx" "$1.obj"
fi
fi
# check if the XODR file exist
@ -30,11 +27,12 @@ fi
if [ -f "crosswalks.obj" ]; then
# join both OBJ
python addOBJ.py "$1.obj" crosswalks.obj
rm crosswalks.obj
fi
# calculate the BIN file (result is same name .BIN)
chmod +x RecastBuilder
./RecastBuilder "$1.obj"
echo Success!
if [ -f "$1.obj" ]; then
if [ -f "RecastBuilder" ]; then
# calculate the BIN file (result is same name .BIN)
chmod +x RecastBuilder
./RecastBuilder "$1.obj"
fi
fi