[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34760] trunk/blender: fix for crash with GLSL material when image couldn't be loaded.

Campbell Barton ideasman42 at gmail.com
Thu Feb 10 15:59:18 CET 2011


Revision: 34760
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34760
Author:   campbellbarton
Date:     2011-02-10 14:59:17 +0000 (Thu, 10 Feb 2011)
Log Message:
-----------
fix for crash with GLSL material when image couldn't be loaded.
also quiet pep8 warnings.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_data_mesh.py
    trunk/blender/release/scripts/ui/properties_game.py
    trunk/blender/release/scripts/ui/properties_particle.py
    trunk/blender/release/scripts/ui/properties_physics_fluid.py
    trunk/blender/release/scripts/ui/properties_texture.py
    trunk/blender/release/scripts/ui/space_node.py
    trunk/blender/release/scripts/ui/space_userpref.py
    trunk/blender/source/blender/gpu/intern/gpu_material.c

Modified: trunk/blender/release/scripts/ui/properties_data_mesh.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_mesh.py	2011-02-10 14:13:13 UTC (rev 34759)
+++ trunk/blender/release/scripts/ui/properties_data_mesh.py	2011-02-10 14:59:17 UTC (rev 34760)
@@ -33,7 +33,7 @@
         layout.operator("object.vertex_group_copy_to_linked", icon='LINK_AREA')
         layout.operator("object.vertex_group_copy_to_selected", icon='LINK_AREA')
         layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT')
-        layout.operator("object.vertex_group_remove", icon='X', text="Delete All").all=True
+        layout.operator("object.vertex_group_remove", icon='X', text="Delete All").all = True
 
 
 class MESH_MT_shape_key_specials(bpy.types.Menu):

Modified: trunk/blender/release/scripts/ui/properties_game.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_game.py	2011-02-10 14:13:13 UTC (rev 34759)
+++ trunk/blender/release/scripts/ui/properties_game.py	2011-02-10 14:59:17 UTC (rev 34760)
@@ -163,7 +163,6 @@
             subsub.active = game.use_anisotropic_friction
             subsub.prop(game, "friction_coefficients", text="", slider=True)
 
-
         elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
             layout.prop(ob, "hide_render", text="Invisible")
 
@@ -347,7 +346,7 @@
         row.prop(gs, "use_frame_rate")
         row.prop(gs, "use_display_lists")
 
-        
+
 class RENDER_PT_game_display(RenderButtonsPanel, bpy.types.Panel):
     bl_label = "Display"
     COMPAT_ENGINES = {'BLENDER_GAME'}

Modified: trunk/blender/release/scripts/ui/properties_particle.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_particle.py	2011-02-10 14:13:13 UTC (rev 34759)
+++ trunk/blender/release/scripts/ui/properties_particle.py	2011-02-10 14:59:17 UTC (rev 34760)
@@ -177,7 +177,7 @@
         if part.type == 'HAIR' and not part.use_advanced_hair:
             row.prop(part, "hair_length")
             return
-            
+
         if part.type != 'HAIR':
             split = layout.split()
 
@@ -1034,7 +1034,7 @@
     bl_label = "Field Weights"
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER'}
-    
+
     @classmethod
     def poll(cls, context):
         return particle_panel_poll(cls, context)
@@ -1083,7 +1083,7 @@
     bl_label = "Vertexgroups"
     bl_options = {'DEFAULT_CLOSED'}
     COMPAT_ENGINES = {'BLENDER_RENDER'}
-    
+
     @classmethod
     def poll(cls, context):
         return particle_panel_poll(cls, context)

Modified: trunk/blender/release/scripts/ui/properties_physics_fluid.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_fluid.py	2011-02-10 14:13:13 UTC (rev 34759)
+++ trunk/blender/release/scripts/ui/properties_physics_fluid.py	2011-02-10 14:59:17 UTC (rev 34760)
@@ -42,7 +42,7 @@
 
         if md:
             fluid = md.settings
-            
+
             row = layout.row()
             if fluid is None:
                 row.label("built without fluids")

Modified: trunk/blender/release/scripts/ui/properties_texture.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_texture.py	2011-02-10 14:13:13 UTC (rev 34759)
+++ trunk/blender/release/scripts/ui/properties_texture.py	2011-02-10 14:59:17 UTC (rev 34760)
@@ -1007,7 +1007,7 @@
 
             row = layout.row()
             # only show bump settings if activated but not for normalmap images
-            row.active = tex.use_map_normal and not( tex.texture.type == 'IMAGE' and tex.texture.use_normal_map )
+            row.active = tex.use_map_normal and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map)
 
             col = row.column()
             col.prop(tex, "bump_method", text="Method")

Modified: trunk/blender/release/scripts/ui/space_node.py
===================================================================
--- trunk/blender/release/scripts/ui/space_node.py	2011-02-10 14:13:13 UTC (rev 34759)
+++ trunk/blender/release/scripts/ui/space_node.py	2011-02-10 14:59:17 UTC (rev 34760)
@@ -166,7 +166,7 @@
         layout.operator("node.read_fullsamplelayers")
 
 
-# Node Backdrop options 
+# Node Backdrop options
 class NODE_PT_properties(bpy.types.Panel):
     bl_space_type = 'NODE_EDITOR'
     bl_region_type = 'UI'

Modified: trunk/blender/release/scripts/ui/space_userpref.py
===================================================================
--- trunk/blender/release/scripts/ui/space_userpref.py	2011-02-10 14:13:13 UTC (rev 34759)
+++ trunk/blender/release/scripts/ui/space_userpref.py	2011-02-10 14:59:17 UTC (rev 34760)
@@ -1169,7 +1169,6 @@
                 else:
                     os.remove(f_full)
 
-
     def execute(self, context):
         import traceback
         import zipfile
@@ -1216,7 +1215,6 @@
             elif os.path.exists(path_dest):
                 self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
                 return {'CANCELLED'}
-                
 
             #if not compressed file just copy into the addon path
             try:

Modified: trunk/blender/source/blender/gpu/intern/gpu_material.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_material.c	2011-02-10 14:13:13 UTC (rev 34759)
+++ trunk/blender/source/blender/gpu/intern/gpu_material.c	2011-02-10 14:59:17 UTC (rev 34760)
@@ -1130,8 +1130,10 @@
 						if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
 							float ima_x= 512.0f, ima_y= 512.f;		// prevent calling textureSize, glsl 1.3 only
 							ImBuf *ibuf= BKE_image_get_ibuf(tex->ima, &tex->iuser);
-							if(ibuf) 
-								ima_x= ibuf->x; ima_y= ibuf->y;
+							if(ibuf) {
+								ima_x= ibuf->x;
+								ima_y= ibuf->y;
+							}
 							
 							GPU_link( mat, "mtex_bump_apply_texspace",
 							          fDet, dBs, dBt, vR1, vR2, 




More information about the Bf-blender-cvs mailing list