Convert Blender-Purge
to a more generic Blender-Crawl
Tool
#42
16
scripts/blender-crawl/run-blender-crawl.sh
Normal file
16
scripts/blender-crawl/run-blender-crawl.sh
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
directory=$1
|
||||||
|
|
||||||
|
echo "Looking for .blend files in follwing directory: '$directory'"
|
||||||
|
for file in $directory/*.blend; do
|
||||||
|
if test -f "$file"; then
|
||||||
|
echo "FOUND FILE!" $(basename ${file})
|
||||||
|
blender $file --background --python test-py-file.py
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "Blener-Crawl is done!"
|
||||||
|
|
||||||
|
|
||||||
|
# Usage!
|
||||||
|
# pass directory containing .blend files like example below:
|
||||||
|
# ./run-blender-crawl.sh /path/to/blends/
|
4
scripts/blender-crawl/test-py-file.py
Normal file
4
scripts/blender-crawl/test-py-file.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import bpy
|
||||||
|
bpy.ops.object.add(type="EMPTY")
|
||||||
|
bpy.ops.wm.save_mainfile()
|
||||||
|
print("Example Py script execution completed!")
|
Loading…
Reference in New Issue
Block a user