[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3828] contrib/py/scripts/addons/ space_view3d_quickPrefs.py: added file location messeges & disabled handler that was crashing on reload or newfile

Sean Olson seanolson at gmail.com
Sun Oct 7 23:17:55 CEST 2012


Revision: 3828
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3828
Author:   liquidape
Date:     2012-10-07 21:17:54 +0000 (Sun, 07 Oct 2012)
Log Message:
-----------
added file location messeges & disabled handler that was crashing on reload or newfile

Modified Paths:
--------------
    contrib/py/scripts/addons/space_view3d_quickPrefs.py

Modified: contrib/py/scripts/addons/space_view3d_quickPrefs.py
===================================================================
--- contrib/py/scripts/addons/space_view3d_quickPrefs.py	2012-10-07 13:52:36 UTC (rev 3827)
+++ contrib/py/scripts/addons/space_view3d_quickPrefs.py	2012-10-07 21:17:54 UTC (rev 3828)
@@ -279,6 +279,7 @@
 ##########################################
 
 def gllightpreset_addPresets():
+    print('in addPresets')
     system=bpy.context.user_preferences.system
   
     system.solid_lights[0].use=True
@@ -442,6 +443,7 @@
     system.solid_lights[2].specular_color = (0.0, 0.0, 0.0)
     gllightpreset_add("Yellow Clay")
     gllightpreset_save()
+    print('exit addpresets')
 ##########################################
 ####### LightPreset Functions #######
 ##########################################
@@ -571,7 +573,8 @@
                 collection.move(j, i)
 
 #Add default setting
-def gllightpreset_addDefault():  
+def gllightpreset_addDefault():
+    print('adding default presets')  
     gllightpreset_addPresets()
     gllightpreset_sort();
     bpy.context.scene['gllightpreset_index']=0
@@ -585,16 +588,24 @@
 #This function decides where to load presets from - The order goes: BPY>File>Defaults
 @persistent
 def gllightpreset_chooseLoadLocation(context):
+
     filepath=bpy.context.scene.gllightpreset_importdirectory
+
+    print(bpy.context.scene.gllightpreset)
+
     if len(bpy.context.scene.gllightpreset)==0:                 #is it in bpy?
           if not os.path.exists(filepath):                      #is it in the folder?
+               print('quickprefs: loading default presets')
                gllightpreset_addDefault()                       #it's not, add the default
           else:                                                 #the folder exists
                directorylisting = os.listdir(filepath)
                if len(directorylisting)==0:                     #is the folder empty?
+                    print('quickprefs: loading default presets')
                     gllightpreset_addDefault()                  #the folder is empty, add default
                else:                                            #the folder is not empty
+                    print('quickprefs: loading preset folder')
                     gllightpreset_loadpresets(1)                #go ahead and load it    
+    print('quickprefs: loading from bpy')
 
 #This function scans for changes of the index of the selected preset and updates the selection if needed
 @persistent
@@ -636,6 +647,7 @@
     col.prop(lamp, "direction", text="")
 
 class gllightpreset(bpy.types.PropertyGroup):
+
     props=bpy.props
     name = props.StringProperty(update=gllightpreset_name)
     
@@ -717,6 +729,8 @@
     bl_context = "render"
     bl_region_type = 'UI'
     bl_options = {'DEFAULT_CLOSED'}
+
+    
     def draw(self, context):
         global lastname
     
@@ -867,7 +881,7 @@
     
 
     #handlers    
-    handler.load_post.append(gllightpreset_chooseLoadLocation)
+    #handler.load_post.append(gllightpreset_chooseLoadLocation)     #was crashing blender on new file load - comment for now
     handler.scene_update_pre.append(gllightpreset_scan)
 
     #let the fun begin!



More information about the Bf-extensions-cvs mailing list