Convert Blender-Purge to a more generic Blender-Crawl Tool #42

Merged
Nick Alberelli merged 34 commits from feature/blender-crawl into main 2023-05-17 15:38:47 +02:00
Showing only changes of commit 032da6d248 - Show all commits

View File

@ -59,7 +59,7 @@ parser.add_argument(
parser.add_argument( parser.add_argument(
"-f", "-f",
"--filter", "--filter",
help="Provide a string to filter the found .blend files", help="Provide a string to filter the found .blend files",
) )
parser.add_argument( parser.add_argument(
@ -144,7 +144,7 @@ def main() -> int:
import sys import sys
"""Crawl blender files in a directory and run a provided scripts""" """Crawl blender files in a directory and run a provided scripts"""
# Parse arguments. # Parse arguments.
args = parser.parse_args() args = parser.parse_args()
purge_path = get_purge_path(args.purge) purge_path = get_purge_path(args.purge)
recursive = args.recursive recursive = args.recursive
exec = args.exec exec = args.exec
@ -158,13 +158,13 @@ def main() -> int:
script_name = check_file_exists( script_name = check_file_exists(
script, script,
"No --script was not provided as argument, printed found .blend files, exiting program.", "No --script was not provided as argument, printed found .blend files, exiting program.",
) )
scripts.append(script_name) scripts.append(script_name)
# Purge is optional so it can be none # Purge is optional so it can be none
if purge_path is not None: if purge_path is not None:
scripts.append(purge_path) scripts.append(purge_path)
if not exec: if not exec:
blender_exec = find_executable() blender_exec = find_executable()
else: else: