Revision: 31204 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31204 Author: theeth Date: 2010-08-10 04:58:32 +0200 (Tue, 10 Aug 2010)
Log Message: ----------- rewrite poll methods using a base class implementation instead of a global function (now that this is possible because of it being a class method) Modified Paths: -------------- trunk/blender/release/scripts/io/netrender/ui.py Modified: trunk/blender/release/scripts/io/netrender/ui.py =================================================================== --- trunk/blender/release/scripts/io/netrender/ui.py 2010-08-09 22:54:40 UTC (rev 31203) +++ trunk/blender/release/scripts/io/netrender/ui.py 2010-08-10 02:58:32 UTC (rev 31204) @@ -86,8 +86,12 @@ bl_region_type = "WINDOW" bl_context = "render" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here + + @classmethod + def poll(cls, context): + rd = context.scene.render + return (rd.use_game_engine==False) and (rd.engine in cls.COMPAT_ENGINES) - # Setting panel, use in the scene for now. class RENDER_PT_network_settings(bpy.types.Panel, RenderButtonsPanel): bl_label = "Network Settings" @@ -95,7 +99,7 @@ @classmethod def poll(cls, context): - return base_poll(cls, context) + return super(RENDER_PT_network_settings, cls).poll(context) def draw(self, context): layout = self.layout @@ -134,7 +138,7 @@ @classmethod def poll(cls, context): scene = context.scene - return base_poll(cls, context) and scene.network_render.mode == "RENDER_SLAVE" + return super(RENDER_PT_network_slave_settings, cls).poll(context) and scene.network_render.mode == "RENDER_SLAVE" def draw(self, context): layout = self.layout @@ -159,7 +163,7 @@ @classmethod def poll(cls, context): scene = context.scene - return base_poll(cls, context) and scene.network_render.mode == "RENDER_MASTER" + return super(RENDER_PT_network_master_settings, cls).poll(context) and scene.network_render.mode == "RENDER_MASTER" def draw(self, context): layout = self.layout @@ -177,7 +181,7 @@ @classmethod def poll(cls, context): scene = context.scene - return base_poll(cls, context) and scene.network_render.mode == "RENDER_CLIENT" + return super(RENDER_PT_network_job, cls).poll(context) and scene.network_render.mode == "RENDER_CLIENT" def draw(self, context): layout = self.layout @@ -221,7 +225,7 @@ if netsettings.mode != "RENDER_CLIENT": return False verify_address(netsettings) - return base_poll(cls, context) and netsettings.server_address != "[default]" + return super(RENDER_PT_network_slaves, cls).poll(context) and netsettings.server_address != "[default]" def draw(self, context): layout = self.layout @@ -259,7 +263,7 @@ if netsettings.mode != "RENDER_CLIENT": return False verify_address(netsettings) - return base_poll(cls, context) and netsettings.server_address != "[default]" + return super(RENDER_PT_network_slaves_blacklist, cls).poll(context) and netsettings.server_address != "[default]" def draw(self, context): layout = self.layout @@ -296,7 +300,7 @@ if netsettings.mode != "RENDER_CLIENT": return False verify_address(netsettings) - return base_poll(cls, context) and netsettings.server_address != "[default]" + return super(RENDER_PT_network_jobs, cls).poll(context) and netsettings.server_address != "[default]" def draw(self, context): layout = self.layout _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs