[Durian-svn] [2198] report missing multires textures and packed images.

campbell institute at blender.org
Tue Apr 20 11:44:28 CEST 2010


Revision: 2198
          https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=2198
Author:   campbell
Date:     2010-04-20 11:44:28 +0200 (Tue, 20 Apr 2010)
Log Message:
-----------
report missing multires textures and packed images.

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-20 08:55:43 UTC (rev 2197)
+++ pro/scripts/utilities/findLibError.py	2010-04-20 09:44:28 UTC (rev 2198)
@@ -76,7 +76,7 @@
         
         context_lib = None
         for out_line in file_lib.readlines():
-            if out_line.startswith('ERROR PATH: ') or out_line.startswith('ABSOLUTE PATH: ') or out_line.startswith('DUPLICATE PATH: '): # Py Script makes this one
+            if out_line.startswith('ERROR PATH: ') or out_line.startswith('ABSOLUTE PATH: ') or out_line.startswith('DUPLICATE PATH: ') or out_line.startswith('PACKED PATH: '): # Py Script makes this one
                 context_lib = out_line.strip()
                 errors.setdefault(line, ({}, []))[1].append(out_line.strip())
                 error_count += 1

Modified: pro/scripts/utilities/findPathError.py
===================================================================
--- pro/scripts/utilities/findPathError.py	2010-04-20 08:55:43 UTC (rev 2197)
+++ pro/scripts/utilities/findPathError.py	2010-04-20 09:44:28 UTC (rev 2198)
@@ -28,35 +28,60 @@
 import bpy
 import os
 
-DUMMY_NAMES = ('Viewer Node', 'Render Result', 'Untitled')
-
 expandpath = bpy.utils.expandpath
 from os.path import exists
 
-image_duplicates = {}
+def report_images():
+    DUMMY_NAMES = ('Viewer Node', 'Render Result', 'Untitled')
 
-for i in bpy.data.images:
-    if not i.library:
-        name = i.name
-        if name in DUMMY_NAMES or os.path.splitext(name)[0] in DUMMY_NAMES:
+    image_duplicates = {}
+
+    for i in bpy.data.images:
+        if not i.library:
+            name = i.name
+            if name in DUMMY_NAMES or os.path.splitext(name)[0] in DUMMY_NAMES:
+                continue
+            
+            filename = i.filename
+            filename_abs = filename
+            if not filename.startswith('//'):
+                print("ABSOLUTE PATH:", name, filename)
+            else:
+                filename_abs = expandpath(filename)
+            
+            if not exists(filename_abs):
+                print("ERROR PATH:", name, filename, 'ABS:', filename_abs)
+            
+            if i.packed_file:
+                print("PACKED PATH:", name, filename, 'ABS:', filename_abs)
+
+            # lookup duplicates
+            image_duplicates.setdefault(filename_abs, []).append(name)
+
+    for filename_abs in sorted(image_duplicates.keys()):
+        value = image_duplicates[filename_abs]
+        if len(value) > 1:
+            print("DUPLICATE PATH:", filename_abs, 'Datablocks:', ' '.join(value))
+
+def report_modifiers():
+    for obj in bpy.data.objects:
+
+        if obj.library:
             continue
-        
-        filename = i.filename
-        filename_abs = filename
-        if not filename.startswith('//'):
-            print("ABSOLUTE PATH:", name, filename)
-        else:
-            filename_abs = expandpath(filename)
-        
-        if not exists(expandpath(filename)):
-            print("ERROR PATH:", name, filename, 'ABS:', filename_abs)
-    
-    # lookup duplicates
-    image_duplicates.setdefault(filename_abs, []).append(name)
+        name = obj.name
+        for mod in obj.modifiers:
+            if mod.type == 'MULTIRES':
+                if mod.external:
+                    filename = mod.filename
+                    filename_abs = filename
+                    if not filename.startswith('//'):
+                        print("ABSOLUTE PATH:", name, filename, "MODIFIER OF OBJECT:", obj.name)
+                    else:
+                        filename_abs = expandpath(filename)
 
-for filename_abs in sorted(image_duplicates.keys()):
-    value = image_duplicates[filename_abs]
-    if len(value) > 1:
-        print("DUPLICATE PATH:", filename_abs, 'Datablocks:', ' '.join(value))
+                    if not exists(filename_abs):
+                        print("ERROR PATH:", obj.name, filename, 'ABS:', filename_abs, "(OBJECT MODIFIER)")
 
-    
\ No newline at end of file
+if __name__ == "__main__":
+    report_images()
+    report_modifiers()
\ No newline at end of file



More information about the Durian-svn mailing list