[#22211] Sending single frame job to netrender
authorMartin Poirier <theeth@yahoo.com>
Sat, 1 May 2010 20:39:04 +0000 (20:39 +0000)
committerMartin Poirier <theeth@yahoo.com>
Sat, 1 May 2010 20:39:04 +0000 (20:39 +0000)
Patch by Jeroen Bakker

release/scripts/io/netrender/operators.py
release/scripts/io/netrender/ui.py

index 4c027436560c6efeb92d5113aa21ac27112e3383..fbb0f0b40439686e1049c9ae126f123c57b7b747 100644 (file)
@@ -158,6 +158,36 @@ class RENDER_OT_netclientsend(bpy.types.Operator):
     def invoke(self, context, event):
         return self.execute(context)
 
+@rnaType
+class RENDER_OT_netclientsendframe(bpy.types.Operator):
+    '''Send Render Job with current frame to the Network'''
+    bl_idname = "render.netclientsendframe"
+    bl_label = "Send current frame job"
+
+    def poll(self, context):
+        return True
+
+    def execute(self, context):
+        scene = context.scene
+        netsettings = scene.network_render
+
+        try:
+            conn = clientConnection(netsettings.server_address, netsettings.server_port, self.report)
+
+            if conn:
+                # Sending file
+                scene.network_render.job_id = client.clientSendJob(conn, scene, False)
+                conn.close()
+                self.report('INFO', "Job sent to master")
+        except Exception as err:
+            self.report('ERROR', str(err))
+
+
+        return {'FINISHED'}
+
+    def invoke(self, context, event):
+        return self.execute(context)
+
 @rnaType
 class RENDER_OT_netclientstatus(bpy.types.Operator):
     '''Refresh the status of the current jobs'''
index cef2c542b9c433bc18561e75811277650aaadbaa..c554c3031fba369029f221577f7e7193a2878dee 100644 (file)
@@ -187,6 +187,7 @@ class RENDER_PT_network_job(bpy.types.Panel, RenderButtonsPanel):
         if netsettings.server_address != "[default]":
             layout.operator("render.netclientanim", icon='RENDER_ANIMATION')
             layout.operator("render.netclientsend", icon='FILE_BLEND')
+            layout.operator("render.netclientsendframe", icon='RENDER_STILL')
             if netsettings.job_id:
                 row = layout.row()
                 row.operator("render.render", text="Get Image", icon='RENDER_STILL')