diff --git a/Util/DockerUtils/dist/build.bat b/Util/DockerUtils/dist/build.bat new file mode 100644 index 000000000..c86dfbfdc --- /dev/null +++ b/Util/DockerUtils/dist/build.bat @@ -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 + ) +) diff --git a/Util/DockerUtils/dist/build.sh b/Util/DockerUtils/dist/build.sh index 3adb3e504..6044c0466 100644 --- a/Util/DockerUtils/dist/build.sh +++ b/Util/DockerUtils/dist/build.sh @@ -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