[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [897] trunk/py/scripts/addons/ render_renderfarmfi.py: * don't set ore.prepared when issues are found

Nathan Letwory nathan at letworyinteractive.com
Fri Aug 6 15:21:08 CEST 2010


Revision: 897
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=897
Author:   jesterking
Date:     2010-08-06 15:21:08 +0200 (Fri, 06 Aug 2010)

Log Message:
-----------
* don't set ore.prepared when issues are found
* add tests for nodes.
* update poll() usage to be according changes in blender

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-08-06 03:47:42 UTC (rev 896)
+++ trunk/py/scripts/addons/render_renderfarmfi.py	2010-08-06 13:21:08 UTC (rev 897)
@@ -151,10 +151,6 @@
     bl_context = "render"
     # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
     
-    @staticmethod
-    def poll(context):
-        rd = context.scene.render
-        return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
 
 class RENDERFARM_MT_Session(bpy.types.Menu):
     bl_label = "Show Session"
@@ -171,6 +167,12 @@
 class LOGIN_PT_RenderfarmFi(RenderButtonsPanel, bpy.types.Panel):
     bl_label = 'Login to Renderfarm.fi'
     COMPAT_ENGINES = set(['RENDERFARMFI_RENDER'])
+
+    @staticmethod
+    def poll(context):
+        rd = context.scene.render
+        return (rd.use_game_engine==False) and (rd.engine in __class__.COMPAT_ENGINES)
+
     def draw(self, context):
         layout = self.layout
         # XXX layout.operator('ore.check_update')
@@ -192,6 +194,11 @@
     bl_label = 'Check for updates'
     COMPAT_ENGINES = set(['RENDERFARMFI_RENDER'])
 
+    @staticmethod
+    def poll(context):
+        rd = context.scene.render
+        return (rd.use_game_engine==False) and (rd.engine in __class__.COMPAT_ENGINES)
+
     def draw(self, context):
         layout = self.layout
         ore = context.scene.ore_render
@@ -207,6 +214,11 @@
     bl_label = 'Sessions'
     COMPAT_ENGINES = set(['RENDERFARMFI_RENDER'])
 
+    @staticmethod
+    def poll(context):
+        rd = context.scene.render
+        return (rd.use_game_engine==False) and (rd.engine in __class__.COMPAT_ENGINES)
+
     def draw(self, context):
         layout = self.layout
         ore = context.scene.ore_render
@@ -228,6 +240,11 @@
     bl_label = "Scene Settings"
     COMPAT_ENGINES = set(['RENDERFARMFI_RENDER'])
 
+    @staticmethod
+    def poll(context):
+        rd = context.scene.render
+        return (rd.use_game_engine==False) and (rd.engine in __class__.COMPAT_ENGINES)
+
     def draw(self, context):
         layout = self.layout
         sce = context.scene
@@ -653,6 +670,26 @@
         def hasUnsupportedSimulation():
             return hasSoftbodySimulation() or hasCollisionSimulation() or hasClothSimulation() or hasSmokeSimulation or hasFluidSimulation() or hasParticleSystem()
 
+        def isFilterNode(node):
+            t = type(node)
+            return t==bpy.types.CompositorNodeBlur or t==bpy.types.CompositorNodeDBlur
+
+        def hasCompositingErrors(use_nodes, nodetree, parts):
+            if not use_nodes: # no nodes in use, ignore check
+                return False
+
+            for node in nodetree.nodes:
+                # output file absolutely forbidden
+                if type(node)==bpy.types.CompositorNodeOutputFile:
+                    self.report({'ERROR'}, 'File output node is disallowed, remove them from your compositing nodetrees.')
+                    return True
+                # blur et al are problematic when rendering ore.parts>1
+                if isFilterNode(node) and parts>1:
+                    self.report({'WARNING'}, 'A filtering node found and parts > 1. This combination will give bad output.')
+                    return True
+
+            return False
+
         sce = context.scene
         ore = sce.ore_render
         
@@ -696,18 +733,26 @@
             errors = True
         rd.save_buffers = False
         rd.free_image_textures = True
+        if rd.use_compositing:
+            if hasCompositingErrors(sce.use_nodes, sce.nodetree, ore.parts):
+                print("Found disallowed nodes or problematic setup")
+                self.report({'WARNING'}, "Found disallowed nodes or problematic setup")
+                errors = True
         print("Done checking the scene. Now do a test render")
         self.report({'INFO'}, "Done checking the scene. Now do a test render")
         print("=============================================")
         
-        if (errors == True):
+        # if errors found, don't allow to upload, instead have user
+        # go through this until everything is ok
+        if errors:
             self.report({'WARNING'}, "Settings were changed or other issues found. Check console and do a test render to make sure everything works.")
-        
-        ore.prepared = True
-        rd.engine = 'BLENDER_RENDER'
-        bpy.ops.wm.save_mainfile()
-        rd.engine = 'RENDERFARMFI_RENDER'
-        
+            ore.prepared = False
+        else:
+            ore.prepared = True
+            rd.engine = 'BLENDER_RENDER'
+            bpy.ops.wm.save_mainfile()
+            rd.engine = 'RENDERFARMFI_RENDER'
+            
         return {'FINISHED'}
 
 class ORE_ResetOp(bpy.types.Operator):




More information about the Bf-extensions-cvs mailing list