[Durian-svn] [7062] report pinned objects and update for py3.1

campbell institute at blender.org
Thu Jul 15 16:24:07 CEST 2010


Revision: 7062
          https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=7062
Author:   campbell
Date:     2010-07-15 16:24:07 +0200 (Thu, 15 Jul 2010)
Log Message:
-----------
report pinned objects and update for py3.1

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

Modified: pro/scripts/utilities/findLibError.py
===================================================================
--- pro/scripts/utilities/findLibError.py	2010-07-15 14:13:52 UTC (rev 7061)
+++ pro/scripts/utilities/findLibError.py	2010-07-15 14:24:07 UTC (rev 7062)
@@ -95,7 +95,7 @@
         pyscript = os.path.join(os.getcwd(), os.path.join(os.path.dirname(__file__), "findPathError.py"))
 
         # Also run a py script
-        cmd = '%s -noaudio --background %s   -P %s   1> %s 2>&1' % (blender_cmd, line, pyscript, tempf)
+        cmd = '%s -noaudio --background %s --python %s   1> %s 2>&1' % (blender_cmd, line, pyscript, tempf)
         print(cmd)
         
         # print(cmd)
@@ -111,7 +111,7 @@
 
         context_lib = None
         for out_line in lines:
-            if out_line.startswith('ERROR PATH: ') or out_line.startswith('ABSOLUTE PATH: ') or out_line.startswith('DUPLICATE PATH: ') or out_line.startswith('ERROR ZOMBIA: ') or out_line.startswith('PACKED 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('ERROR ZOMBIA: ') or out_line.startswith('PACKED PATH: ') or out_line.startswith('PIN OBJECT: '): # Py Script makes this one
                 context_lib = out_line.strip()
                 errors.setdefault(line, ({}, []))[1].append(out_line.strip())
                 error_count += 1
@@ -123,14 +123,14 @@
         error_total += error_count
          
         if VERBOSE:
-            print 'Loaded', line, str(int( (float(i)/tot) * 100.0 )) + '% done,  errors:', error_count, "\n\n"
+            print('Loaded', line, str(int( (float(i)/tot) * 100.0 )) + '% done,  errors:', error_count, "\n\n")
     
         # Repor errors
         # -------------- can un-indent this part
         out = open(outfile, 'a')
-        for blenfile, blenfile_dict_and_pics in errors.iteritems():
+        for blenfile, blenfile_dict_and_pics in errors.items():
             out.write('BLENFILE: ' + blenfile + '\n')
-            for libfile, errorls in blenfile_dict_and_pics[0].iteritems():
+            for libfile, errorls in blenfile_dict_and_pics[0].items():
                 out.write('    LIBFILE: ' + libfile + '\n' )
                 for err in errorls:
                     out.write( '        : ' + err + '\n')
@@ -140,7 +140,7 @@
         # ONLY FOR INCREMENTAL WRITES
         errors.clear()
     
-    print 'error total', error_total
+    print('error total', error_total)
     
     os.system('rm ' + tempf)
     os.system('rm ' + blends)

Modified: pro/scripts/utilities/findPathError.py
===================================================================
--- pro/scripts/utilities/findPathError.py	2010-07-15 14:13:52 UTC (rev 7061)
+++ pro/scripts/utilities/findPathError.py	2010-07-15 14:24:07 UTC (rev 7062)
@@ -199,6 +199,7 @@
         if obj.library is None:
             if not obj.users_scene and not obj.users_group:
                 print("ERROR ZOMBIE:", obj)
+                # bpy.data.objects.remove(obj)
 
 
 def report_character_locations():
@@ -228,6 +229,13 @@
                             if obj.location.length > 0.0001 or Vector(obj.rotation_euler).length > 0.0001:
                                 print("ERROR PATH:", 'CHARACTER LOCTION:', obj.name, obj.location, obj.rotation_euler)
 
+
+def report_pin():
+    for ob in bpy.data.objects:
+        if not ob.library:
+            if ob.shape_key_lock:
+                print("PIN OBJECT:", ob.name)
+
 def relpath(path, start=None):
     """
     Returns the path relative to the current blend file using the "//" prefix.
@@ -361,15 +369,16 @@
     change = 0
     report_images()
     report_modifiers()
-    # report_drivers() # very verbose!
+    report_drivers() # very verbose!
     report_zombie_objects()
+    report_pin()
     # report_character_locations()
 
     
     # optional, take care!
     #change |= make_relative()
     #change |= clear_images(rem_missing = True)
-    change |= merge_duplicates()
+    #change |= merge_duplicates()
     #change |= clear_actions()
     #change |= clear_durian_links()
     #change |= clear_unused_groups()
@@ -380,4 +389,4 @@
         
     # incase running in GUI mode
     import sys
-    sys.exit(0)
+    # sys.exit(0)



More information about the Durian-svn mailing list