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")
@@ -347,7 +346,7 @@ class RENDER_PT_game_performance(RenderButtonsPanel, bpy.types.Panel):
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'}

View File

@@ -177,7 +177,7 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, bpy.types.Panel):
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 @@ class PARTICLE_PT_field_weights(ParticleButtonsPanel, bpy.types.Panel):
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 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, bpy.types.Panel):
bl_label = "Vertexgroups"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
@classmethod
def poll(cls, context):
return particle_panel_poll(cls, context)

View File

@@ -42,7 +42,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
if md:
fluid = md.settings
row = layout.row()
if fluid is None:
row.label("built without fluids")

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

@@ -166,7 +166,7 @@ class NODE_MT_node(bpy.types.Menu):
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'

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
@@ -1216,7 +1215,6 @@ class WM_OT_addon_install(bpy.types.Operator):
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:

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,