make blender generated files unique - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 09167e862353922a1edd2105869321f54440cf44 | |
parent 08fa8d72688f79cb4d148c3c2511094becf15c93 | |
Author: Josuah Demangeon <[email protected]> | |
Date: Mon, 21 Nov 2022 21:18:05 +0100 | |
make blender generated files unique | |
The previous version was always writing to the same file, generating | |
the same link every time. | |
This commit introduces mktemp to create a new file every time. | |
Signed-off-by: Annna Robert-Houdin <[email protected]> | |
Diffstat: | |
M blender-effect | 5 +++-- | |
1 file changed, 3 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/blender-effect b/blender-effect | |
@@ -14,6 +14,7 @@ shift 2 | |
BLENDER=blender-3.2 | |
BLEND_DIR="$(dirname "$0")/modules/blender" | |
IMAGE_DIR=/br/gopher/memecache/3d | |
+IMAGE_NAME="$(mktemp "$NAME.XXXXXXXX")" | |
# turn "key1=value key2=value key3=value" into variables used by blender-effec… | |
for x in "$@" | |
@@ -25,7 +26,7 @@ ${BLENDER} --background \ | |
"${BLEND_DIR}/${NAME}.blend" \ | |
-E CYCLES \ | |
--python "${BLEND_DIR}/effect.py" \ | |
- --render-output "${IMAGE_DIR}/${NAME}." \ | |
+ --render-output "${IMAGE_DIR}/${IMAGE_NAME}." \ | |
--render-frame 1 \ | |
>&2 \ | |
-&& echo "${NAME}.0001.png" | |
+&& echo "${IMAGE_NAME}.0001.png" |