Skip to content

Commit 13ec798

Browse files
authored
Merge pull request #3421 from OpenShot/blender-redux
Blender: Use self.process consistently, fix project file discovery for Picture Frame
2 parents 7465dcb + de0ee93 commit 13ec798

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

src/blender/picture_frames_4.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@
1111
<default>TitleFileName</default>
1212
</param>
1313

14-
<param name="project_files1" type="dropdown" title="Picture 1 Path" description="">
14+
<param name="project_files1" type="dropdown" title="Picture 1" description="">
1515
<values>
1616
<value name="" num=""/>
1717
</values>
1818
<default></default>
1919
</param>
2020

21-
<param name="project_files2" type="dropdown" title="Picture 2 Path" description="">
21+
<param name="project_files2" type="dropdown" title="Picture 2" description="">
2222
<values>
2323
<value name="" num=""/>
2424
</values>
2525
<default></default>
2626
</param>
2727

28-
<param name="project_files3" type="dropdown" title="Picture 3 Path" description="">
28+
<param name="project_files3" type="dropdown" title="Picture 3" description="">
2929
<values>
3030
<value name="" num=""/>
3131
</values>
3232
<default></default>
3333
</param>
3434

35-
<param name="project_files4" type="dropdown" title="Picture 4 Path" description="">
35+
<param name="project_files4" type="dropdown" title="Picture 4" description="">
3636
<values>
3737
<value name="" num=""/>
3838
</values>

src/windows/views/blender_listview.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,12 @@ def currentChanged(self, selected, deselected):
148148
continue
149149

150150
param["values"][fileName] = "|".join(
151-
file.data["path"], str(file.data["height"]),
152-
str(file.data["width"]), file.data["media_type"],
153-
str(file.data["fps"]["num"] / file.data["fps"]["den"])
151+
(file.data["path"],
152+
str(file.data["height"]),
153+
str(file.data["width"]),
154+
file.data["media_type"],
155+
str(file.data["fps"]["num"] / file.data["fps"]["den"])
156+
)
154157
)
155158

156159
# Add normal values
@@ -705,7 +708,7 @@ def Render(self, blend_file_path, target_script, preview_mode=False):
705708
log.info("Checking Blender version, command: {}".format(
706709
" ".join([shlex.quote(x) for x in command_get_version])))
707710

708-
proc = subprocess.Popen(
711+
self.process = subprocess.Popen(
709712
command_get_version,
710713
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
711714
startupinfo=startupinfo,
@@ -714,7 +717,7 @@ def Render(self, blend_file_path, target_script, preview_mode=False):
714717
# Check the version of Blender
715718
try:
716719
# Give Blender up to 10 seconds to respond
717-
(out, err) = proc.communicate(timeout=10)
720+
(out, err) = self.process.communicate(timeout=10)
718721
except subprocess.TimeoutExpired:
719722
self.blender_error_nodata.emit()
720723
return
@@ -739,12 +742,11 @@ def Render(self, blend_file_path, target_script, preview_mode=False):
739742
log.info("Blender output:")
740743

741744
# Run real command to render Blender project
742-
proc = subprocess.Popen(
745+
self.process = subprocess.Popen(
743746
command_render, bufsize=512,
744747
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
745748
startupinfo=startupinfo,
746749
)
747-
self.process = proc
748750
self.is_running = True
749751

750752
except subprocess.SubprocessError:
@@ -757,8 +759,8 @@ def Render(self, blend_file_path, target_script, preview_mode=False):
757759
log.error("{}".format(ex))
758760
return
759761

760-
while self.is_running and proc.poll() is None:
761-
for outline in iter(proc.stdout.readline, b''):
762+
while self.is_running and self.process.poll() is None:
763+
for outline in iter(self.process.stdout.readline, b''):
762764
line = outline.decode('utf-8').strip()
763765

764766
# Skip blank output

0 commit comments

Comments
 (0)