From 9bf20b5ec0dd4886cd66c51ea4984861bf49611a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 9 Oct 2009 15:25:19 +0000 Subject: [PATCH] UI scripts: * Fix AAO showing Distance property even though it is not supported. * Fix texture buttons not displaying texture stack from the node material. * Small visual tweak to particle mode options. --- release/scripts/ui/buttons_texture.py | 18 ++++++++++++++---- release/scripts/ui/buttons_world.py | 3 ++- release/scripts/ui/space_view3d_toolbar.py | 4 +--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/release/scripts/ui/buttons_texture.py b/release/scripts/ui/buttons_texture.py index b76f35c3ec3..62281695177 100644 --- a/release/scripts/ui/buttons_texture.py +++ b/release/scripts/ui/buttons_texture.py @@ -1,6 +1,16 @@ import bpy +def active_node_mat(mat): + if mat: + mat_node = mat.active_node_material + if mat_node: + return mat_node + else: + return mat + + return None + class TextureButtonsPanel(bpy.types.Panel): __space_type__ = 'PROPERTIES' __region_type__ = 'WINDOW' @@ -18,7 +28,7 @@ class TEXTURE_PT_preview(TextureButtonsPanel): tex = context.texture slot = context.texture_slot - ma = context.material + ma = active_node_mat(context.material) la = context.lamp wo = context.world br = context.brush @@ -45,7 +55,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel): tex = context.texture - id = context.material + id = active_node_mat(context.material) if not id: id = context.lamp if not id: id = context.world if not id: id = context.brush @@ -129,7 +139,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel): def draw(self, context): layout = self.layout - ma = context.material + ma = active_node_mat(context.material) la = context.lamp wo = context.world br = context.brush @@ -202,7 +212,7 @@ class TEXTURE_PT_influence(TextureSlotPanel): def draw(self, context): layout = self.layout - ma = context.material + ma = active_node_mat(context.material) la = context.lamp wo = context.world br = context.brush diff --git a/release/scripts/ui/buttons_world.py b/release/scripts/ui/buttons_world.py index 3134c0ce46b..b64efc1048d 100644 --- a/release/scripts/ui/buttons_world.py +++ b/release/scripts/ui/buttons_world.py @@ -129,7 +129,8 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel): col = split.column() col.itemL(text="Attenuation:") - col.itemR(ao, "distance") + if ao.gather_method == 'RAYTRACE': + col.itemR(ao, "distance") col.itemR(ao, "falloff") sub = col.row() sub.active = ao.falloff diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index 4c1b54ea8e6..ab1e161b928 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -676,9 +676,7 @@ class VIEW3D_PT_tools_particlemode(View3DPanel): pe = context.tool_settings.particle_edit ob = pe.object - row = layout.row() - row.itemL(text="Edit:") - row.itemR(pe, "type", text="") + layout.itemR(pe, "type", text="") if pe.type == 'PARTICLES': if ob.particle_systems: