Worker: check BLENDER_CMD environment variable (for multi-GPU Eevee rendering) #104193
@ -6,6 +6,7 @@ package worker
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"regexp"
|
||||
"sync"
|
||||
@ -88,7 +89,8 @@ func (ce *CommandExecutor) cmdBlenderRenderCommand(
|
||||
// No directory path given. Check that the executable is set in an
|
||||
// environment variable or can be found on the path.
|
||||
if path := find_blender.EnvironmentVariable(); path != "" {
|
||||
logger.Info().Str("path", path).Msg("found Blender in environment")
|
||||
msg := fmt.Sprintf("using blender from %s", find_blender.BlenderPathEnvVariable)
|
||||
logger.Info().Str("path", path).Msg(msg)
|
||||
|
||||
parameters.exe = path
|
||||
} else if _, err := exec.LookPath(parameters.exe); err != nil {
|
||||
// Attempt a platform-specific way to find which Blender executable to
|
||||
|
Loading…
Reference in New Issue
Block a user
I wouldn't say "found Blender" here, because the path wasn't checked. Blender may not even exist there.
Maybe
find_blender.EnvironmentVariable()
can return two strings,(name, path)
wherename
is the name of the environment variable, andpath
is the actual value. That way you can log here "using Blender from {environment variable name}".I did change the log message to "using Blender from FLAMENCO_BLENDER_PATH".
However, since the name of the variable is (now) a constant I think there is no need to return it from
find_blender.EnvironmentVariable()
. Most code would not be interested in it anyway and probably ignore it using a_
variable. So the log message simply uses the constant.I think it's still good to return the variable name. That way you get less coupling between the different parts of the code, making things more maintainable.