[Bf-extensions-cvs] [fdf9f47] master: update to correct version

meta-androcto noreply at git.blender.org
Sun Jan 17 05:58:41 CET 2016


Commit: fdf9f47ab152572bbff7a9589e632885996bb7f3
Author: meta-androcto
Date:   Sun Jan 17 15:58:19 2016 +1100
Branches: master
https://developer.blender.org/rBACfdf9f47ab152572bbff7a9589e632885996bb7f3

update to correct version

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

M	render_auto_save.py

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

diff --git a/render_auto_save.py b/render_auto_save.py
index 48e7c5f..f2284fa 100644
--- a/render_auto_save.py
+++ b/render_auto_save.py
@@ -1,44 +1,41 @@
-# Simplified BSD License
+#Simplified BSD License
 #
-# Copyright (c) 2012, Florian Meyer
-# tstscr at web.de
-# All rights reserved.
+#Copyright (c) 2012, Florian Meyer
+#tstscr at web.de
+#All rights reserved.
 #
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
+#Redistribution and use in source and binary forms, with or without
+#modification, are permitted provided that the following conditions are met: 
 #
-# 1. Redistributions of source code must retain the above copyright notice, this
-#    list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright notice,
-#    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution.
+#1. Redistributions of source code must retain the above copyright notice, this
+#   list of conditions and the following disclaimer. 
+#2. Redistributions in binary form must reproduce the above copyright notice,
+#   this list of conditions and the following disclaimer in the documentation
+#   and/or other materials provided with the distribution. 
 #
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+#DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+#ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+#(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+#ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+#SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#################################################################
 bl_info = {
     "name": "Auto Save Render",
     "author": "tstscr",
-    "version": (1, 0),
-    "blender": (2, 63, 0),
+    "version": (2, 0),
+    "blender": (2, 73, 0),
     "location": "Rendertab -> Render Panel",
     "description": "Automatically save the image after rendering",
     "warning": "",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
-        "Scripts/Render/Auto_Save",
-    "tracker_url": "https://developer.blender.org/T32491",
+    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Render/Auto_Save",
+    "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail&aid=32491",
     "category": "Render"}
-
-
+###########################################################################
 import bpy
 from bpy.props import BoolProperty, EnumProperty
 from bpy.app.handlers import persistent
@@ -59,13 +56,13 @@ def auto_save_render(scene):
     if format == 'OPEN_EXR_MULTILAYER': extension = '.exr'
     if format == 'JPEG': extension = '.jpg'
     if format == 'PNG': extension = '.png'
-
+    
     blendname = basename(bpy.data.filepath).rpartition('.')[0]
     filepath = dirname(bpy.data.filepath) + '/auto_saves'
-
+    
     if not exists(filepath):
         mkdir(filepath)
-
+        
     if scene.auto_save_subfolders:
         filepath = join(filepath, blendname)
         if not exists(filepath):
@@ -75,7 +72,7 @@ def auto_save_render(scene):
     files = [f for f in listdir(filepath) \
             if f.startswith(blendname) \
             and f.lower().endswith(('.png', '.jpg', '.jpeg', '.exr'))]
-
+    
     highest = 0
     if files:
         for f in files:
@@ -84,36 +81,46 @@ def auto_save_render(scene):
             if suffix:
                 if int(suffix[-1]) > highest:
                     highest = int(suffix[-1])
-
+    
     save_name = join(filepath, blendname) + '_' + str(highest+1).zfill(3) + extension
 
     image = bpy.data.images['Render Result']
     if not image:
         print('Auto Save: Render Result not found. Image not saved')
         return
-
+    
     print('Auto_Save:', save_name)
     image.save_render(save_name, scene=None)
 
+    if scene.save_blend:
+    	save_name_blend = join(filepath, blendname) + '_' + str(highest+1).zfill(3) + '.blend'
+    	print('Blend_Save:',save_name_blend)
+    	bpy.ops.wm.save_as_mainfile(filepath=save_name_blend, copy=True)	
+    
     rndr.image_settings.file_format = original_format
 
 ###########################################################################
 def auto_save_UI(self, context):
     layout = self.layout
-
-    split=layout.split(percentage=0.66, align=True)
-    row = split.row()
-    row.prop(context.scene, 'save_after_render', text='Auto Save', toggle=False)
-    row.prop(context.scene, 'auto_save_subfolders', toggle=False)
-    #split=layout.split()
-    row=split.row()
-    row.prop(context.scene, 'auto_save_format', text='as', expand=False)
-
+    
+    split=layout.split()
+    col = split.column()
+    col.prop(context.scene, 'save_after_render', text='Auto Save Image', toggle=False)
+    col.prop(context.scene, 'save_blend', text='with .blend', toggle=False)	
+
+    col = split.column()	
+    col.prop(context.scene, 'auto_save_subfolders', toggle=False)
+    col.prop(context.scene, 'auto_save_format', text='as', expand=False)
+    
 def register():
     bpy.types.Scene.save_after_render = BoolProperty(
                     name='Save after render',
                     default=True,
                     description='Automatically save rendered images into: //auto_save/')
+    bpy.types.Scene.save_blend = BoolProperty(
+		    name = 'with .blend',
+                    default=True,
+                    description='Also save .blend file into: //auto_save/')	
     bpy.types.Scene.auto_save_format = EnumProperty(
                     name='Auto Save File Format',
                     description='File Format for the auto saves.',
@@ -128,7 +135,7 @@ def register():
                     description='Save into individual subfolders per blend name')
     bpy.app.handlers.render_post.append(auto_save_render)
     bpy.types.RENDER_PT_render.append(auto_save_UI)
-
+    
 def unregister():
     del(bpy.types.Scene.save_after_render)
     del(bpy.types.Scene.auto_save_format)
@@ -137,4 +144,4 @@ def unregister():
     bpy.types.RENDER_PT_render.remove(auto_save_UI)
 
 if __name__ == "__main__":
-    register()
\ No newline at end of file
+    register()



More information about the Bf-extensions-cvs mailing list