Manager: allow setup to finish without Blender #104306

Manually merged
Sybren A. Stüvel merged 34 commits from abelli/flamenco:issue100195 into main 2024-09-09 11:22:42 +02:00
Showing only changes of commit 07988f8729 - Show all commits

View File

@ -101,9 +101,7 @@
v-show="currentSetupStep == 3"
@next-clicked="nextStepAfterCheckBlenderExePath"
@back-clicked="prevStep"
:is-next-clickable="
selectedBlender != null || customBlenderExe != '' || skipCustomBlenderExe
"
:is-next-clickable="selectedBlender != null || customBlenderExe != ''"
title="Blender">
abelli marked this conversation as resolved Outdated

That original code already won't work, customBlenderExe != (null || '') is not going to do what it's intended to express. null is a false-y value, and so (null || '') gets shortcut to just '').

That's not something to address in this PR though -- this PR adds a feature, and shouldn't also try and fix existing code. But if you're willing to look into this too, a separate PR that fixes this (which could then be landed before adding this new feature) would be much appreciated.

That original code already won't work, `customBlenderExe != (null || '')` is not going to do what it's intended to express. `null` is a false-y value, and so `(null || '')` gets shortcut to just `''`). That's not something to address in this PR though -- this PR adds a feature, and shouldn't also try and fix existing code. But if you're willing to look into this too, a separate PR that fixes this (which could then be landed before adding this new feature) would be much appreciated.

I have opened #104307 to address this one.

I have opened #104307 to address this one.
<div v-if="isBlenderExeFinding" class="is-in-progress">Looking for Blender installs...</div>
@ -196,15 +194,15 @@
</fieldset>
<fieldset v-if="autoFoundBlenders.length === 0">
<label for="custom_blender-input_path">
<label for="blender-input_path">
<div>
<input
v-model="skipCustomBlenderExe"
value="false"
type="radio"
v-model="selectedBlender"
name="blender"
id="custom_blender-input_path" />
I have a Blender path:
:value="blenderFromInputPath"
id="blender-input_path" />
{{ sourceLabels['input_path'] }}
</div>
<div>
<input
@ -225,15 +223,15 @@
</div>
</label>
<label for="skip_blender-input_path">
<label for="blender-default">
<div>
<input
v-model="skipCustomBlenderExe"
value="true"
type="radio"
v-model="selectedBlender"
name="blender"
id="skip_blender-input_path" />
Skip, let the Workers use whatever Blender is available.
:value="blenderFromDefaultSource"
id="blender-default" />
{{ sourceLabels['default'] }}
</div>
</label>
</fieldset>
@ -263,11 +261,11 @@
>" as found on <code>$PATH</code> (currently "<code>{{ selectedBlender.path }}</code
>")
</dd>
<dd v-if="selectedBlender.source == 'input_path' && !skipCustomBlenderExe">
<dd v-if="selectedBlender.source == 'input_path'">
The command you provided: "<code>{{ selectedBlender.path }}</code
>"
</dd>
<dd v-if="selectedBlender.source == 'input_path' && skipCustomBlenderExe">
<dd v-if="selectedBlender.source == 'default'">
You have choosen to skip adding a blender path.
</dd>
</dl>
@ -316,13 +314,13 @@ export default {
selectedBlender: null, // the chosen api.BlenderPathCheckResult
customBlenderExe: '',
skipCustomBlenderExe: false,
isBlenderExeChecking: false,
blenderExeCheckResult: null, // api.BlenderPathCheckResult
sourceLabels: {
file_association: 'Blender that runs when you double-click a .blend file:',
path_envvar: 'Blender found on the $PATH environment:',
input_path: 'Another Blender executable:',
input_path: 'Specify a Blender executable:',
default: 'Skip, let the Workers use whatever Blender is available.',
},
isConfirming: false,
isConfirmed: false,
@ -355,6 +353,15 @@ export default {
blenderFromInputPath() {
return this.allBlenders.find((b) => b.source === 'input_path');
},
blenderFromDefaultSource() {
return {
input: 'blender',
path: 'blender',
source: 'default',
is_usable: true,
cause: 'blender',
};
},
setupConfirmIsClickable() {
if (this.isConfirming || this.isConfirmed) {
return false;
@ -418,17 +425,6 @@ export default {
},
checkBlenderExePath() {
if (this.skipCustomBlenderExe) {
this.selectedBlender = {
input: 'blender',
path: 'blender',
source: 'input_path',
is_usable: true,
cause: 'blender',
};
return;
}
const exeToTry = this.cleanCustomBlenderExe;
if (exeToTry == '') {
// Just erase any previously-found custom Blender executable.