fix for crash with GLSL material when image couldn't be loaded.

also quiet pep8 warnings.
This commit is contained in:
Campbell Barton
2011-02-10 14:59:17 +00:00
parent 1817a045b4
commit d240206c88
8 changed files with 12 additions and 13 deletions

View File

@@ -33,7 +33,7 @@ class MESH_MT_vertex_group_specials(bpy.types.Menu):
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):

View File

@@ -163,7 +163,6 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
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")

View File

@@ -1007,7 +1007,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
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")

View File

@@ -1169,7 +1169,6 @@ class WM_OT_addon_install(bpy.types.Operator):
else:
os.remove(f_full)
def execute(self, context):
import traceback
import zipfile
@@ -1217,7 +1216,6 @@ class WM_OT_addon_install(bpy.types.Operator):
self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
return {'CANCELLED'}
#if not compressed file just copy into the addon path
try:
shutil.copyfile(pyfile, path_dest)

View File

@@ -1130,8 +1130,10 @@ static void do_material_tex(GPUShadeInput *shi)
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,