[Durian-svn] [2476] Forgot to commit the latest version last week

dolf institute at blender.org
Tue Apr 27 11:05:57 CEST 2010


Revision: 2476
          https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=2476
Author:   dolf
Date:     2010-04-27 11:05:56 +0200 (Tue, 27 Apr 2010)
Log Message:
-----------
Forgot to commit the latest version last week

Modified Paths:
--------------
    pro/scripts/utilities/findLibError.py
    pro/scripts/utilities/findPathError.py

Modified: pro/scripts/utilities/findLibError.py
===================================================================
--- pro/scripts/utilities/findLibError.py	2010-04-27 08:44:46 UTC (rev 2475)
+++ pro/scripts/utilities/findLibError.py	2010-04-27 09:05:56 UTC (rev 2476)
@@ -39,7 +39,7 @@
 # CHARS, ENV_CAVE, ENV_CITY, ENV_QUEST, ENV_SNOW, MATTES, PROPS, PROPS_CITY, PROPS_SNOW
 
 # Checking images done... 
-# PROPS_CITY, PROPS_SNOW, PROPS, MATTES, SETS
+# PROPS_CITY, PROPS_SNOW, PROPS, MATTES, SETS, CHARS
 # 04.1 needs checking... going to props_city, env_city first
 
 

Modified: pro/scripts/utilities/findPathError.py
===================================================================
--- pro/scripts/utilities/findPathError.py	2010-04-27 08:44:46 UTC (rev 2475)
+++ pro/scripts/utilities/findPathError.py	2010-04-27 09:05:56 UTC (rev 2476)
@@ -81,6 +81,15 @@
                     if tex.library:
                         continue
 
+                    if not tex.node_tree == None:
+                        for n in tex.node_tree.nodes:
+                            if n.name == 'Image':
+                                if n.type == 'IMAGE':
+                                    if n.image == i:
+                                        n.image = base_image
+                                        change = 1
+                                        print('fixed the image')
+
                     if tex.type == 'IMAGE':
                         if tex.image == i:
                             tex.image = base_image
@@ -97,10 +106,7 @@
                                 change = 1
     return change
 
-
 def report_images():
-    
-    missing_images = []
 
     for i in bpy.data.images:
         if not i.library:
@@ -116,7 +122,6 @@
                 filename_abs = expandpath(filename)
             
             if not exists(filename_abs):
-                missing_images.append(i)
                 print("ERROR PATH:", name, filename, 'ABS:', filename_abs)
             
             if i.packed_file:
@@ -128,10 +133,7 @@
         value = image_dupes[filename_abs]
         if len(value) > 1:
             print("DUPLICATE PATH:", filename_abs, 'Datablocks:', ' '.join([i.name for i in value]))
-    
-    return missing_images()
 
-
 def report_modifiers():
     for obj in bpy.data.objects:
 
@@ -170,7 +172,6 @@
             path = "//" + os.path.normpath(newpath)
 
     return path
-    
 
 def make_relative():
     change = 0
@@ -189,36 +190,40 @@
     return change
     
 
-def clear_images(missing_images):
+def clear_images(rem_missing=False):
     change = 0
+
     for i in bpy.data.images:
         if not i.library:
             if ignore_image(i):
                 continue
             
-            #for bad in "Weeklies", "Ben_Desktop", "/shared/", "/home/soenke/Desktop/", "/home/guest/":
-            #if bad in i.filename:
-            if i in missing_images:
-                print("ERROR PATH:",  i.name, i.filename, "(REMOVED)")
+            filename_abs = expandpath(i.filename)
+
+            if rem_missing and not exists(filename_abs):
                 i.user_clear()
                 change = 1
-                break
+            else:
+                for bad in "Weeklies", "Ben_Desktop", "/shared/", "/home/soenke/Desktop/", "/home/guest/":
+                    if bad in i.filename:
+                        print("ERROR PATH:",  i.name, i.filename, "(REMOVED)")
+                        i.user_clear()
+                        change = 1
+                        break
 
-
     return change
 
 if __name__ == "__main__":
     change = 0
-    missing_images = report_images()
+    report_images()
     report_modifiers()
     
     # optional, take care!
     change |= make_relative()
-    change |= clear_images(missing_images)
+    change |= clear_images(rem_missing = True)
     change |= merge_duplicates()
     
     print("Changing??? ", change)
     if change:
         bpy.ops.wm.save_mainfile(check_existing=False, path=bpy.data.filename)
-    
-    
+    
\ No newline at end of file



More information about the Durian-svn mailing list