[#25693] Netrender "shadow" images with last frame always appear
More debugging info with -d Also fix some conditions that didn't check the proper list in the ui.
This commit is contained in:
parent
2ed0ddef04
commit
dd924bb93b
@ -401,7 +401,7 @@ class netclientdownload(bpy.types.Operator):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
netsettings = context.scene.network_render
|
||||
return netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0
|
||||
return netsettings.active_job_index >= 0 and len(netsettings.jobs) > netsettings.active_job_index
|
||||
|
||||
def execute(self, context):
|
||||
netsettings = context.scene.network_render
|
||||
|
@ -276,7 +276,7 @@ class RENDER_PT_network_slaves(NeedValidAddress, NetRenderButtonsPanel, bpy.type
|
||||
sub.operator("render.netclientslaves", icon='FILE_REFRESH', text="")
|
||||
sub.operator("render.netclientblacklistslave", icon='ZOOMOUT', text="")
|
||||
|
||||
if netsettings.active_slave_index >= 0 and len(netsettings.slaves) > 0:
|
||||
if len(netrender.slaves) > netsettings.active_slave_index >= 0:
|
||||
layout.separator()
|
||||
|
||||
slave = netrender.slaves[netsettings.active_slave_index]
|
||||
@ -307,7 +307,7 @@ class RENDER_PT_network_slaves_blacklist(NeedValidAddress, NetRenderButtonsPanel
|
||||
sub = row.column(align=True)
|
||||
sub.operator("render.netclientwhitelistslave", icon='ZOOMOUT', text="")
|
||||
|
||||
if netsettings.active_blacklisted_slave_index >= 0 and len(netsettings.slaves_blacklist) > 0:
|
||||
if len(netrender.blacklist) > netsettings.active_blacklisted_slave_index >= 0:
|
||||
layout.separator()
|
||||
|
||||
slave = netrender.blacklist[netsettings.active_blacklisted_slave_index]
|
||||
@ -341,7 +341,7 @@ class RENDER_PT_network_jobs(NeedValidAddress, NetRenderButtonsPanel, bpy.types.
|
||||
sub.operator("render.netclientcancelall", icon='PANEL_CLOSE', text="")
|
||||
sub.operator("render.netclientdownload", icon='RENDER_ANIMATION', text="")
|
||||
|
||||
if netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0:
|
||||
if len(netrender.jobs) > netsettings.active_job_index >= 0:
|
||||
layout.separator()
|
||||
|
||||
job = netrender.jobs[netsettings.active_job_index]
|
||||
|
@ -28,7 +28,7 @@ try:
|
||||
except:
|
||||
bpy = None
|
||||
|
||||
VERSION = bytes("1.2", encoding='utf8')
|
||||
VERSION = bytes("1.3", encoding='utf8')
|
||||
|
||||
# Jobs status
|
||||
JOB_WAITING = 0 # before all data has been entered
|
||||
@ -227,6 +227,10 @@ def prefixPath(prefix_directory, file_path, prefix_path, force = False):
|
||||
return full_path
|
||||
|
||||
def getResults(server_address, server_port, job_id, resolution_x, resolution_y, resolution_percentage, frame_ranges):
|
||||
if bpy.app.debug:
|
||||
print("=============================================")
|
||||
print("============= FETCHING RESULTS ==============")
|
||||
|
||||
frame_arguments = []
|
||||
for r in frame_ranges:
|
||||
if len(r) == 2:
|
||||
@ -236,14 +240,28 @@ def getResults(server_address, server_port, job_id, resolution_x, resolution_y,
|
||||
|
||||
filepath = os.path.join(bpy.app.tempdir, "netrender_temp.blend")
|
||||
bpy.ops.wm.save_as_mainfile(filepath=filepath, copy=True, check_existing=False)
|
||||
|
||||
process = subprocess.Popen([sys.argv[0], "-b", "-noaudio", filepath, "-P", __file__] + frame_arguments + ["--", "GetResults", server_address, str(server_port), job_id, str(resolution_x), str(resolution_y), str(resolution_percentage)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
|
||||
arguments = [sys.argv[0], "-b", "-noaudio", filepath, "-o", bpy.path.abspath(bpy.context.scene.render.filepath), "-P", __file__] + frame_arguments + ["--", "GetResults", server_address, str(server_port), job_id, str(resolution_x), str(resolution_y), str(resolution_percentage)]
|
||||
if bpy.app.debug:
|
||||
print("Starting subprocess:")
|
||||
print(" ".join(arguments))
|
||||
|
||||
process = subprocess.Popen(arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
while process.poll() is None:
|
||||
process.stdout.read(1024) # empty buffer to be sure
|
||||
process.stdout.read()
|
||||
stdout = process.stdout.read(1024)
|
||||
if bpy.app.debug:
|
||||
print(str(stdout, encoding='utf-8'), end="")
|
||||
|
||||
|
||||
# read leftovers if needed
|
||||
stdout = process.stdout.read()
|
||||
if bpy.app.debug:
|
||||
print(str(stdout, encoding='utf-8'))
|
||||
|
||||
os.remove(filepath)
|
||||
|
||||
if bpy.app.debug:
|
||||
print("=============================================")
|
||||
return
|
||||
|
||||
def _getResults(server_address, server_port, job_id, resolution_x, resolution_y, resolution_percentage):
|
||||
|
Loading…
Reference in New Issue
Block a user