Commit 0d68127e authored by Lucas Mello Schnorr's avatar Lucas Mello Schnorr
Browse files

correctly dealing with output dir

parent 343c2faa
...@@ -63,6 +63,8 @@ if [ "$DOWNLOAD" = "true" ]; then ...@@ -63,6 +63,8 @@ if [ "$DOWNLOAD" = "true" ]; then
wget $URL wget $URL
fi fi
SCRIPT_CURRENT_DIR=$(pwd)
###################################### ######################################
# Established Unique ID based on URL # # Established Unique ID based on URL #
###################################### ######################################
...@@ -119,8 +121,7 @@ elif [ "$DEFAULT_ANIMATION" = "false" ]; then ...@@ -119,8 +121,7 @@ elif [ "$DEFAULT_ANIMATION" = "false" ]; then
################################################# #################################################
# Create directory where animations will be saved # Create directory where animations will be saved
BLENDER_OUTPUT=$UNIQUEID BLENDER_OUTPUT=$(pwd)/$UNIQUEID
rm -rf ${BLENDER_OUTPUT}
mkdir --verbose -p ${BLENDER_OUTPUT} mkdir --verbose -p ${BLENDER_OUTPUT}
# Get all extracted files # Get all extracted files
...@@ -150,15 +151,20 @@ elif [ "$DEFAULT_ANIMATION" = "false" ]; then ...@@ -150,15 +151,20 @@ elif [ "$DEFAULT_ANIMATION" = "false" ]; then
for type in "BarrelCamera" "OverviewCamera" "ForwardCamera"; do for type in "BarrelCamera" "OverviewCamera" "ForwardCamera"; do
echo "Processing ${EVENT_UNIQUE_ID} with $type Camera in blender" echo "Processing ${EVENT_UNIQUE_ID} with $type Camera in blender"
blender -noaudio --background -P animate_particles.py -- -radius=0.05 -duration=1 -camera=${type} -datafile="${FILE_WITH_DATA}" -n_event=${EVENT_ID} -simulated_t=0.01 -fps=5 -resolution=50 -stamp_note="${EVENT_UNIQUE_ID}" blender -noaudio --background -P animate_particles.py -- -radius=0.05 -duration=1 -camera=${type} -datafile="${FILE_WITH_DATA}" -n_event=${EVENT_ID} -simulated_t=0.01 -fps=5 -resolution=50 -stamp_note="${EVENT_UNIQUE_ID}"
# Move generated file to final location
mv /tmp/blender/* ${BLENDER_OUTPUT}
echo "${type} for event ${EVENT_ID} done." echo "${type} for event ${EVENT_ID} done."
done done
# Move processed file to final location
mv $FILE_WITH_DATA ${BLENDER_OUTPUT}
popd popd
echo "EVENT ${EVENT_ID} DONE." echo "EVENT ${EVENT_ID} DONE."
done done
popd popd
# Move animation directory to local folder # Move to where this script is executed
mv --verbose /tmp/blender ${BLENDER_OUTPUT} mv ${BLENDER_OUTPUT} ${SCRIPT_CURRENT_DIR}
fi fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment