[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3465] trunk/py/scripts/tools/bi_farm/ new_blender_setup.py: correct check for unsaved file

Campbell Barton ideasman42 at gmail.com
Wed Jun 6 10:01:43 CEST 2012


Revision: 3465
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3465
Author:   campbellbarton
Date:     2012-06-06 08:01:28 +0000 (Wed, 06 Jun 2012)
Log Message:
-----------
correct check for unsaved file

Modified Paths:
--------------
    trunk/py/scripts/tools/bi_farm/new_blender_setup.py

Modified: trunk/py/scripts/tools/bi_farm/new_blender_setup.py
===================================================================
--- trunk/py/scripts/tools/bi_farm/new_blender_setup.py	2012-06-06 07:52:16 UTC (rev 3464)
+++ trunk/py/scripts/tools/bi_farm/new_blender_setup.py	2012-06-06 08:01:28 UTC (rev 3465)
@@ -1,3 +1,23 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8-80 compliant>
+
 # runs on the nodes inside blender
 
 import bpy
@@ -42,7 +62,7 @@
     return ip
 
 
-def get_revision():
+def get_revision(filepath):
     '''returns the revision of this blendfile'''
     import subprocess
     lines = subprocess.Popen(["svn", "info", bpy.data.filepath], stdout=subprocess.PIPE).communicate()[0].splitlines()
@@ -89,7 +109,7 @@
 
         rd.use_stamp_note = True
         rd.use_stamp_render_time = True
-        rd.stamp_note_text = "rev:%s, art_rev:%s, %s" % (bpy.app.build_revision, str(get_revision()), ip)
+        rd.stamp_note_text = "rev:%s, art_rev:%s, %s" % (bpy.app.build_revision, str(get_revision(fpath)), ip)
 
         # stamp
         if quality != "File settings":
@@ -182,9 +202,7 @@
     for sce_iter in bpy.data.scenes:
         sce_iter.frame_set(scene_current.frame_current)
 
-
-    # TODO, some valid file test would be nice.
-    if not fpath.startswith("<memory"):
+    if fpath:
         bpy.ops.render.render(animation=True)
 
 



More information about the Bf-extensions-cvs mailing list