Commit 0cac8d3b by bblanimation

Improved stability, bug fixes

parent 1bf6d7ba
......@@ -68,7 +68,7 @@ def register():
bpy.types.Scene.killPython = BoolProperty(
name="Kill Python",
description="Run 'killall -9 python' on host server after render process cancelled",
default=True)
default=False)
bpy.types.Scene.compress = BoolProperty(
name="Compress",
......
......@@ -33,9 +33,9 @@ from ..functions import *
class listMissingFrames(Operator):
"""List the output files missing from the render dump folder""" # blender will use this as a tooltip for menu items and buttons.
bl_idname = "render_farm.list_frames" # unique identifier for buttons and menu items to reference.
bl_idname = "render_farm.list_frames" # unique identifier for buttons and menu items to reference.
bl_label = "List Missing Frames" # display name in the interface.
bl_options = {"REGISTER", "UNDO"} # enable undo for the operator.
bl_options = {"REGISTER"} # enable undo for the operator.
def execute(self, context):
try:
......@@ -54,7 +54,7 @@ class listMissingFrames(Operator):
class setToMissingFrames(Operator):
"""Set frame range to frames missing from the render dump folder""" # blender will use this as a tooltip for menu items and buttons.
bl_idname = "render_farm.set_to_missing_frames" # unique identifier for buttons and menu items to reference.
bl_idname = "render_farm.set_to_missing_frames" # unique identifier for buttons and menu items to reference.
bl_label = "Set to Missing Frames" # display name in the interface.
bl_options = {"REGISTER", "UNDO"} # enable undo for the operator.
......
......@@ -100,6 +100,10 @@ class sendAnimation(Operator):
return{"FINISHED"}
else:
pass
# handle network connection error for checking status
elif i == 1 and self.processes[i].returncode == 12 and self.state[i] == 4:
self.report({"WARNING"}, "Network connection error")
break
# handle python not found on host error
elif self.processes[i].returncode == 127 and self.state[i] == 3:
self.report({"ERROR"}, "python and/or rsync not installed on host server")
......@@ -222,7 +226,9 @@ class sendAnimation(Operator):
except RuntimeError as rte:
self.report({"ERROR"}, str(rte))
return{"CANCELLED"}
rd, rt = setRemoteSettings(scn)
self.processes = [copyProjectFile(self.projectName, scn.compress), False]
setRemoteSettings(scn, rd, rt)
# create timer for modal
wm = context.window_manager
......
......@@ -100,6 +100,12 @@ class sendFrame(Operator):
return{"FINISHED"}
else:
pass
# handle network connection error for checking status
elif i == 1 and self.processes[i].returncode == 12 and self.state[i] == 4:
self.report({"WARNING"}, "Network connection error")
self.processes[1] = False
self.state[1] = -1
break
# handle python not found on host error
elif self.processes[i].returncode == 127 and self.state[i] == 3:
self.report({"ERROR"}, "python and/or rsync not installed on host server")
......@@ -245,7 +251,9 @@ class sendFrame(Operator):
except RuntimeError as rte:
self.report({"ERROR"}, str(rte))
return{"CANCELLED"}
rd, rt = setRemoteSettings(scn)
self.processes = [copyProjectFile(self.projectName, scn.compress), False]
setRemoteSettings(scn, rd, rt)
scn.nameImOutputFiles = getNameOutputFiles()
# create timer for modal
......
......@@ -199,7 +199,7 @@ def intsToFrameRanges(intsList):
""" turns list of ints to list of frame ranges """
frameRangesS = ""
i = 0
while i < len(intsList) - 1:
while i < len(intsList):
s = intsList[i] # start index
e = s # end index
while i < len(intsList) - 1 and intsList[i + 1] - intsList[i] == 1:
......@@ -399,3 +399,12 @@ def updateServerPrefs():
items=groupNames,
default="All Servers")
return {"valid":True, "errorMessage":None}
def setRemoteSettings(scn, rd=None, rt=None):
rd = rd or scn.renderDevice
rt = rt or list(scn.renderTiles)
scn.cycles.device = rd
scn.render.tile_x = rt[0]
scn.render.tile_y = rt[1]
return rd, rt
......@@ -78,11 +78,17 @@ matt
### BEGIN REMOTE SERVERS DICTIONARY ###
{'cse217': [
"cse21701","cse21702","cse21703","cse21704","cse21705","cse21706",
"cse21707","cse21709","cse21710","cse21712",
"cse21713","cse21714","cse21715","cse21716",
"cse21801","cse21802", "cse21803","cse21804","cse21805","cse21806",
"cse21808","cse21809","cse21811","cse21812",
"cse21814"
"cse21707","cse21709","cse21710","cse21712","cse21713","cse21714",
"cse21715","cse21716"
],'cse218': [
"cse21801","cse21802", "cse21803","cse21804","cse21806","cse21808",
"cse21809","cse21811","cse21812","cse21814"
],'cse217+18': [
"cse21701","cse21702","cse21703","cse21704","cse21705","cse21706",
"cse21707","cse21709","cse21710","cse21712","cse21713","cse21714",
"cse21715","cse21716",
"cse21801","cse21802","cse21803","cse21804","cse21806","cse21808",
"cse21809","cse21811","cse21812","cse21814"
],'cse201': [
"cse20101","cse20102","cse20103","cse20104","cse20105","cse20106",
"cse20107","cse20108","cse20109","cse20110","cse20111","cse20112",
......@@ -99,11 +105,6 @@ matt
### NOTES (everything below this line will be ignored) ###
],'cse218': [
1: 4-6.5
2: 6.5-10
......@@ -123,4 +124,4 @@ matt
"cse20113","cse20114","cse20115","cse20116","cse20117","cse20118",
"cse20119","cse20120","cse20121","cse20122","cse20123","cse20124",
"cse21807","cse21810","cse21813","cse21814"
\ No newline at end of file
"cse21807","cse21810","cse21813","cse21814","cse21805"
\ No newline at end of file
......@@ -70,11 +70,10 @@ for scn in bpy.data.scenes:
if scn.cycles.film_transparent:
scn.render.image_settings.color_mode = 'RGBA'
# apply performance settings
# scn.cycles.device = scn.renderDevice
# scn.render.tile_x = scn.renderTiles[0]
# scn.render.tile_y = scn.renderTiles[1]
# typ = scn.cyclesComputeDevice
# typ = "NONE"
# cyclesPrefs = bpy.context.user_preferences.addons['cycles'].preferences
# devices = [x[0] for x in cyclesPrefs.get_device_types(bpy.context)]
# if typ >= "DEFAULT":
# if typ != "DEFAULT":
# cyclesPrefs.compute_device_type = typ if typ in devices else "NONE"
#
# cyclesPrefs.
......@@ -255,27 +255,32 @@ if __name__ == "__main__":
# def start_tasks( hostname, jobString, remoteResultsPath, localResultsPath, JobHostObject=None, firstTime=True, frame=False, progress=False, verbose=0):
testDict1 = {
'projectName':'test',
'projectSyncPath':'/tmp/nwhite/test/toRemote/',
'username':'nwhite',
'projectSyncPath':'/tmp/renderFarm-cgearhar/test/toRemote/',
'username':'cgearhar',
'verbose':0,
'projectPath':'/tmp/nwhite/test',
'remoteResultsPath':'/tmp/nwhite/test/results',
'localResultsPath':'/tmp/nwhite/test/results'
'projectPath':'/tmp/renderFarm-cgearhar/test',
'remoteResultsPath':'/tmp/renderFarm-cgearhar/test/results',
'localResultsPath':'/tmp/renderFarm-cgearhar/test/results'
}
jobsList = [ "blender -b /tmp/nwhite/test/test.blend -x 1 -o //results/test_####.png -s 1 -e 1 -P /tmp/nwhite/test/blender_p.py -a > /tmp/nwhite/test/1.out.log",
"blender -b /tmp/nwhite/test/test.blend -x 1 -o //results/test_####.png -s 2 -e 2 -P /tmp/nwhite/test/blender_p.py -a > /tmp/nwhite/test/2.out.log"]
h1 = JobHost(hostname="cse21701", thread_func=start_tasks, kwargs=testDict1, verbose=verbose, callback=callback_func, jobs_list=jobsList,max_on_host=4)
h1.add_job("blender -b /tmp/nwhite/test/test.blend -x 1 -o //results/test_####.tga -s 3 -e 3 -P /tmp/nwhite/test/blender_p.py -a > /tmp/nwhite/test/3.out.log")
h1.add_job("blender -b /tmp/nwhite/test/test.blend -x 1 -o //results/test_####.tga -s 4 -e 4 -P /tmp/nwhite/test/blender_p.py -a > /tmp/nwhite/test/4.out.log")
h1.add_job("blender -b /tmp/nwhite/test/test.blend -x 1 -o //results/test_####.png -s 5 -e 5 -P /tmp/nwhite/test/blender_p.py -a > /tmp/nwhite/test/5.out.log")
h1.add_job("blender -b /tmp/nwhite/test/test.blend -x 1 -o //results/test_####.png -s 6 -e 6 -P /tmp/nwhite/test/blender_p.py -a > /tmp/nwhite/test/6.out.log")
h1.add_job("blender -b /tmp/nwhite/test/test.blend -x 1 -o //results/test_####.png -s 7 -e 7 -P /tmp/nwhite/test/blender_p.py -a > /tmp/nwhite/test/7.out.log")
h1.add_job("blender -b /tmp/nwhite/test/test.blend -x 1 -o //results/test_####.png -s 8 -e 8 -P /tmp/nwhite/test/blender_p.py -a > /tmp/nwhite/test/8.out.log")
projectPath = "/tmp/renderFarm-cgearhar/test"
testFilePath = os.path.joins(projectPath, "test.blend")
jobsList = [ "blender -b %(testFilePath)s -x 1 -o //results/test_####.png -s 1 -e 1 -P %(projectPath)s/blender_p.py -a > %(projectPath)s/1.out.log" % locals(),
"blender -b %(testFilePath)s -x 1 -o //results/test_####.png -s 2 -e 2 -P %(projectPath)s/blender_p.py -a > %(projectPath)s/2.out.log" % locals()]
h1 = JobHost(hostname="cse21701", thread_func=start_tasks, kwargs=testDict1, verbose=verbose, callback=callback_func, jobs_list=jobsList, max_on_host=2)
h1.add_job("blender -b %(testFilePath)s -x 1 -o //results/test_####.tga -s 3 -e 3 -P %(projectPath)s/blender_p.py -a > %(projectPath)s/3.out.log" % locals())
h1.add_job("blender -b %(testFilePath)s -x 1 -o //results/test_####.tga -s 4 -e 4 -P %(projectPath)s/blender_p.py -a > %(projectPath)s/4.out.log" % locals())
h1.add_job("blender -b %(testFilePath)s -x 1 -o //results/test_####.png -s 5 -e 5 -P %(projectPath)s/blender_p.py -a > %(projectPath)s/5.out.log" % locals())
h1.add_job("blender -b %(testFilePath)s -x 1 -o //results/test_####.png -s 6 -e 6 -P %(projectPath)s/blender_p.py -a > %(projectPath)s/6.out.log" % locals())
h1.add_job("blender -b %(testFilePath)s -x 1 -o //results/test_####.png -s 7 -e 7 -P %(projectPath)s/blender_p.py -a > %(projectPath)s/7.out.log" % locals())
h1.add_job("blender -b %(testFilePath)s -x 1 -o //results/test_####.png -s 8 -e 8 -P %(projectPath)s/blender_p.py -a > %(projectPath)s/8.out.log" % locals())
h1.print_job_list()
h1.start()
try:
while not( h1.terminate() ):
print "some jobs remaining"
print("some jobs remaining")
time.sleep(2)
except KeyboardInterrupt:
print "terminating jobs"
......
......@@ -160,14 +160,14 @@ class serversPanel(Panel):
# col = box.row(align=True)
# col.prop(scn, "tempLocalDir")
# layout.separator()
#
# col = box.column(align=True)
# row = col.row()
# col = row.column(align=True)
# col.label(text="Device:")
# col.prop(scn, "renderDevice", text="")
layout.separator()
col = box.column(align=True)
row = col.row()
col = row.column(align=True)
col.label(text="Device:")
col.prop(scn, "renderDevice", text="")
# col.prop(scn, "cyclesComputeDevice", text="")
# col = row.column(align=True)
# col.label(text="Tiles:")
# col.prop(scn, "renderTiles", text="")
col = row.column(align=True)
col.label(text="Tiles:")
col.prop(scn, "renderTiles", text="")
......@@ -37,8 +37,9 @@ bpy.app.handlers.load_post.append(refresh_servers)
@persistent
def verify_render_status_on_load(scene):
scn = bpy.context.scene
scn.imageRenderStatus = "None" if scn.imageRenderStatus in ["Preparing files...", "Rendering...", "Finishing...", "ERROR"] else scn.imageRenderStatus
scn.animRenderStatus = "None" if scn.animRenderStatus in ["Preparing files...", "Rendering...", "Finishing...", "ERROR"] else scn.animRenderStatus
replaceStatuses = ["Preparing files...", "Rendering...", "Finishing...", "ERROR", "Cancelled"]
scn.imageRenderStatus = "None" if scn.imageRenderStatus in replaceStatuses else scn.imageRenderStatus
scn.animRenderStatus = "None" if scn.animRenderStatus in replaceStatuses else scn.animRenderStatus
bpy.app.handlers.load_post.append(verify_render_status_on_load)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment