netrender: show web interface button in all modes. use rna decorator all the time (no need for special operator decorator)

This commit is contained in:
Martin Poirier 2009-12-28 22:49:22 +00:00
parent d64834a6ce
commit 54d64c4763
3 changed files with 19 additions and 19 deletions

@ -26,7 +26,7 @@ from netrender.utils import *
import netrender.client as client import netrender.client as client
import netrender.model import netrender.model
@rnaOperator @rnaType
class RENDER_OT_netslave_bake(bpy.types.Operator): class RENDER_OT_netslave_bake(bpy.types.Operator):
'''NEED DESCRIPTION''' '''NEED DESCRIPTION'''
bl_idname = "render.netslavebake" bl_idname = "render.netslavebake"
@ -84,7 +84,7 @@ class RENDER_OT_netslave_bake(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
return self.execute(context) return self.execute(context)
@rnaOperator @rnaType
class RENDER_OT_netclientanim(bpy.types.Operator): class RENDER_OT_netclientanim(bpy.types.Operator):
'''Start rendering an animation on network''' '''Start rendering an animation on network'''
bl_idname = "render.netclientanim" bl_idname = "render.netclientanim"
@ -111,7 +111,7 @@ class RENDER_OT_netclientanim(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
return self.execute(context) return self.execute(context)
@rnaOperator @rnaType
class RENDER_OT_netclientsend(bpy.types.Operator): class RENDER_OT_netclientsend(bpy.types.Operator):
'''Send Render Job to the Network''' '''Send Render Job to the Network'''
bl_idname = "render.netclientsend" bl_idname = "render.netclientsend"
@ -141,7 +141,7 @@ class RENDER_OT_netclientsend(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
return self.execute(context) return self.execute(context)
@rnaOperator @rnaType
class RENDER_OT_netclientstatus(bpy.types.Operator): class RENDER_OT_netclientstatus(bpy.types.Operator):
'''Refresh the status of the current jobs''' '''Refresh the status of the current jobs'''
bl_idname = "render.netclientstatus" bl_idname = "render.netclientstatus"
@ -181,7 +181,7 @@ class RENDER_OT_netclientstatus(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
return self.execute(context) return self.execute(context)
@rnaOperator @rnaType
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.'''
bl_idname = "render.netclientblacklistslave" bl_idname = "render.netclientblacklistslave"
@ -211,7 +211,7 @@ class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
return self.execute(context) return self.execute(context)
@rnaOperator @rnaType
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.'''
bl_idname = "render.netclientwhitelistslave" bl_idname = "render.netclientwhitelistslave"
@ -242,7 +242,7 @@ class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
return self.execute(context) return self.execute(context)
@rnaOperator @rnaType
class RENDER_OT_netclientslaves(bpy.types.Operator): class RENDER_OT_netclientslaves(bpy.types.Operator):
'''Refresh status about available Render slaves''' '''Refresh status about available Render slaves'''
bl_idname = "render.netclientslaves" bl_idname = "render.netclientslaves"
@ -287,7 +287,7 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
return self.execute(context) return self.execute(context)
@rnaOperator @rnaType
class RENDER_OT_netclientcancel(bpy.types.Operator): class RENDER_OT_netclientcancel(bpy.types.Operator):
'''Cancel the selected network rendering job.''' '''Cancel the selected network rendering job.'''
bl_idname = "render.netclientcancel" bl_idname = "render.netclientcancel"
@ -316,7 +316,7 @@ class RENDER_OT_netclientcancel(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
return self.execute(context) return self.execute(context)
@rnaOperator @rnaType
class RENDER_OT_netclientcancelall(bpy.types.Operator): class RENDER_OT_netclientcancelall(bpy.types.Operator):
'''Cancel all running network rendering jobs.''' '''Cancel all running network rendering jobs.'''
bl_idname = "render.netclientcancelall" bl_idname = "render.netclientcancelall"
@ -343,7 +343,7 @@ class RENDER_OT_netclientcancelall(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
return self.execute(context) return self.execute(context)
@rnaOperator @rnaType
class netclientdownload(bpy.types.Operator): class netclientdownload(bpy.types.Operator):
'''Download render results from the network''' '''Download render results from the network'''
bl_idname = "render.netclientdownload" bl_idname = "render.netclientdownload"
@ -388,15 +388,16 @@ class netclientdownload(bpy.types.Operator):
def invoke(self, context, event): def invoke(self, context, event):
return self.execute(context) return self.execute(context)
@rnaOperator @rnaType
class netclientscan(bpy.types.Operator): class netclientscan(bpy.types.Operator):
__slots__ = []
'''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.'''
bl_idname = "render.netclientscan" bl_idname = "render.netclientscan"
bl_label = "Client Scan" bl_label = "Client Scan"
def poll(self, context): def poll(self, context):
return True return True
def execute(self, context): def execute(self, context):
address, port = clientScan(self.report) address, port = clientScan(self.report)
@ -409,16 +410,18 @@ class netclientscan(bpy.types.Operator):
return {'FINISHED'} return {'FINISHED'}
def invoke(self, context, event): def invoke(self, context, event):
print(dir(self))
return self.execute(context) return self.execute(context)
@rnaOperator @rnaType
class netclientweb(bpy.types.Operator): class netclientweb(bpy.types.Operator):
'''Open new window with information about running rendering jobs''' '''Open new window with information about running rendering jobs'''
bl_idname = "render.netclientweb" bl_idname = "render.netclientweb"
bl_label = "Open Master Monitor" bl_label = "Open Master Monitor"
def poll(self, context): def poll(self, context):
return True netsettings = context.scene.network_render
return netsettings.server_address != "[default]"
def execute(self, context): def execute(self, context):
netsettings = context.scene.network_render netsettings = context.scene.network_render

@ -78,6 +78,8 @@ class RENDER_PT_network_settings(RenderButtonsPanel):
else: else:
col.operator("render.netclientscan", icon='FILE_REFRESH', text="") col.operator("render.netclientscan", icon='FILE_REFRESH', text="")
col.operator("render.netclientweb", icon='QUESTION')
@rnaType @rnaType
class RENDER_PT_network_job(RenderButtonsPanel): class RENDER_PT_network_job(RenderButtonsPanel):
bl_label = "Job Settings" bl_label = "Job Settings"
@ -104,7 +106,6 @@ class RENDER_PT_network_job(RenderButtonsPanel):
col.operator("render.netclientsend", icon='FILE_BLEND') col.operator("render.netclientsend", icon='FILE_BLEND')
if scene.network_render.job_id: if scene.network_render.job_id:
col.operator("screen.render", text="Get Results", icon='RENDER_ANIMATION').animation = True col.operator("screen.render", text="Get Results", icon='RENDER_ANIMATION').animation = True
col.operator("render.netclientweb", icon='QUESTION')
col.prop(scene.network_render, "job_name") col.prop(scene.network_render, "job_name")
col.prop(scene.network_render, "job_category") col.prop(scene.network_render, "job_category")
row = col.row() row = col.row()

@ -61,10 +61,6 @@ def rnaType(rna_type):
if bpy: bpy.types.register(rna_type) if bpy: bpy.types.register(rna_type)
return rna_type return rna_type
def rnaOperator(rna_op):
if bpy: bpy.types.register(rna_op)
return rna_op
def reporting(report, message, errorType = None): def reporting(report, message, errorType = None):
if errorType: if errorType:
t = 'ERROR' t = 'ERROR'