[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1147] trunk/py/scripts/addons/ render_renderfarmfi.py: Added a new summary block to the Renderfarm. fi render engine page

Jesse Kaukonen jesse.kaukonen at gmail.com
Mon Nov 8 16:30:26 CET 2010


Revision: 1147
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=1147
Author:   gekko
Date:     2010-11-08 16:30:26 +0100 (Mon, 08 Nov 2010)

Log Message:
-----------
Added a new summary block to the Renderfarm.fi render engine page

Modified Paths:
--------------
    trunk/py/scripts/addons/render_renderfarmfi.py

Modified: trunk/py/scripts/addons/render_renderfarmfi.py
===================================================================
--- trunk/py/scripts/addons/render_renderfarmfi.py	2010-11-08 12:48:34 UTC (rev 1146)
+++ trunk/py/scripts/addons/render_renderfarmfi.py	2010-11-08 15:30:26 UTC (rev 1147)
@@ -19,9 +19,9 @@
 bl_addon_info = {
     "name": "Renderfarm.fi",
     "author": "Nathan Letwory <nathan at letworyinteractive.com>, Jesse Kaukonen <jesse.kaukonen at gmail.com>",
-    "version": (3,),
-    "blender": (2, 5, 3),
-    "api": 31847,
+    "version": (4,),
+    "blender": (2, 5, 5),
+    "api": 32941,
     "location": "Render > Engine > Renderfarm.fi",
     "description": "Send .blend as session to http://www.renderfarm.fi to render",
     "warning": "",
@@ -119,7 +119,7 @@
 ORESettings.outlicense = EnumProperty(items=licenses, name='output license', description='license speficied for the output files', default='1')
 
 ORESettings.sessions = CollectionProperty(type=ORESession, name='Sessions', description='Sessions on Renderfarm.fi')
-        
+
 # all panels, except render panel
 # Example of wrapping every class 'as is'
 import properties_scene
@@ -154,8 +154,98 @@
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "render"
-    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
+    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here    
+
+class SUMMARY_PT_RenderfarmFi(RenderButtonsPanel, bpy.types.Panel):
+    # Prints a summary to the panel before uploading. If scene settings differ from ore settings, then display a warning icon
+    bl_label = 'Summary'
+    COMPAT_ENGINES = set(['RENDERFARMFI_RENDER'])
     
+    @classmethod
+    def poll(cls, context):
+        rd = context.scene.render
+        return (rd.use_game_engine==False) and (rd.engine in cls.COMPAT_ENGINES)
+    
+    def draw(self, context):
+        sce = context.scene
+        rd = context.scene.render
+        ore = context.scene.ore_render
+        layout = self.layout
+        
+        # Check if correct resolution is set
+        if rd.resolution_x != ore.resox:
+            layout.label(text='Resolution X: ' + str(ore.resox), icon='ERROR')
+        else:
+            layout.label(text='Resolution X: ' + str(ore.resox), icon='FILE_TICK')
+        if rd.resolution_y != ore.resoy:
+            layout.label(text='Resolution Y: ' + str(ore.resoy), icon='ERROR')
+        else:
+            layout.label(text='Resolution Y: ' + str(ore.resoy), icon='FILE_TICK')
+        
+        # Check if correct number of frames is specified
+        if (sce.frame_start != ore.start) and not ( (sce.frame_start == ore.start and sce.frame_end == ore.end) and sce.frame_start == sce.frame_end):
+            layout.label(text='Start frame: ' + str(ore.start), icon='ERROR')
+            layout.label(text='.blend Start frame is different to the one specified in the uploader script. Please verify!')
+        else:
+            layout.label(text='Start frame: ' + str(ore.start), icon='FILE_TICK')
+        if (sce.frame_end != ore.end) and not ( (sce.frame_start == ore.start and sce.frame_end == ore.end) and sce.frame_start == sce.frame_end):
+            layout.label(text='End frame: ' + str(ore.end), icon='ERROR')
+            layout.label(text='.blend End frame is different to the one specified in the uploader script. Please verify!')
+        else:
+            layout.label(text='End frame: ' + str(ore.end), icon='FILE_TICK')
+        
+        # Check if more than 1 frame is specified
+        if (sce.frame_start == ore.start and sce.frame_end == ore.end) and (sce.frame_start == sce.frame_end):
+            layout.label(text='Only one frame specified to be rendered!')
+            layout.label(text='This is highly ineffective when using distributed rendering')
+        
+        if rd.resolution_percentage != 100:
+            layout.label(text='Resolution percentage: ' + str(rd.resolution_percentage), icon='ERROR')
+        else:
+            layout.label(text='Resolution percentage: ' + str(rd.resolution_percentage), icon='FILE_TICK')
+        
+        if rd.file_format != 'PNG':
+            layout.label(text='Output format: ' + rd.file_format, icon='ERROR')
+            layout.label(text='Output format must be set to PNG')
+        else:
+            layout.label(text='Output format: ' + rd.file_format, icon='FILE_TICK')
+        
+        if ore.parts > 1 and rd.use_sss == True:
+            layout.label(text='Subsurface Scattering: ' + str(rd.use_sss), icon='ERROR')
+            layout.label(text='If you want to use SSS, parts must be set to 1')
+        else:
+            layout.label(text='Subsurface Scattering: ' + str(rd.use_sss), icon='FILE_TICK')
+        
+        if rd.use_compositing == False:
+            layout.label(text='Composite nodes: ' + str(rd.use_compositing), icon='ERROR')
+            layout.label(text='Composite nodes are disabled.')
+            layout.label(text='The script automatically disables them if: ')
+            layout.label(text='- Filter type nodes are used and parts are more than 1')
+            layout.label(text='- There is an output node')
+        else:
+            layout.label(text='Composite nodes: ' + str(rd.use_compositing), icon='FILE_TICK')
+        
+        if rd.use_save_buffers:
+            layout.label(text='Save buffers: ' + str(rd.use_save_buffers), icon='ERROR')
+            layout.label(text='Save buffers must be disabled')
+            layout.label(text='Can only disabled if Full Sample is turned off')
+        else:
+            layout.label(text='Save buffers: ' + str(rd.use_save_buffers), icon='FILE_TICK')
+        
+        if rd.threads_mode != 'FIXED' or rd.threads > 1:
+            layout.label(text='Threads: ' + rd.threads_mode + ' ' + str(rd.threads), icon='ERROR')
+            layout.label(text='Threads must be set to Fixed, 1')
+        else:
+            layout.label(text='Threads: ' + rd.threads_mode + ' ' + str(rd.threads), icon='FILE_TICK')
+        
+        if ore.prepared == False:
+            layout.label(text='The script reports "not ready".', icon='ERROR')
+            layout.label(text='Please review the settings above')
+            layout.label(text='If everything is in order, click Check Scene again')
+            layout.label(text='The script automatically changes settings, so make sure they are correct')
+        else:
+            layout.label(text='The script reports "Good to go!"', icon='FILE_TICK')
+            layout.label(text='To make sure that all works, please run a test render first')
 
 class RENDERFARM_MT_Session(bpy.types.Menu):
     bl_label = "Show Session"
@@ -244,23 +334,22 @@
 class RENDER_PT_RenderfarmFi(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Scene Settings"
     COMPAT_ENGINES = set(['RENDERFARMFI_RENDER'])
-
+    
     @classmethod
     def poll(cls, context):
         rd = context.scene.render
         return (rd.use_game_engine==False) and (rd.engine in cls.COMPAT_ENGINES)
-
+    
     def draw(self, context):
         layout = self.layout
         sce = context.scene
         ore = sce.ore_render
-
+        
         if ore.prepared and ore.hash!='':
             layout.prop(ore, 'memusage')
             
             layout.separator()
             row = layout.row()
-            row.label(text='Resolution: '+str(ore.resox)+'x'+str(ore.resoy))
             
             layout.separator()
             row = layout.row()
@@ -642,7 +731,7 @@
     def execute(self, context):
         def hasSSSMaterial():
             for m in bpy.data.materials:
-                if m.subsurface_scattering.enabled:
+                if m.subsurface_scattering.use:
                     return True
             return False
 
@@ -710,8 +799,9 @@
         if len(bpy.errors) > 0:
             ore.prepared = False
             return {'CANCELLED'}
-
+        
         rd = sce.render
+        
         print("=============================================")
         rd.threads_mode = 'FIXED'
         rd.threads = 1
@@ -741,6 +831,7 @@
         if rd.use_compositing:
             if hasCompositingErrors(sce.use_nodes, sce.node_tree, ore.parts):
                 print("Found disallowed nodes or problematic setup")
+                rd.use_compositing = False
                 self.report({'WARNING'}, "Found disallowed nodes or problematic setup")
                 errors = True
         print("Done checking the scene. Now do a test render")
@@ -781,14 +872,18 @@
 
 class ORE_UseBlenderReso(bpy.types.Operator):
     bl_idname = "ore.use_scene_settings"
-    bl_label = "Use Scene resolution"
+    bl_label = "Use Scene settings"
     
     def execute(self, context):
         sce = context.scene
         ore = sce.ore_render
+        rd = context.scene.render
         
-        ore.resox = sce.render.resolution_x
-        ore.resoy = sce.render.resolution_y
+        ore.resox = rd.resolution_x
+        ore.resoy = rd.resolution_y
+        ore.start = sce.frame_start
+        ore.end = sce.frame_end
+        ore.fps = rd.fps
         
         return {'FINISHED'}
 




More information about the Bf-extensions-cvs mailing list