[Durian-svn] [2477] Tiny script to remove all images in a Blend from all viewers, good for making sure no renders are kept for instance, this should be solved now, but for older files we want to keep the code around.

dolf institute at blender.org
Tue Apr 27 11:08:53 CEST 2010


Revision: 2477
          https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=2477
Author:   dolf
Date:     2010-04-27 11:08:53 +0200 (Tue, 27 Apr 2010)
Log Message:
-----------
Tiny script to remove all images in a Blend from all viewers, good for making sure no renders are kept for instance, this should be solved now, but for older files we want to keep the code around.

Added Paths:
-----------
    pro/scripts/utilities/removeImagesFromViewers.py

Added: pro/scripts/utilities/removeImagesFromViewers.py
===================================================================
--- pro/scripts/utilities/removeImagesFromViewers.py	                        (rev 0)
+++ pro/scripts/utilities/removeImagesFromViewers.py	2010-04-27 09:08:53 UTC (rev 2477)
@@ -0,0 +1,16 @@
+#Tiny thing that removes all images from image viewers (should clear datablocks that shouldn't be there anyway)
+
+# By Dolf... thanks cam
+
+import bpy
+
+for s in bpy.data.screens:
+    
+    for a in s.areas:
+    
+        for p in a.spaces:
+            
+            if p.type == 'IMAGE_EDITOR':    
+
+                p.image = None
+                print('Removed image')
\ No newline at end of file



More information about the Durian-svn mailing list