Refactor the job submission operator, to make it easier to allow executing
the operator (that is, running in the foreground, blocking execution until
submission is done).
No functional changes.
This gives job type authors more control over how settings are presented
in Blender's job submission GUI. If a job setting does not define a
label, its `key` is used to generate one (like Flamenco 3.5 and older).
Note that this isn't used in the web interface yet.
Remove some Python 3.10 features to make the add-on compatible with py39.
This is the Python version that's bundled with Blender 2.93 LTS, for which
I got a request to see if it could be supported.
The Blender version still isn't officially supported, but this should make
things at least not immediately fail.
Avoid these warnings on the console:
```
WARN (bpy.rna): source/blender/python/intern/bpy_rna.cc:1339
pyrna_enum_to_py: current value '0' matches no enum in 'Scene', 'Scene',
'flamenco_job_type'
```
The solution was two-fold:
- Use a non-empty string as the identifier for the 'Select a Job Type'
choice.
- Give the property a default value.
Instead of storing the cached manager info in the Blender preferences,
store the info in a JSON file. The file is located in the user prefs
folder (`~/.config/blender/{version}/config` on Linux).
This also reduces the number of 'refresh' operators to a single one, which
then fetches all necessary info from the Manager.
This fixes an issue (reported via chat) where worker tags were sometimes
not retained across file saves.
This can help to debug issues.
Note that these are logged at `INFO` level, and thus probably won't be
seen with Python's default logging configuration.
Replace calls to `Path.absolute()` and `Path.resolve()` with
`bpathlib.make_absolute(path)`.
The replaced functions can transform drive letters on Windows to UNC
notation. Either all of Flamenco + BAT should be using UNC notation, or
drive letters, but mixing those will cause errors.
Fix an issue where a submission error would keep the BAT status set to
`INVESTIGATING`, which hides the 'Submit to Flamenco' button. In case of
an error, it's now properly set to `ABORTED`, which does show that button.
When refreshing the list of available job types, Blender recreates the
job type property itself, clearing out any previously chosen value. The
add-on tries to restore that previously chosen value, and now also
gracefully handles the case where this job type is no longer available.
In the tooltip of the 'evaluate now' button (the one with the Python
icon), include the description provided by the job type in its
`evalInfo.description` field. This makes it explicit what the button
will do when pressed.
Adjustment of the job settings property names, making them more widely
usable than just the 'use automatic values' button (also known as
'eval-on-submit').
Improve the usability of the 'eval-on-submit' toggle button:
- Add a placeholder text that can be shown instead of the input field. This
can be used to describe what the evaluated Python code will do. In the
case of the 'Simple Blender Render' job, this is set to 'Scene frame
range'.
- Change the way in which the job type has to declare this, both for
clarity and to add the extra placeholder string