UI scripts:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 9 Oct 2009 15:25:19 +0000 (15:25 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 9 Oct 2009 15:25:19 +0000 (15:25 +0000)
* 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
release/scripts/ui/buttons_world.py
release/scripts/ui/space_view3d_toolbar.py

index b76f35c3ec3c9f7242b4075d83da43b2df7d3763..62281695177bfe1c8484fc4f1da1fc4157b11fa7 100644 (file)
@@ -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
index 3134c0ce46bc2f3308e9d3c38785e004533a3b78..b64efc1048dfaf1ad60c0831a807c33ee53b4622 100644 (file)
@@ -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
index 4c1b54ea8e65097f4cd1c1e7a47eeb22f5ff2799..ab1e161b928b1b4c496958694c30aa2ec37019f7 100644 (file)
@@ -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: