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
Member

Closes: studio/blender-studio-pipeline#40

Features

Blender Executable

  • Blender executable get OS default blender
  • Blender executable pass custom executable
  • Blender executable warn if none is found

Directory

  • Directory use current or pass directory
  • Recursively check directory sub-folders
  • Directory warn if no .blend files were found
  • Use Regex to only edit some files

Scripts to Execute

  • Provide DEFAULT Scripts like purge
  • Provide Option for "Dry Run"

Documentation and Support

  • Update README.md file
  • Create new install script
Closes: https://projects.blender.org/studio/blender-studio-pipeline/issues/40 # Features ### Blender Executable - [x] Blender executable get OS default blender - [x] Blender executable pass custom executable - [x] Blender executable warn if none is found ### Directory - [x] Directory use current or pass directory - [x] Recursively check directory sub-folders - [x] Directory warn if no .blend files were found - [x] Use Regex to only edit some files ### Scripts to Execute - [x] Provide DEFAULT Scripts like purge - ~~Provide Option for "Dry Run"~~ ### Documentation and Support - [x] Update README.md file - [x] Create new install script
Nick Alberelli changed title from Create Basic `Blender-Crawl` script to Create `Blender-Crawl` Script for running scripts on mulitple .blend files 2023-05-10 00:34:47 +02:00
Nick Alberelli changed title from Create `Blender-Crawl` Script for running scripts on mulitple .blend files to Create `Blender-Crawl` Script for running scripts on many files 2023-05-10 00:34:58 +02:00
Nick Alberelli changed title from Create `Blender-Crawl` Script for running scripts on many files to Draft: Create `Blender-Crawl` Script for running scripts on many files 2023-05-10 03:47:39 +02:00
Nick Alberelli changed title from Draft: Create `Blender-Crawl` Script for running scripts on many files to WIP: Create `Blender-Crawl` Script for running scripts on many files 2023-05-10 03:47:55 +02:00
Nick Alberelli force-pushed feature/blender-crawl from b4f85c86dd to 04c41fe9df 2023-05-10 17:03:28 +02:00 Compare
Nick Alberelli force-pushed feature/blender-crawl from 04c41fe9df to 451fe0c864 2023-05-10 20:26:01 +02:00 Compare
Sebastian Parborg requested changes 2023-05-11 12:21:05 +02:00
@ -0,0 +84,4 @@
return func_wrapper
def cancel_program() -> None:

I don't think there is much of a reason to have this function?

When I look at the code, it seems like all calls to this could be replaced with sys.exit(0) without any loss.

I don't think there is much of a reason to have this function? When I look at the code, it seems like all calls to this could be replaced with `sys.exit(0)` without any loss.
Author
Member

We handled this together on the phone! Issue has been resolved. 81083cdb01

We handled this together on the phone! Issue has been resolved. https://projects.blender.org/studio/blender-studio-pipeline/commit/81083cdb01fa4d61229f28b38df5f6fbc6096288
@ -0,0 +201,4 @@
return path
def setup_config(skip_finding_exec) -> None:

I don't think this program should have any config file at all.

Unless the command line tool is very complex (which this one is not), then the user should always have a fresh start each time the command line tool is run.

I'll elaborate further in an other comment.

I don't think this program should have any config file at all. Unless the command line tool is very complex (which this one is not), then the user should always have a fresh start each time the command line tool is run. I'll elaborate further in an other comment.
Author
Member

We handled this together 9e9c60fda3 issue resolved!

We handled this together https://projects.blender.org/studio/blender-studio-pipeline/commit/9e9c60fda3035acebb0991bad4c24b9643b29b36 issue resolved!
@ -0,0 +254,4 @@
# Check config file.
if not config_path.exists() or skip_finding_exec:
print("# Seems like you are starting blender-crawl for the first time!")

While there is a option to skip looking for the blender binary, this is very bad design for a command line tool.

Why? Because this makes it very tedious to script this or run it on multiple computers.
And most importantly, it will stop execution and ask for user input.
For batch scripts this makes it very unreliable because not only does it not do what you wanted to (crawl for blender files), it also stops execution until it has gotten input.

This means that if someone has set this up to run in a bigger script, the script will halt and never finish or give any errors indicating that it didn't execute.

While there is a option to skip looking for the blender binary, this is very bad design for a command line tool. Why? Because this makes it very tedious to script this or run it on multiple computers. And most importantly, it will stop execution and ask for user input. For batch scripts this makes it very unreliable because not only does it not do what you wanted to (crawl for blender files), it also stops execution until it has gotten input. This means that if someone has set this up to run in a bigger script, the script will halt and never finish or give any errors indicating that it didn't execute.
Author
Member

We handled this problem in these commits 9e9c60fda3 76aad47252

We handled this problem in these commits https://projects.blender.org/studio/blender-studio-pipeline/commit/9e9c60fda3035acebb0991bad4c24b9643b29b36 https://projects.blender.org/studio/blender-studio-pipeline/commit/76aad472521d902b831c6e35165c452aa3010355
Nick Alberelli requested review from Sebastian Parborg 2023-05-11 22:24:47 +02:00
Nick Alberelli force-pushed feature/blender-crawl from 489d90b664 to 0b7f9b1b1b 2023-05-11 22:25:06 +02:00 Compare
Nick Alberelli changed title from WIP: Create `Blender-Crawl` Script for running scripts on many files to Create `Blender-Crawl` Script for running scripts on many files 2023-05-12 16:40:49 +02:00
Nick Alberelli changed title from Create `Blender-Crawl` Script for running scripts on many files to Convert `Blender-Purge` to a more generic `Blender-Crawl` Tool 2023-05-12 18:43:53 +02:00
Sebastian Parborg approved these changes 2023-05-15 12:27:52 +02:00
Sebastian Parborg left a comment
Member

This should be ready to go now

This should be ready to go now
Nick Alberelli force-pushed feature/blender-crawl from dba07a1efa to 0087b69e5d 2023-05-15 17:24:12 +02:00 Compare
Nick Alberelli force-pushed feature/blender-crawl from 0087b69e5d to 4ec47269d3 2023-05-15 17:37:05 +02:00 Compare
Nick Alberelli force-pushed feature/blender-crawl from 4ec47269d3 to d6a332265d 2023-05-17 15:38:28 +02:00 Compare
Nick Alberelli merged commit f8fcfe0ab5 into main 2023-05-17 15:38:47 +02:00
Nick Alberelli deleted branch feature/blender-crawl 2023-05-17 15:38:48 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: studio/blender-studio-tools#42
No description provided.