Improves in render Tools
authorOscurart Eugenio Pignataro <info@oscurart.com.ar>
Sun, 3 Feb 2013 18:41:57 +0000 (18:41 +0000)
committerOscurart Eugenio Pignataro <info@oscurart.com.ar>
Sun, 3 Feb 2013 18:41:57 +0000 (18:41 +0000)
oscurart_tools/oscurart_render.py

index 92edc90aec2d00d18b5ed4c01e002cdf2570ba2e..31a3b591d2bbffca5f7a0017c6839844683187ec 100644 (file)
@@ -24,9 +24,7 @@ def defRenderAll (frametype):
             if OBJECT.type=="MESH" or OBJECT.type == "META" or OBJECT.type == "CURVE":
                 for SLOT in OBJECT.material_slots[:]:
                     SLOTLIST.append(SLOT.material)
-
                 LISTMAT.append((OBJECT,SLOTLIST))
-
         except:
             pass
     for SCENE in SCENES:
@@ -60,12 +58,11 @@ def defRenderAll (frametype):
             print("SCENE: "+CURSC)
             print("LAYER: "+layers.name)
             print("OVERRIDE: "+str(PROPTOLIST))
-            SCENE.render.filepath = "%s/%s/%s/%s/%s_%s_%s_" % (PATH,SCENENAME,CURSC,layers.name,SCENENAME,SCENE.name,layers.name)
+            SCENE.render.filepath = os.path.join(PATH,SCENENAME,CURSC,layers.name,"%s_%s_%s" % (SCENENAME,SCENE.name,layers.name))
             SCENE.render.layers[layers.name].use = 1
             bpy.ops.render.render(animation=True, write_still=True, layer=layers.name, scene= SCENE.name)
             print("DONE")
             print("---------------------")
-
         for layer in LAYERLIST:
             layer.use = 1
         SCENE.render.filepath = ENDPATH
@@ -91,7 +88,6 @@ class renderAll (bpy.types.Operator):
 
     frametype=bpy.props.BoolProperty(default=False)
 
-
     def execute(self,context):
         defRenderAll(self.frametype)
         return {'FINISHED'}
@@ -99,10 +95,8 @@ class renderAll (bpy.types.Operator):
 
 ##--------------------------------RENDER SELECTED SCENES----------------------------
 
-
 bpy.types.Scene.use_render_scene = bpy.props.BoolProperty()
 
-
 def defRenderSelected(frametype):
     ACTSCENE = bpy.context.scene
     LISTMAT = []
@@ -153,7 +147,7 @@ def defRenderSelected(frametype):
                 print("SCENE: "+CURSC)
                 print("LAYER: "+layers.name)
                 print("OVERRIDE: "+str(PROPTOLIST))
-                SCENE.render.filepath = "%s/%s/%s/%s/%s_%s_%s_" % (PATH,SCENENAME,CURSC,layers.name,SCENENAME,SCENE.name,layers.name)
+                SCENE.render.filepath = os.path.join(PATH,SCENENAME,CURSC,layers.name,"%s_%s_%s" % (SCENENAME,SCENE.name,layers.name))
                 SCENE.render.layers[layers.name].use = 1
                 bpy.ops.render.render(animation=True, layer=layers.name, write_still=True, scene= SCENE.name)
                 print("DONE")
@@ -176,7 +170,6 @@ def defRenderSelected(frametype):
                 SCENE.frame_start = FS
     bpy.context.window.screen.scene = ACTSCENE
 
-
 class renderSelected (bpy.types.Operator):
     bl_idname="render.render_selected_scenes_osc"
     bl_label="Render Selected Scenes"
@@ -187,12 +180,8 @@ class renderSelected (bpy.types.Operator):
         defRenderSelected(self.frametype)
         return {'FINISHED'}
 
-
-
-
 ##--------------------------------RENDER CURRENT SCENE----------------------------
 
-
 def defRenderCurrent (frametype):
     LISTMAT = []
     SCENE = bpy.context.scene
@@ -239,7 +228,7 @@ def defRenderCurrent (frametype):
         print("SCENE: "+CURSC)
         print("LAYER: "+layers.name)
         print("OVERRIDE: "+str(PROPTOLIST))
-        SCENE.render.filepath = "%s/%s/%s/%s/%s_%s_%s_" % (PATH,SCENENAME,CURSC,layers.name,SCENENAME,SCENE.name,layers.name)
+        SCENE.render.filepath = os.path.join(PATH,SCENENAME,CURSC,layers.name,"%s_%s_%s" % (SCENENAME,SCENE.name,layers.name))
         SCENE.render.layers[layers.name].use = 1
         bpy.ops.render.render(animation=True, layer=layers.name, write_still=1, scene= SCENE.name)
         print("DONE")
@@ -261,7 +250,6 @@ def defRenderCurrent (frametype):
         SCENE.frame_end = FE
         SCENE.frame_start = FS
 
-
 class renderCurrent (bpy.types.Operator):
     bl_idname="render.render_current_scene_osc"
     bl_label="Render Current Scene"
@@ -300,8 +288,6 @@ class renderCrop (bpy.types.Operator):
         OscRenderCropFunc()
         return {'FINISHED'}
 
-
-
 ##---------------------------BATCH MAKER------------------
 def defoscBatchMaker(TYPE):
     if sys.platform.startswith("w"):