fix for crash with GLSL material when image couldn't be loaded.
also quiet pep8 warnings.
This commit is contained in:
@@ -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_linked", icon='LINK_AREA')
|
||||||
layout.operator("object.vertex_group_copy_to_selected", 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_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):
|
class MESH_MT_shape_key_specials(bpy.types.Menu):
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, bpy.types.Panel):
|
|||||||
subsub.active = game.use_anisotropic_friction
|
subsub.active = game.use_anisotropic_friction
|
||||||
subsub.prop(game, "friction_coefficients", text="", slider=True)
|
subsub.prop(game, "friction_coefficients", text="", slider=True)
|
||||||
|
|
||||||
|
|
||||||
elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
|
elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
|
||||||
layout.prop(ob, "hide_render", text="Invisible")
|
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_frame_rate")
|
||||||
row.prop(gs, "use_display_lists")
|
row.prop(gs, "use_display_lists")
|
||||||
|
|
||||||
|
|
||||||
class RENDER_PT_game_display(RenderButtonsPanel, bpy.types.Panel):
|
class RENDER_PT_game_display(RenderButtonsPanel, bpy.types.Panel):
|
||||||
bl_label = "Display"
|
bl_label = "Display"
|
||||||
COMPAT_ENGINES = {'BLENDER_GAME'}
|
COMPAT_ENGINES = {'BLENDER_GAME'}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ class PARTICLE_PT_emission(ParticleButtonsPanel, bpy.types.Panel):
|
|||||||
if part.type == 'HAIR' and not part.use_advanced_hair:
|
if part.type == 'HAIR' and not part.use_advanced_hair:
|
||||||
row.prop(part, "hair_length")
|
row.prop(part, "hair_length")
|
||||||
return
|
return
|
||||||
|
|
||||||
if part.type != 'HAIR':
|
if part.type != 'HAIR':
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
@@ -1034,7 +1034,7 @@ class PARTICLE_PT_field_weights(ParticleButtonsPanel, bpy.types.Panel):
|
|||||||
bl_label = "Field Weights"
|
bl_label = "Field Weights"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return particle_panel_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_label = "Vertexgroups"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
COMPAT_ENGINES = {'BLENDER_RENDER'}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return particle_panel_poll(cls, context)
|
return particle_panel_poll(cls, context)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, bpy.types.Panel):
|
|||||||
|
|
||||||
if md:
|
if md:
|
||||||
fluid = md.settings
|
fluid = md.settings
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
if fluid is None:
|
if fluid is None:
|
||||||
row.label("built without fluids")
|
row.label("built without fluids")
|
||||||
|
|||||||
@@ -1007,7 +1007,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
|
|||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
# only show bump settings if activated but not for normalmap images
|
# 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 = row.column()
|
||||||
col.prop(tex, "bump_method", text="Method")
|
col.prop(tex, "bump_method", text="Method")
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class NODE_MT_node(bpy.types.Menu):
|
|||||||
layout.operator("node.read_fullsamplelayers")
|
layout.operator("node.read_fullsamplelayers")
|
||||||
|
|
||||||
|
|
||||||
# Node Backdrop options
|
# Node Backdrop options
|
||||||
class NODE_PT_properties(bpy.types.Panel):
|
class NODE_PT_properties(bpy.types.Panel):
|
||||||
bl_space_type = 'NODE_EDITOR'
|
bl_space_type = 'NODE_EDITOR'
|
||||||
bl_region_type = 'UI'
|
bl_region_type = 'UI'
|
||||||
|
|||||||
@@ -1169,7 +1169,6 @@ class WM_OT_addon_install(bpy.types.Operator):
|
|||||||
else:
|
else:
|
||||||
os.remove(f_full)
|
os.remove(f_full)
|
||||||
|
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
import traceback
|
import traceback
|
||||||
import zipfile
|
import zipfile
|
||||||
@@ -1216,7 +1215,6 @@ class WM_OT_addon_install(bpy.types.Operator):
|
|||||||
elif os.path.exists(path_dest):
|
elif os.path.exists(path_dest):
|
||||||
self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
|
self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
|
|
||||||
#if not compressed file just copy into the addon path
|
#if not compressed file just copy into the addon path
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1130,8 +1130,10 @@ static void do_material_tex(GPUShadeInput *shi)
|
|||||||
if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
|
if( mtex->texflag & MTEX_BUMP_TEXTURESPACE ) {
|
||||||
float ima_x= 512.0f, ima_y= 512.f; // prevent calling textureSize, glsl 1.3 only
|
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);
|
ImBuf *ibuf= BKE_image_get_ibuf(tex->ima, &tex->iuser);
|
||||||
if(ibuf)
|
if(ibuf) {
|
||||||
ima_x= ibuf->x; ima_y= ibuf->y;
|
ima_x= ibuf->x;
|
||||||
|
ima_y= ibuf->y;
|
||||||
|
}
|
||||||
|
|
||||||
GPU_link( mat, "mtex_bump_apply_texspace",
|
GPU_link( mat, "mtex_bump_apply_texspace",
|
||||||
fDet, dBs, dBt, vR1, vR2,
|
fDet, dBs, dBt, vR1, vR2,
|
||||||
|
|||||||
Reference in New Issue
Block a user