Browse Source

Fix some noisy tracebacks in the UI draw code

pull/125/head
Adam Johnson 6 years ago
parent
commit
d75fd16b24
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 6
      korman/ui/ui_image.py
  2. 7
      korman/ui/ui_texture.py

6
korman/ui/ui_image.py

@ -20,6 +20,6 @@ class PlasmaImageEditorHeader(bpy.types.Header):
def draw(self, context):
layout, image = self.layout, context.space_data.image
settings = image.plasma_image
layout.prop(settings, "texcache_method", text="")
if image is not None:
settings = image.plasma_image
layout.prop(settings, "texcache_method", text="")

7
korman/ui/ui_texture.py

@ -55,14 +55,15 @@ class PlasmaLayerPanel(TextureButtonsPanel, bpy.types.Panel):
bl_label = "Plasma Layer Options"
def draw(self, context):
texture, slot = context.texture, context.texture_slot
texture, slot = context.texture, getattr(context, "texture_slot", None)
use_stencil = slot.use_stencil if slot is not None else False
layer_props = texture.plasma_layer
layout = self.layout
split = layout.split()
col = split.column()
col.label("Animation:")
col.active = self._has_animation_data(context) and not slot.use_stencil
col.active = self._has_animation_data(context) and not use_stencil
col.prop(layer_props, "anim_auto_start")
col.prop(layer_props, "anim_loop")
col.separator()
@ -71,7 +72,7 @@ class PlasmaLayerPanel(TextureButtonsPanel, bpy.types.Panel):
col = split.column()
col.label("Miscellaneous:")
col.active = not slot.use_stencil
col.active = not use_stencil
col.prop(layer_props, "opacity", text="Opacity")
col.separator()

Loading…
Cancel
Save