[Bf-extensions-cvs] [3fc30cb] master: NewFeature: Use Blender environment variables for batch render

Eugenio Pignataro noreply at git.blender.org
Tue Sep 30 22:09:15 CEST 2014


Commit: 3fc30cbb69f3be69988b3363cad76866a8151be4
Author: Eugenio Pignataro
Date:   Tue Sep 30 17:09:07 2014 -0300
Branches: master
https://developer.blender.org/rBAC3fc30cbb69f3be69988b3363cad76866a8151be4

NewFeature: Use Blender environment variables for batch render

===================================================================

M	oscurart_tools/oscurart_render.py

===================================================================

diff --git a/oscurart_tools/oscurart_render.py b/oscurart_tools/oscurart_render.py
index 02fdd3b..f34cb41 100644
--- a/oscurart_tools/oscurart_render.py
+++ b/oscurart_tools/oscurart_render.py
@@ -143,7 +143,7 @@ class renderCrop (bpy.types.Operator):
         return {'FINISHED'}
 
 ##---------------------------BATCH MAKER------------------
-def defoscBatchMaker(TYPE):
+def defoscBatchMaker(TYPE,BIN):
     
     
     if os.sys.platform.startswith("w"):
@@ -168,11 +168,14 @@ def defoscBatchMaker(TYPE):
                 os.chmod(SHFILE, stat.S_IRWXU)
             except:
                 print("** Oscurart Batch maker can not modify the permissions.")    
-    
-        FILE.writelines("%s%s%s -b %s -x 1 -o %s -P %s%s.py  -s %s -e %s -a" %
-            (QUOTES,BINDIR,QUOTES,bpy.data.filepath,bpy.context.scene.render.filepath,bpy.data.filepath.rpartition(SYSBAR)[0]+
-            SYSBAR,TYPE,str(bpy.context.scene.frame_start),str(bpy.context.scene.frame_end)) )
-
+        if not BIN:
+            FILE.writelines("%s%s%s -b %s -x 1 -o %s -P %s%s.py  -s %s -e %s -a" %
+                (QUOTES,BINDIR,QUOTES,bpy.data.filepath,bpy.context.scene.render.filepath,bpy.data.filepath.rpartition(SYSBAR)[0]+
+                SYSBAR,TYPE,str(bpy.context.scene.frame_start),str(bpy.context.scene.frame_end)) )
+        else:
+            FILE.writelines("%s -b %s -x 1 -o %s -P %s%s.py  -s %s -e %s -a" %
+                ("blender",bpy.data.filepath,bpy.context.scene.render.filepath,bpy.data.filepath.rpartition(SYSBAR)[0]+
+                SYSBAR,TYPE,str(bpy.context.scene.frame_start),str(bpy.context.scene.frame_end)) )            
     
     RLATFILE =  "%s%sosRlat.py" % (bpy.data.filepath.rpartition(SYSBAR)[0] , SYSBAR )
     if not os.path.isfile(RLATFILE):
@@ -212,9 +215,10 @@ class oscBatchMaker (bpy.types.Operator):
             default='osRlat',
             )
 
-
+    bin = bpy.props.BoolProperty(default=False,name="Use Environment Variable")
+    
     def execute(self,context):
-        defoscBatchMaker(self.type)
+        defoscBatchMaker(self.type,self.bin)
         return {'FINISHED'}
 
 ## --------------------------------------PYTHON BATCH--------------------------------------------------------



More information about the Bf-extensions-cvs mailing list