Network Render:

* Some code cleanups to match layout file code guidelines.
* Ported Operator Labels to op file itself.
* Added some Tooltips, theeth: Feel free to change/improve them as you like. :)
This commit is contained in:
Thomas Dinges 2009-10-15 17:18:47 +00:00
parent c102cedbf5
commit bd0fee9a4c
2 changed files with 37 additions and 52 deletions

@ -9,11 +9,9 @@ import netrender.model
@rnaOperator @rnaOperator
class RENDER_OT_netclientanim(bpy.types.Operator): class RENDER_OT_netclientanim(bpy.types.Operator):
''' '''Start rendering an animation on network'''
Operator documentation text, will be used for the operator tooltip and python docs.
'''
__idname__ = "render.netclientanim" __idname__ = "render.netclientanim"
__label__ = "Net Render Client Anim" __label__ = "Animation on network"
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.
@ -42,11 +40,9 @@ class RENDER_OT_netclientanim(bpy.types.Operator):
@rnaOperator @rnaOperator
class RENDER_OT_netclientsend(bpy.types.Operator): class RENDER_OT_netclientsend(bpy.types.Operator):
''' '''Send Render Job to the Network'''
Operator documentation text, will be used for the operator tooltip and python docs.
'''
__idname__ = "render.netclientsend" __idname__ = "render.netclientsend"
__label__ = "Net Render Client Send" __label__ = "Send job"
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.
@ -73,9 +69,9 @@ class RENDER_OT_netclientsend(bpy.types.Operator):
@rnaOperator @rnaOperator
class RENDER_OT_netclientstatus(bpy.types.Operator): class RENDER_OT_netclientstatus(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.''' '''Refresh the status of the current jobs'''
__idname__ = "render.netclientstatus" __idname__ = "render.netclientstatus"
__label__ = "Net Render Client Status" __label__ = "Client Status"
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.
@ -120,7 +116,7 @@ class RENDER_OT_netclientstatus(bpy.types.Operator):
class RENDER_OT_netclientblacklistslave(bpy.types.Operator): class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.''' '''Operator documentation text, will be used for the operator tooltip and python docs.'''
__idname__ = "render.netclientblacklistslave" __idname__ = "render.netclientblacklistslave"
__label__ = "Net Render Client Blacklist Slave" __label__ = "Client Blacklist Slave"
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.
@ -155,7 +151,7 @@ class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
class RENDER_OT_netclientwhitelistslave(bpy.types.Operator): class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.''' '''Operator documentation text, will be used for the operator tooltip and python docs.'''
__idname__ = "render.netclientwhitelistslave" __idname__ = "render.netclientwhitelistslave"
__label__ = "Net Render Client Whitelist Slave" __label__ = "Client Whitelist Slave"
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.
@ -189,9 +185,9 @@ class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
@rnaOperator @rnaOperator
class RENDER_OT_netclientslaves(bpy.types.Operator): class RENDER_OT_netclientslaves(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.''' '''Refresh status about available Render slaves'''
__idname__ = "render.netclientslaves" __idname__ = "render.netclientslaves"
__label__ = "Net Render Client Slaves" __label__ = "Client Slaves"
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.
@ -239,9 +235,9 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
@rnaOperator @rnaOperator
class RENDER_OT_netclientcancel(bpy.types.Operator): class RENDER_OT_netclientcancel(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.''' '''Cancel the selected network rendering job.'''
__idname__ = "render.netclientcancel" __idname__ = "render.netclientcancel"
__label__ = "Net Render Client Cancel" __label__ = "Client Cancel"
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.
@ -273,9 +269,9 @@ class RENDER_OT_netclientcancel(bpy.types.Operator):
@rnaOperator @rnaOperator
class RENDER_OT_netclientcancelall(bpy.types.Operator): class RENDER_OT_netclientcancelall(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.''' '''Cancel all running network rendering jobs.'''
__idname__ = "render.netclientcancelall" __idname__ = "render.netclientcancelall"
__label__ = "Net Render Client Cancel All" __label__ = "Client Cancel All"
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.
@ -305,9 +301,9 @@ class RENDER_OT_netclientcancelall(bpy.types.Operator):
@rnaOperator @rnaOperator
class netclientdownload(bpy.types.Operator): class netclientdownload(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.''' '''Download render results from the network'''
__idname__ = "render.netclientdownload" __idname__ = "render.netclientdownload"
__label__ = "Net Render Client Download" __label__ = "Client Download"
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.
@ -357,7 +353,7 @@ class netclientdownload(bpy.types.Operator):
class netclientscan(bpy.types.Operator): class netclientscan(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.''' '''Operator documentation text, will be used for the operator tooltip and python docs.'''
__idname__ = "render.netclientscan" __idname__ = "render.netclientscan"
__label__ = "Net Render Client Scan" __label__ = "Client Scan"
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.
@ -393,9 +389,9 @@ class netclientscan(bpy.types.Operator):
@rnaOperator @rnaOperator
class netclientweb(bpy.types.Operator): class netclientweb(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.''' '''Open new window with information about running rendering jobs'''
__idname__ = "render.netclientweb" __idname__ = "render.netclientweb"
__label__ = "Net Render Client Web" __label__ = "Open Master Monitor"
# List of operator properties, the attributes will be assigned # List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling. # to the class instance from the operator settings before calling.

@ -33,10 +33,6 @@ class RENDER_PT_network_settings(RenderButtonsPanel):
__label__ = "Network Settings" __label__ = "Network Settings"
COMPAT_ENGINES = set(['NET_RENDER']) COMPAT_ENGINES = set(['NET_RENDER'])
def draw_header(self, context):
layout = self.layout
scene = context.scene
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@ -48,7 +44,6 @@ class RENDER_PT_network_settings(RenderButtonsPanel):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(scene.network_render, "mode") col.itemR(scene.network_render, "mode")
col.itemR(scene.network_render, "path") col.itemR(scene.network_render, "path")
col.itemR(scene.network_render, "server_address") col.itemR(scene.network_render, "server_address")
@ -79,13 +74,13 @@ class RENDER_PT_network_job(RenderButtonsPanel):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemO("render.netclientanim", icon='ICON_RENDER_ANIMATION')
col.itemO("render.netclientanim", icon='ICON_RENDER_ANIMATION', text="Animation on network") col.itemO("render.netclientsend", icon="ICON_FILE_BLEND")
col.itemO("render.netclientsend", icon="ICON_FILE_BLEND", text="Send job") col.itemO("render.netclientweb", icon="ICON_QUESTION")
col.itemO("render.netclientweb", icon="ICON_QUESTION", text="Open Master Monitor")
col.itemR(scene.network_render, "job_name") col.itemR(scene.network_render, "job_name")
col.itemR(scene.network_render, "priority") row = col.row()
col.itemR(scene.network_render, "chunks") row.itemR(scene.network_render, "priority")
row.itemR(scene.network_render, "chunks")
@rnaType @rnaType
class RENDER_PT_network_slaves(RenderButtonsPanel): class RENDER_PT_network_slaves(RenderButtonsPanel):
@ -105,11 +100,9 @@ class RENDER_PT_network_slaves(RenderButtonsPanel):
row = layout.row() row = layout.row()
row.template_list(netsettings, "slaves", netsettings, "active_slave_index", rows=2) row.template_list(netsettings, "slaves", netsettings, "active_slave_index", rows=2)
col = row.column() sub = row.column(align=True)
sub.itemO("render.netclientslaves", icon="ICON_FILE_REFRESH", text="")
subcol = col.column(align=True) sub.itemO("render.netclientblacklistslave", icon="ICON_ZOOMOUT", text="")
subcol.itemO("render.netclientslaves", icon="ICON_FILE_REFRESH", text="")
subcol.itemO("render.netclientblacklistslave", icon="ICON_ZOOMOUT", text="")
if len(bpy.data.netrender_slaves) == 0 and len(netsettings.slaves) > 0: if len(bpy.data.netrender_slaves) == 0 and len(netsettings.slaves) > 0:
while(len(netsettings.slaves) > 0): while(len(netsettings.slaves) > 0):
@ -143,10 +136,8 @@ class RENDER_PT_network_slaves_blacklist(RenderButtonsPanel):
row = layout.row() row = layout.row()
row.template_list(netsettings, "slaves_blacklist", netsettings, "active_blacklisted_slave_index", rows=2) row.template_list(netsettings, "slaves_blacklist", netsettings, "active_blacklisted_slave_index", rows=2)
col = row.column() sub = row.column(align=True)
sub.itemO("render.netclientwhitelistslave", icon="ICON_ZOOMOUT", text="")
subcol = col.column(align=True)
subcol.itemO("render.netclientwhitelistslave", icon="ICON_ZOOMOUT", text="")
if len(bpy.data.netrender_blacklist) == 0 and len(netsettings.slaves_blacklist) > 0: if len(bpy.data.netrender_blacklist) == 0 and len(netsettings.slaves_blacklist) > 0:
while(len(netsettings.slaves_blacklist) > 0): while(len(netsettings.slaves_blacklist) > 0):
@ -180,13 +171,11 @@ class RENDER_PT_network_jobs(RenderButtonsPanel):
row = layout.row() row = layout.row()
row.template_list(netsettings, "jobs", netsettings, "active_job_index", rows=2) row.template_list(netsettings, "jobs", netsettings, "active_job_index", rows=2)
col = row.column() sub = row.column(align=True)
sub.itemO("render.netclientstatus", icon="ICON_FILE_REFRESH", text="")
subcol = col.column(align=True) sub.itemO("render.netclientcancel", icon="ICON_ZOOMOUT", text="")
subcol.itemO("render.netclientstatus", icon="ICON_FILE_REFRESH", text="") sub.itemO("render.netclientcancelall", icon="ICON_PANEL_CLOSE", text="")
subcol.itemO("render.netclientcancel", icon="ICON_ZOOMOUT", text="") sub.itemO("render.netclientdownload", icon='ICON_RENDER_ANIMATION', text="")
subcol.itemO("render.netclientcancelall", icon="ICON_PANEL_CLOSE", text="")
subcol.itemO("render.netclientdownload", icon='ICON_RENDER_ANIMATION', text="")
if len(bpy.data.netrender_jobs) == 0 and len(netsettings.jobs) > 0: if len(bpy.data.netrender_jobs) == 0 and len(netsettings.jobs) > 0:
while(len(netsettings.jobs) > 0): while(len(netsettings.jobs) > 0):
@ -303,8 +292,8 @@ NetRenderSettings.EnumProperty(attr="mode",
("RENDER_MASTER", "Master", "Act as render master"), ("RENDER_MASTER", "Master", "Act as render master"),
("RENDER_SLAVE", "Slave", "Act as render slave"), ("RENDER_SLAVE", "Slave", "Act as render slave"),
), ),
name="network mode", name="Network mode",
description="mode of operation of this instance", description="Mode of operation of this instance",
default="RENDER_CLIENT") default="RENDER_CLIENT")
NetRenderSettings.CollectionProperty(attr="slaves", type=NetRenderSlave, name="Slaves", description="") NetRenderSettings.CollectionProperty(attr="slaves", type=NetRenderSlave, name="Slaves", description="")