Skip to content
Snippets Groups Projects
Commit 3ef9175c authored by Sybren A. Stüvel's avatar Sybren A. Stüvel
Browse files

Windows compatibility fixes

parent 0e94bb02
No related branches found
No related tags found
No related merge requests found
......@@ -920,6 +920,10 @@ class MergeProgressiveRendersCommand(AbstractSubprocessCommand):
if '"' in output:
return 'Double quotes are not allowed in filenames: %r' % output
settings['input1'] = Path(input1).as_posix()
settings['input2'] = Path(input2).as_posix()
settings['output'] = Path(output).as_posix()
_, err = self._setting(settings, 'weight1', True, int)
if err: return err
......@@ -937,7 +941,7 @@ class MergeProgressiveRendersCommand(AbstractSubprocessCommand):
'--enable-autoexec',
'-noaudio',
'--background',
str(blendpath),
blendpath.as_posix(),
]
# set up node properties and render settings.
......@@ -948,7 +952,7 @@ class MergeProgressiveRendersCommand(AbstractSubprocessCommand):
tmppath = Path(tmpdir)
assert tmppath.exists()
settings['tmpdir'] = tmpdir
settings['tmpdir'] = tmppath.as_posix()
cmd += [
'--python-expr', MERGE_EXR_PYTHON % settings
]
......@@ -968,6 +972,7 @@ class MergeProgressiveRendersCommand(AbstractSubprocessCommand):
self._log.info('Moving %s to %s', src, dst)
assert src.exists()
assert src.is_file()
assert not dst.exists() or dst.is_file()
assert dst.exists() or dst.parent.exists()
......
import logging
import os
import pathlib
import platform
import shutil
import unittest
class AbstractWorkerTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
import logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)-15s %(levelname)8s %(name)s %(message)s',
)
def find_blender_cmd(self):
import os
import platform
def find_blender_cmd(self) -> str:
if platform.system() == 'Windows':
blender = 'blender.exe'
else:
blender = 'blender'
for path in os.getenv('PATH').split(os.path.pathsep):
full_path = path + os.sep + blender
if os.path.exists(full_path):
return full_path
found = shutil.which(blender)
if found is None:
self.fail(f'Unable to find {blender!r} executable on $PATH')
self.fail('Unable to find "blender" executable on $PATH')
return pathlib.Path(found).as_posix()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment